Lines Matching defs:source
1767 void Surface::update(Buffer &destination, Buffer &source)
1769 // ASSERT(source.lock != LOCK_UNLOCKED);
1772 if(destination.buffer != source.buffer)
1774 ASSERT(source.dirty && !destination.dirty);
1776 switch(source.format)
1778 case FORMAT_R8G8B8: decodeR8G8B8(destination, source); break; // FIXME: Check destination format
1779 case FORMAT_X1R5G5B5: decodeX1R5G5B5(destination, source); break; // FIXME: Check destination format
1780 case FORMAT_A1R5G5B5: decodeA1R5G5B5(destination, source); break; // FIXME: Check destination format
1781 case FORMAT_X4R4G4B4: decodeX4R4G4B4(destination, source); break; // FIXME: Check destination format
1782 case FORMAT_A4R4G4B4: decodeA4R4G4B4(destination, source); break; // FIXME: Check destination format
1783 case FORMAT_P8: decodeP8(destination, source); break; // FIXME: Check destination format
1785 case FORMAT_DXT1: decodeDXT1(destination, source); break; // FIXME: Check destination format
1786 case FORMAT_DXT3: decodeDXT3(destination, source); break; // FIXME: Check destination format
1787 case FORMAT_DXT5: decodeDXT5(destination, source); break; // FIXME: Check destination format
1789 case FORMAT_ATI1: decodeATI1(destination, source); break; // FIXME: Check destination format
1790 case FORMAT_ATI2: decodeATI2(destination, source); break; // FIXME: Check destination format
1791 case FORMAT_R11_EAC: decodeEAC(destination, source, 1, false); break; // FIXME: Check destination format
1792 case FORMAT_SIGNED_R11_EAC: decodeEAC(destination, source, 1, true); break; // FIXME: Check destination format
1793 case FORMAT_RG11_EAC: decodeEAC(destination, source, 2, false); break; // FIXME: Check destination format
1794 case FORMAT_SIGNED_RG11_EAC: decodeEAC(destination, source, 2, true); break; // FIXME: Check destination format
1796 case FORMAT_RGB8_ETC2: decodeETC2(destination, source, 0, false); break; // FIXME: Check destination format
1797 case FORMAT_SRGB8_ETC2: decodeETC2(destination, source, 0, true); break; // FIXME: Check destination format
1798 case FORMAT_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: decodeETC2(destination, source, 1, false); break; // FIXME: Check destination format
1799 case FORMAT_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: decodeETC2(destination, source, 1, true); break; // FIXME: Check destination format
1800 case FORMAT_RGBA8_ETC2_EAC: decodeETC2(destination, source, 8, false); break; // FIXME: Check destination format
1801 case FORMAT_SRGB8_ALPHA8_ETC2_EAC: decodeETC2(destination, source, 8, true); break; // FIXME: Check destination format
1802 case FORMAT_RGBA_ASTC_4x4_KHR: decodeASTC(destination, source, 4, 4, 1, false); break; // FIXME: Check destination format
1803 case FORMAT_RGBA_ASTC_5x4_KHR: decodeASTC(destination, source, 5, 4, 1, false); break; // FIXME: Check destination format
1804 case FORMAT_RGBA_ASTC_5x5_KHR: decodeASTC(destination, source, 5, 5, 1, false); break; // FIXME: Check destination format
1805 case FORMAT_RGBA_ASTC_6x5_KHR: decodeASTC(destination, source, 6, 5, 1, false); break; // FIXME: Check destination format
1806 case FORMAT_RGBA_ASTC_6x6_KHR: decodeASTC(destination, source, 6, 6, 1, false); break; // FIXME: Check destination format
1807 case FORMAT_RGBA_ASTC_8x5_KHR: decodeASTC(destination, source, 8, 5, 1, false); break; // FIXME: Check destination format
1808 case FORMAT_RGBA_ASTC_8x6_KHR: decodeASTC(destination, source, 8, 6, 1, false); break; // FIXME: Check destination format
1809 case FORMAT_RGBA_ASTC_8x8_KHR: decodeASTC(destination, source, 8, 8, 1, false); break; // FIXME: Check destination format
1810 case FORMAT_RGBA_ASTC_10x5_KHR: decodeASTC(destination, source, 10, 5, 1, false); break; // FIXME: Check destination format
1811 case FORMAT_RGBA_ASTC_10x6_KHR: decodeASTC(destination, source, 10, 6, 1, false); break; // FIXME: Check destination format
1812 case FORMAT_RGBA_ASTC_10x8_KHR: decodeASTC(destination, source, 10, 8, 1, false); break; // FIXME: Check destination format
1813 case FORMAT_RGBA_ASTC_10x10_KHR: decodeASTC(destination, source, 10, 10, 1, false); break; // FIXME: Check destination format
1814 case FORMAT_RGBA_ASTC_12x10_KHR: decodeASTC(destination, source, 12, 10, 1, false); break; // FIXME: Check destination format
1815 case FORMAT_RGBA_ASTC_12x12_KHR: decodeASTC(destination, source, 12, 12, 1, false); break; // FIXME: Check destination format
1816 case FORMAT_SRGB8_ALPHA8_ASTC_4x4_KHR: decodeASTC(destination, source, 4, 4, 1, true); break; // FIXME: Check destination format
1817 case FORMAT_SRGB8_ALPHA8_ASTC_5x4_KHR: decodeASTC(destination, source, 5, 4, 1, true); break; // FIXME: Check destination format
1818 case FORMAT_SRGB8_ALPHA8_ASTC_5x5_KHR: decodeASTC(destination, source, 5, 5, 1, true); break; // FIXME: Check destination format
1819 case FORMAT_SRGB8_ALPHA8_ASTC_6x5_KHR: decodeASTC(destination, source, 6, 5, 1, true); break; // FIXME: Check destination format
1820 case FORMAT_SRGB8_ALPHA8_ASTC_6x6_KHR: decodeASTC(destination, source, 6, 6, 1, true); break; // FIXME: Check destination format
1821 case FORMAT_SRGB8_ALPHA8_ASTC_8x5_KHR: decodeASTC(destination, source, 8, 5, 1, true); break; // FIXME: Check destination format
1822 case FORMAT_SRGB8_ALPHA8_ASTC_8x6_KHR: decodeASTC(destination, source, 8, 6, 1, true); break; // FIXME: Check destination format
1823 case FORMAT_SRGB8_ALPHA8_ASTC_8x8_KHR: decodeASTC(destination, source, 8, 8, 1, true); break; // FIXME: Check destination format
1824 case FORMAT_SRGB8_ALPHA8_ASTC_10x5_KHR: decodeASTC(destination, source, 10, 5, 1, true); break; // FIXME: Check destination format
1825 case FORMAT_SRGB8_ALPHA8_ASTC_10x6_KHR: decodeASTC(destination, source, 10, 6, 1, true); break; // FIXME: Check destination format
1826 case FORMAT_SRGB8_ALPHA8_ASTC_10x8_KHR: decodeASTC(destination, source, 10, 8, 1, true); break; // FIXME: Check destination format
1827 case FORMAT_SRGB8_ALPHA8_ASTC_10x10_KHR: decodeASTC(destination, source, 10, 10, 1, true); break; // FIXME: Check destination format
1828 case FORMAT_SRGB8_ALPHA8_ASTC_12x10_KHR: decodeASTC(destination, source, 12, 10, 1, true); break; // FIXME: Check destination format
1829 case FORMAT_SRGB8_ALPHA8_ASTC_12x12_KHR: decodeASTC(destination, source, 12, 12, 1, true); break; // FIXME: Check destination format
1830 default: genericUpdate(destination, source); break;
1835 void Surface::genericUpdate(Buffer &destination, Buffer &source)
1837 unsigned char *sourceSlice = (unsigned char*)source.buffer;
1840 int depth = min(destination.depth, source.depth);
1841 int height = min(destination.height, source.height);
1842 int width = min(destination.width, source.width);
1843 int rowBytes = width * source.bytes;
1852 if(source.format == destination.format)
1863 Color<float> color = source.read(sourceElement);
1866 sourceElement += source.bytes;
1871 sourceRow += source.pitchB;
1875 sourceSlice += source.sliceB;
1880 void Surface::decodeR8G8B8(Buffer &destination, const Buffer &source)
1882 unsigned char *sourceSlice = (unsigned char*)source.buffer;
1885 for(int z = 0; z < destination.depth && z < source.depth; z++)
1890 for(int y = 0; y < destination.height && y < source.height; y++)
1895 for(int x = 0; x < destination.width && x < source.width; x++)
1903 sourceElement += source.bytes;
1907 sourceRow += source.pitchB;
1911 sourceSlice += source.sliceB;
1916 void Surface::decodeX1R5G5B5(Buffer &destination, const Buffer &source)
1918 unsigned char *sourceSlice = (unsigned char*)source.buffer;
1921 for(int z = 0; z < destination.depth && z < source.depth; z++)
1926 for(int y = 0; y < destination.height && y < source.height; y++)
1931 for(int x = 0; x < destination.width && x < source.width; x++)
1941 sourceElement += source.bytes;
1945 sourceRow += source.pitchB;
1949 sourceSlice += source.sliceB;
1954 void Surface::decodeA1R5G5B5(Buffer &destination, const Buffer &source)
1956 unsigned char *sourceSlice = (unsigned char*)source.buffer;
1959 for(int z = 0; z < destination.depth && z < source.depth; z++)
1964 for(int y = 0; y < destination.height && y < source.height; y++)
1969 for(int x = 0; x < destination.width && x < source.width; x++)
1980 sourceElement += source.bytes;
1984 sourceRow += source.pitchB;
1988 sourceSlice += source.sliceB;
1993 void Surface::decodeX4R4G4B4(Buffer &destination, const Buffer &source)
1995 unsigned char *sourceSlice = (unsigned char*)source.buffer;
1998 for(int z = 0; z < destination.depth && z < source.depth; z++)
2003 for(int y = 0; y < destination.height && y < source.height; y++)
2008 for(int x = 0; x < destination.width && x < source.width; x++)
2018 sourceElement += source.bytes;
2022 sourceRow += source.pitchB;
2026 sourceSlice += source.sliceB;
2031 void Surface::decodeA4R4G4B4(Buffer &destination, const Buffer &source)
2033 unsigned char *sourceSlice = (unsigned char*)source.buffer;
2036 for(int z = 0; z < destination.depth && z < source.depth; z++)
2041 for(int y = 0; y < destination.height && y < source.height; y++)
2046 for(int x = 0; x < destination.width && x < source.width; x++)
2057 sourceElement += source.bytes;
2061 sourceRow += source.pitchB;
2065 sourceSlice += source.sliceB;
2070 void Surface::decodeP8(Buffer &destination, const Buffer &source)
2072 unsigned char *sourceSlice = (unsigned char*)source.buffer;
2075 for(int z = 0; z < destination.depth && z < source.depth; z++)
2080 for(int y = 0; y < destination.height && y < source.height; y++)
2085 for(int x = 0; x < destination.width && x < source.width; x++)
2096 sourceElement += source.bytes;
2100 sourceRow += source.pitchB;
2104 sourceSlice += source.sliceB;
2113 const DXT1 *source = (const DXT1*)external.buffer;
2125 c[0] = source->c0;
2126 c[1] = source->c1;
2128 if(source->c0 > source->c1) // No transparency
2160 dest[(x + i) + (y + j) * internal.width] = c[(unsigned int)(source->lut >> 2 * (i + j * 4)) % 4];
2164 source++;
2175 const DXT3 *source = (const DXT3*)external.buffer;
2187 c[0] = source->c0;
2188 c[1] = source->c1;
2204 unsigned int a = (unsigned int)(source->a >> 4 * (i + j * 4)) & 0x0F;
2205 unsigned int color = (c[(unsigned int)(source->lut >> 2 * (i + j * 4)) % 4] & 0x00FFFFFF) | ((a << 28) + (a << 24));
2211 source++;
2222 const DXT5 *source = (const DXT5*)external.buffer;
2234 c[0] = source->c0;
2235 c[1] = source->c1;
2249 a[0] = source->a0;
2250 a[1] = source->a1;
2275 unsigned int alpha = (unsigned int)a[(unsigned int)(source->alut >> (16 + 3 * (i + j * 4))) % 8] << 24;
2276 unsigned int color = (c[(source->clut >> 2 * (i + j * 4)) % 4] & 0x00FFFFFF) | alpha;
2282 source++;
2294 const ATI1 *source = (const ATI1*)external.buffer;
2306 r[0] = source->r0;
2307 r[1] = source->r1;
2332 dest[(x + i) + (y + j) * internal.width] = r[(unsigned int)(source->rlut >> (16 + 3 * (i + j * 4))) % 8];
2336 source++;
2347 const ATI2 *source = (const ATI2*)external.buffer;
2359 X[0] = source->x0;
2360 X[1] = source->x1;
2383 Y[0] = source->y0;
2384 Y[1] = source->y1;
2409 word r = X[(unsigned int)(source->xlut >> (16 + 3 * (i + j * 4))) % 8];
2410 word g = Y[(unsigned int)(source->ylut >> (16 + 3 * (i + j * 4))) % 8];
2416 source++;
3365 void Surface::copyInternal(const Surface* source, int x, int y, float srcX, float srcY, bool filter)
3367 ASSERT(internal.lock != LOCK_UNLOCKED && source && source->internal.lock != LOCK_UNLOCKED);
3373 color = source->internal.read((int)srcX, (int)srcY);
3377 color = source->internal.sample(srcX, srcY);
3383 void Surface::copyInternal(const Surface* source, int x, int y, int z, float srcX, float srcY, float srcZ, bool filter)
3385 ASSERT(internal.lock != LOCK_UNLOCKED && source && source->internal.lock != LOCK_UNLOCKED);
3391 color = source->internal.read((int)srcX, (int)srcY, int(srcZ));
3395 color = source->internal.sample(srcX, srcY, srcZ);
3688 void *source = internal.lockRect(0, 0, 0, LOCK_READWRITE);
3696 unsigned char *source0 = (unsigned char*)source;