summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOleksandr Shcherbina <o.shcherbina@samsung.com>2015-04-22 15:15:08 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-07 09:53:09 +0200
commit0f6d101ad5ec8327088e448c347e1f4054a5c8d7 (patch)
tree8901b52a716b30e4107ed2e6ea7c2e5fe2676062 /src
parent83bb3b5b5180bbe96d6ea8da1f3b82071b6a01c9 (diff)
evas: add to Evas_GL_Image flag disable generate atlas.
Summary: It is need in case Evas_3D_Mesh created with not normileze texture coordinate and flag repeat mode for Evas_3D_Texture Additional info see here https://phab.enlightenment.org/conpherence/54/ Use Evas_GL_Image for generation texture unit for Evas_3D_Texture see here https://phab.enlightenment.org/D2371 Reviewers: jpeg, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2375 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h4
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c8
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c17
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c2
4 files changed, 19 insertions, 12 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index d4ca68d0b9..4460835255 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -654,6 +654,8 @@ struct _Evas_GL_Image
654 unsigned char tex_only : 1; 654 unsigned char tex_only : 1;
655 unsigned char locked : 1; // gl_surface_lock/unlock 655 unsigned char locked : 1; // gl_surface_lock/unlock
656 unsigned char direct : 1; // evas gl direct renderable 656 unsigned char direct : 1; // evas gl direct renderable
657 /*Disable generate atlas for texture unit, EINA_FALSE by default*/
658 Eina_Bool disable_atlas : 1;
657}; 659};
658 660
659struct _Evas_GL_Font_Texture 661struct _Evas_GL_Font_Texture
@@ -811,7 +813,7 @@ int evas_gl_common_file_cache_save(Evas_GL_Shared *shared);
811void evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h); 813void evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h);
812 814
813void evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt); 815void evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt);
814Evas_GL_Texture *evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im); 816Evas_GL_Texture *evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im, Eina_Bool disable_atlas);
815Evas_GL_Texture *evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im); 817Evas_GL_Texture *evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im);
816Evas_GL_Texture *evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha); 818Evas_GL_Texture *evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
817Evas_GL_Texture *evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im); 819Evas_GL_Texture *evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 09d999bf5e..3a4ad546bc 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -516,7 +516,7 @@ evas_gl_common_image_alpha_set(Evas_GL_Image *im, int alpha)
516 } 516 }
517 else 517 else
518 { 518 {
519 im->tex = evas_gl_common_texture_new(im->gc, im->im); 519 im->tex = evas_gl_common_texture_new(im->gc, im->im, EINA_FALSE);
520 if (im->tex) evas_gl_common_texture_update(im->tex, im->im); 520 if (im->tex) evas_gl_common_texture_update(im->tex, im->im);
521 } 521 }
522 return im; 522 return im;
@@ -679,7 +679,7 @@ evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
679 evas_cache_image_colorspace(&im->im->cache_entry, im->cs.space); 679 evas_cache_image_colorspace(&im->im->cache_entry, im->cs.space);
680 im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry, im->w, im->h); 680 im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry, im->w, im->h);
681 if (!im->tex) 681 if (!im->tex)
682 im->tex = evas_gl_common_texture_new(im->gc, im->im); 682 im->tex = evas_gl_common_texture_new(im->gc, im->im, EINA_FALSE);
683 } 683 }
684} 684}
685 685
@@ -841,14 +841,14 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
841 if (evas_cache2_image_cached(ie)) 841 if (evas_cache2_image_cached(ie))
842 { 842 {
843 evas_cache2_image_load_data(ie); 843 evas_cache2_image_load_data(ie);
844 im->tex = evas_gl_common_texture_new(gc, im->im); 844 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas);
845 evas_cache2_image_unload_data(ie); 845 evas_cache2_image_unload_data(ie);
846 } 846 }
847 else 847 else
848#endif 848#endif
849 { 849 {
850 evas_cache_image_load_data(ie); 850 evas_cache_image_load_data(ie);
851 im->tex = evas_gl_common_texture_new(gc, im->im); 851 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas);
852 evas_cache_image_unload_data(ie); 852 evas_cache_image_unload_data(ie);
853 } 853 }
854 } 854 }
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 f65784d9b3..5c1c07f247 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -439,13 +439,18 @@ _pool_tex_alloc(Evas_GL_Texture_Pool *pt, int w, int h, int *u, int *v)
439static Evas_GL_Texture_Pool * 439static Evas_GL_Texture_Pool *
440_pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h, 440_pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
441 GLenum intformat, GLenum format, int *u, int *v, 441 GLenum intformat, GLenum format, int *u, int *v,
442 Eina_Rectangle **apt, int atlas_w) 442 Eina_Rectangle **apt, int atlas_w, Eina_Bool disable_atlas)
443{ 443{
444 Evas_GL_Texture_Pool *pt = NULL; 444 Evas_GL_Texture_Pool *pt = NULL;
445 Eina_List *l; 445 Eina_List *l;
446 int th2; 446 int th2;
447 int pool_h; 447 int pool_h;
448 448 /*Return texture unit without atlas*/
449 if (disable_atlas)
450 {
451 pt = _pool_tex_new(gc, w, h, intformat, format);
452 return pt ? pt : NULL;
453 }
449 if (atlas_w > gc->shared->info.max_texture_size) 454 if (atlas_w > gc->shared->info.max_texture_size)
450 atlas_w = gc->shared->info.max_texture_size; 455 atlas_w = gc->shared->info.max_texture_size;
451 if ((w > gc->shared->info.tune.atlas.max_w) || 456 if ((w > gc->shared->info.tune.atlas.max_w) ||
@@ -490,7 +495,7 @@ _pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
490} 495}
491 496
492Evas_GL_Texture * 497Evas_GL_Texture *
493evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im) 498evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im, Eina_Bool disable_atlas)
494{ 499{
495 Evas_GL_Texture *tex; 500 Evas_GL_Texture *tex;
496 GLsizei w, h; 501 GLsizei w, h;
@@ -535,7 +540,7 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
535 *matching_format[lformat].intformat, 540 *matching_format[lformat].intformat,
536 *matching_format[lformat].format, 541 *matching_format[lformat].format,
537 &u, &v, &tex->apt, 542 &u, &v, &tex->apt,
538 gc->shared->info.tune.atlas.max_alloc_size); 543 gc->shared->info.tune.atlas.max_alloc_size, disable_atlas);
539 if (!tex->pt) 544 if (!tex->pt)
540 { 545 {
541 evas_gl_common_texture_light_free(tex); 546 evas_gl_common_texture_light_free(tex);
@@ -1350,7 +1355,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1350 *matching_format[lformat].intformat, 1355 *matching_format[lformat].intformat,
1351 *matching_format[lformat].format, 1356 *matching_format[lformat].format,
1352 &u, &v, &tex->aptt, 1357 &u, &v, &tex->aptt,
1353 tex->gc->shared->info.tune.atlas.max_alloc_size); 1358 tex->gc->shared->info.tune.atlas.max_alloc_size, EINA_FALSE);
1354 if (!tex->ptt) 1359 if (!tex->ptt)
1355 goto upload; 1360 goto upload;
1356 1361
@@ -1470,7 +1475,7 @@ evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels,
1470 1475
1471 tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v, 1476 tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v,
1472 &tex->apt, 1477 &tex->apt,
1473 gc->shared->info.tune.atlas.max_alloc_alpha_size); 1478 gc->shared->info.tune.atlas.max_alloc_alpha_size, EINA_FALSE);
1474 if (!tex->pt) 1479 if (!tex->pt)
1475 { 1480 {
1476 evas_gl_common_texture_light_free(tex); 1481 evas_gl_common_texture_light_free(tex);
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 0167703a83..2597753e7a 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -966,7 +966,7 @@ eng_image_data_preload_request(void *data, void *image, const Eo *target)
966 966
967 re->window_use(re->software.ob); 967 re->window_use(re->software.ob);
968 gl_context = re->window_gl_context_get(re->software.ob); 968 gl_context = re->window_gl_context_get(re->software.ob);
969 gim->tex = evas_gl_common_texture_new(gl_context, gim->im); 969 gim->tex = evas_gl_common_texture_new(gl_context, gim->im, EINA_FALSE);
970 } 970 }
971 evas_gl_preload_target_register(gim->tex, (Eo*) target); 971 evas_gl_preload_target_register(gim->tex, (Eo*) target);
972} 972}