summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_texture.c
diff options
context:
space:
mode:
authorJi-Youn Park <jy0703.park@samsung.com>2015-05-11 19:08:12 +0900
committerJi-Youn Park <jy0703.park@samsung.com>2015-05-11 19:08:12 +0900
commit9bf8a0e56b72fed562a127f5af3e91eaeaa33fd9 (patch)
tree826c775979313f53f88645da3e6c839cd8346277 /src/modules/evas/engines/gl_common/evas_gl_texture.c
parentb309a3e0f15fcb32ae82d686c7811bf8f2b16b42 (diff)
evas: fix bug in evas gl texture.
Summary: If the pixel size of image is not 32 bit like EVAS_COLORSPACE_AGRY88, GL_UNPACK_ALIGNMENT have to be changed.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 5c1c07f247..e71b8e4707 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -1047,7 +1047,10 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1047 { 1047 {
1048 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 1048 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1049 } 1049 }
1050 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1050 if ((bytes_count == 1) || (bytes_count == 2))
1051 glPixelStorei(GL_UNPACK_ALIGNMENT, bytes_count);
1052 else
1053 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1051 1054
1052// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h); 1055// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
1053 // +-+ 1056 // +-+
@@ -1370,7 +1373,10 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1370 { 1373 {
1371 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 1374 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1372 } 1375 }
1373 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1376 if ((bytes_count == 1) || (bytes_count == 2))
1377 glPixelStorei(GL_UNPACK_ALIGNMENT, bytes_count);
1378 else
1379 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1374 1380
1375 _tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out); 1381 _tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out);
1376 1382