diff options
author | marha <marha@users.sourceforge.net> | 2012-07-18 08:33:31 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-07-18 08:33:31 +0200 |
commit | 2ff5448bcca8cba4b62026d5493cb08aaf2838d8 (patch) | |
tree | 355bad312548535d148aa058c089aefc81e10ab3 /mesalib/src/mesa/main/texcompress_etc_tmp.h | |
parent | d09d7be8bbbb39926f44834023d7120535155829 (diff) | |
download | vcxsrv-2ff5448bcca8cba4b62026d5493cb08aaf2838d8.tar.gz vcxsrv-2ff5448bcca8cba4b62026d5493cb08aaf2838d8.tar.bz2 vcxsrv-2ff5448bcca8cba4b62026d5493cb08aaf2838d8.zip |
fontconfig mesa xserver git update 18 Jul 2012
Diffstat (limited to 'mesalib/src/mesa/main/texcompress_etc_tmp.h')
-rw-r--r-- | mesalib/src/mesa/main/texcompress_etc_tmp.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/texcompress_etc_tmp.h b/mesalib/src/mesa/main/texcompress_etc_tmp.h index 5c8c6decf..8bbb2cde8 100644 --- a/mesalib/src/mesa/main/texcompress_etc_tmp.h +++ b/mesalib/src/mesa/main/texcompress_etc_tmp.h @@ -134,3 +134,37 @@ TAG(etc1_fetch_texel)(const struct TAG(etc1_block) *block, dst[1] = TAG(etc1_clamp)(base_color[1], modifier); dst[2] = TAG(etc1_clamp)(base_color[2], modifier); } + +static void +etc1_unpack_rgba8888(uint8_t *dst_row, + unsigned dst_stride, + const uint8_t *src_row, + unsigned src_stride, + unsigned width, + unsigned height) +{ + const unsigned bw = 4, bh = 4, bs = 8, comps = 4; + struct etc1_block block; + unsigned x, y, i, j; + + for (y = 0; y < height; y += bh) { + const uint8_t *src = src_row; + + for (x = 0; x < width; x+= bw) { + etc1_parse_block(&block, src); + + for (j = 0; j < bh; j++) { + uint8_t *dst = dst_row + (y + j) * dst_stride + x * comps; + for (i = 0; i < bw; i++) { + etc1_fetch_texel(&block, i, j, dst); + dst[3] = 255; + dst += comps; + } + } + + src += bs; + } + + src_row += src_stride; + } +} |