diff options
author | Stanislav Vorobiov <s.vorobiov@samsung.com> | 2014-02-15 17:12:25 +0400 |
---|---|---|
committer | Stanislav Vorobiov <s.vorobiov@samsung.com> | 2014-02-15 20:02:54 +0400 |
commit | 3c67f68146646669bdea16cacf174c1c7f2fe6ec (patch) | |
tree | 7dceed4a170624242dfac819ebfb832bbd91f670 | |
parent | 1af03d5de447361a91243c938fa025476876dced (diff) | |
download | emulator-yagl-3c67f68146646669bdea16cacf174c1c7f2fe6ec.tar.gz emulator-yagl-3c67f68146646669bdea16cacf174c1c7f2fe6ec.tar.bz2 emulator-yagl-3c67f68146646669bdea16cacf174c1c7f2fe6ec.zip |
YaGL: Fix GL_ALPHA to GL_BGRA conversions
Change-Id: Id3548ee62dc4f76eb45934cdfe189ea94320404d
-rw-r--r-- | GLES_common/yagl_gles_pixel_formats.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/GLES_common/yagl_gles_pixel_formats.c b/GLES_common/yagl_gles_pixel_formats.c index 98fa706..3febfab 100644 --- a/GLES_common/yagl_gles_pixel_formats.c +++ b/GLES_common/yagl_gles_pixel_formats.c @@ -23,7 +23,7 @@ static void yagl_convert_alpha_ub_bgra_ub(const GLvoid *src, for (i = 0; i < height; ++i) { for (j = 0; j < width; ++j) { - *(uint32_t*)(dst + j * 4) = (uint32_t)(*(uint8_t*)(src + j)) << 24; + *(uint32_t*)(dst + j * 4) = ((uint32_t)(*(uint8_t*)(src + j)) << 24) | 0xFFFFFF; } src += src_stride; dst += dst_stride; @@ -59,9 +59,9 @@ static void yagl_convert_alpha_f_bgra_f(const GLvoid *src, for (i = 0; i < height; ++i) { for (j = 0; j < width; ++j) { - *(uint32_t*)(dst + j * 16 + 0) = 0; - *(uint32_t*)(dst + j * 16 + 4) = 0; - *(uint32_t*)(dst + j * 16 + 8) = 0; + *(GLfloat*)(dst + j * 16 + 0) = 1.0f; + *(GLfloat*)(dst + j * 16 + 4) = 1.0f; + *(GLfloat*)(dst + j * 16 + 8) = 1.0f; *(uint32_t*)(dst + j * 16 + 12) = *(uint32_t*)(src + j * 4); } src += src_stride; @@ -98,9 +98,9 @@ static void yagl_convert_alpha_hf_bgra_hf(const GLvoid *src, for (i = 0; i < height; ++i) { for (j = 0; j < width; ++j) { - *(uint16_t*)(dst + j * 8 + 0) = 0; - *(uint16_t*)(dst + j * 8 + 2) = 0; - *(uint16_t*)(dst + j * 8 + 4) = 0; + *(uint16_t*)(dst + j * 8 + 0) = YAGL_HALF_FLOAT_1_0; + *(uint16_t*)(dst + j * 8 + 2) = YAGL_HALF_FLOAT_1_0; + *(uint16_t*)(dst + j * 8 + 4) = YAGL_HALF_FLOAT_1_0; *(uint16_t*)(dst + j * 8 + 6) = *(uint16_t*)(src + j * 2); } src += src_stride; |