summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-04-29 15:33:51 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-04-29 15:48:47 +0900
commitfa9f7a4c892a04b7a2bf7065346124eb9479dab6 (patch)
treed21f089c4a2b2ac1d5684fea34736163debffe5a
parentc399017ceffffb45d4ec027a6305d3da9afb80cc (diff)
Evas: Fix stretching of ETC1/2 textures
ETC1/2 textures are (for now) allocated one by one for each image, because we use only glCompressedTexImage (not SubImage). So, the texture height must fit that of its content. This commit bypasses the usual pool allocation logic where textures are rounded up to the next multiple of 16 pixels in height, in case of ETC1/2.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c17
1 files changed, 13 insertions, 4 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 7cc501af5e..993e532ed0 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -282,10 +282,10 @@ evas_gl_common_texture_light_free(Evas_GL_Texture *tex)
282} 282}
283 283
284static Evas_GL_Texture_Pool * 284static Evas_GL_Texture_Pool *
285_pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum format) 285_pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, GLenum intformat, GLenum format)
286{ 286{
287 Evas_GL_Texture_Pool *pt; 287 Evas_GL_Texture_Pool *pt;
288 Eina_Bool ok; 288 Eina_Bool ok, no_rounding = EINA_FALSE;
289 289
290 if ((w > gc->shared->info.max_texture_size) || 290 if ((w > gc->shared->info.max_texture_size) ||
291 (h > gc->shared->info.max_texture_size)) 291 (h > gc->shared->info.max_texture_size))
@@ -295,8 +295,17 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum fo
295 } 295 }
296 pt = calloc(1, sizeof(Evas_GL_Texture_Pool)); 296 pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
297 if (!pt) return NULL; 297 if (!pt) return NULL;
298 h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size; 298
299 _tex_adjust(gc, &w, &h); 299 if ((intformat == etc1_fmt) ||
300 (intformat == etc2_rgb_fmt) ||
301 (intformat == etc2_rgba_fmt))
302 no_rounding = EINA_TRUE;
303
304 if (!no_rounding)
305 {
306 h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
307 _tex_adjust(gc, &w, &h);
308 }
300 pt->gc = gc; 309 pt->gc = gc;
301 pt->w = w; 310 pt->w = w;
302 pt->h = h; 311 pt->h = h;