summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2014-08-16 15:06:24 +0200
committerCedric Bail <cedric.bail@free.fr>2014-08-16 15:15:07 +0200
commit396433bbc27819e6205db0d2cc8dcddf10d1dd46 (patch)
tree0ec5c35c758591865c36da4a5b269c190831aa0f /src/modules
parentdde9a1e97785b579662349397009e5c97d7daba7 (diff)
evas: handle GL_LUMINANCE_ALPHA.
This fix T1459. I have added an ERR to catch this kind of issue earlier. I am wondering if that should not be even a CRI. The reason why we do see the problem only after the introduction of the use of Eina_Rectangle_Pool is due to how efficiently they pack data, resulting in ressource ending up in the wrong format bucket. Nothing wrong with the patch itself.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c11
1 files changed, 5 insertions, 6 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 f3e2ab9333..07f463ccd3 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -235,14 +235,15 @@ _tex_format_index(GLuint format)
235 case GL_LUMINANCE12: 235 case GL_LUMINANCE12:
236 case GL_LUMINANCE16: 236 case GL_LUMINANCE16:
237 return 10; 237 return 10;
238 case GL_LUMINANCE_ALPHA:
238 case GL_LUMINANCE4_ALPHA4: 239 case GL_LUMINANCE4_ALPHA4:
239 case GL_LUMINANCE8_ALPHA8: 240 case GL_LUMINANCE8_ALPHA8:
240 case GL_LUMINANCE12_ALPHA12: 241 case GL_LUMINANCE12_ALPHA12:
241 case GL_LUMINANCE16_ALPHA16: 242 case GL_LUMINANCE16_ALPHA16:
242 return 11; 243 return 11;
243 default: 244 default:
244 // abort? 245 ERR("Unknown format returned specified by GL stack: %x", format);
245 return 0; 246 return -1;
246 } 247 }
247 return 0; 248 return 0;
248} 249}
@@ -465,14 +466,13 @@ _pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
465 } 466 }
466 467
467 th2 = _tex_format_index(intformat); 468 th2 = _tex_format_index(intformat);
469 if (th2 < 0) return NULL;
468 EINA_LIST_FOREACH(gc->shared->tex.atlas[th2], l, pt) 470 EINA_LIST_FOREACH(gc->shared->tex.atlas[th2], l, pt)
469 { 471 {
470 if ((*apt = _pool_tex_alloc(pt, w, h, u, v)) != NULL) 472 if ((*apt = _pool_tex_alloc(pt, w, h, u, v)) != NULL)
471 { 473 {
472 gc->shared->tex.atlas[th2] = 474 gc->shared->tex.atlas[th2] =
473 eina_list_remove_list(gc->shared->tex.atlas[th2], l); 475 eina_list_promote_list(gc->shared->tex.atlas[th2], l);
474 gc->shared->tex.atlas[th2] =
475 eina_list_prepend(gc->shared->tex.atlas[th2], pt);
476 return pt; 476 return pt;
477 } 477 }
478 } 478 }
@@ -483,7 +483,6 @@ _pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
483 pool_h = gc->shared->info.tune.atlas.max_h; 483 pool_h = gc->shared->info.tune.atlas.max_h;
484 } 484 }
485 pt = _pool_tex_new(gc, atlas_w, pool_h, intformat, format); 485 pt = _pool_tex_new(gc, atlas_w, pool_h, intformat, format);
486
487 if (!pt) return NULL; 486 if (!pt) return NULL;
488 gc->shared->tex.atlas[th2] = 487 gc->shared->tex.atlas[th2] =
489 eina_list_prepend(gc->shared->tex.atlas[th2], pt); 488 eina_list_prepend(gc->shared->tex.atlas[th2], pt);