summaryrefslogtreecommitdiff
path: root/src/modules/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-03-04 17:11:26 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-03-04 17:31:31 +0900
commitf020171bf2fca0c2f30199904798b79dba929c65 (patch)
tree32af72903be3866c38de77a2d0e88e84706f6746 /src/modules/evas
parent53d3cb4fec32d7876aba1c878501fe7ca9e06c46 (diff)
Evas GL common: Disable evas gl preload by default
Unfortunately, this "feature" has many problems and does not really fix those it was supposed to address: - Elm Photocam becomes horrible to use (the transition from low-res to high-res tiles triggers this miniature path). - Evas async preload callback is called before the full image is ready (ie. the texture is not uploaded yet), when really the preload callback should be triggered only once the image is 100% ready. (TODO) - Sometimes the miniature image keeps being used even though the main image has been uploaded (eg. with E background). Maybe the object image is not redrawn when it should. - This uses a separate thread for the upload, which is both a good and bad idea because we need to do a make current. Also, this does not upload the full-res image tile by tile, but only in one pass, thus blocking the render loop until finished. This patch changes the env var from "EVAS_GL_NOPRELOAD" to "EVAS_GL_PRELOAD" (and only "1" will enable). Sorry Cedric, we can talk later about how to improve this.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h5
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_preload.c12
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c5
3 files changed, 17 insertions, 5 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 3602319ad7..24e926f337 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -659,8 +659,9 @@ EAPI void evas_gl_common_image_native_disable(Evas_GL_Image *im);
659EAPI void evas_gl_common_image_free(Evas_GL_Image *im); 659EAPI void evas_gl_common_image_free(Evas_GL_Image *im);
660EAPI void evas_gl_common_image_native_enable(Evas_GL_Image *im); 660EAPI void evas_gl_common_image_native_enable(Evas_GL_Image *im);
661 661
662EAPI int evas_gl_preload_init(void); 662EAPI int evas_gl_preload_init(void);
663EAPI int evas_gl_preload_shutdown(void); 663EAPI int evas_gl_preload_shutdown(void);
664EAPI Eina_Bool evas_gl_preload_enabled(void);
664 665
665EAPI Evas_Engine_GL_Context *evas_gl_common_context_new(void); 666EAPI Evas_Engine_GL_Context *evas_gl_common_context_new(void);
666 667
diff --git a/src/modules/evas/engines/gl_common/evas_gl_preload.c b/src/modules/evas/engines/gl_common/evas_gl_preload.c
index 17836c2ec2..5344473c1d 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_preload.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_preload.c
@@ -351,7 +351,8 @@ evas_gl_preload_target_unregister(Evas_GL_Texture *tex, Eo *target)
351EAPI int 351EAPI int
352evas_gl_preload_init(void) 352evas_gl_preload_init(void)
353{ 353{
354 if (getenv("EVAS_GL_NOPRELOAD")) return 0; 354 const char *s = getenv("EVAS_GL_PRELOAD");
355 if (!s || (atoi(s) != 1)) return 0;
355 if (async_loader_init++) return async_loader_init; 356 if (async_loader_init++) return async_loader_init;
356 357
357 eina_lock_new(&async_loader_lock); 358 eina_lock_new(&async_loader_lock);
@@ -368,7 +369,8 @@ evas_gl_preload_init(void)
368EAPI int 369EAPI int
369evas_gl_preload_shutdown(void) 370evas_gl_preload_shutdown(void)
370{ 371{
371 if (getenv("EVAS_GL_NOPRELOAD")) return 0; 372 const char *s = getenv("EVAS_GL_PRELOAD");
373 if (!s || (atoi(s) != 1)) return 0;
372 if (--async_loader_init) return async_loader_init; 374 if (--async_loader_init) return async_loader_init;
373 375
374 async_loader_exit = EINA_TRUE; 376 async_loader_exit = EINA_TRUE;
@@ -381,3 +383,9 @@ evas_gl_preload_shutdown(void)
381 383
382 return async_loader_init; 384 return async_loader_init;
383} 385}
386
387EAPI Eina_Bool
388evas_gl_preload_enabled(void)
389{
390 return (async_loader_init >= 1);
391}
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 6c3b0343a6..4f0c0b3e24 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -1267,7 +1267,10 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1267 } 1267 }
1268 1268
1269 // if preloaded, then async push it in after uploading a miniature of it 1269 // if preloaded, then async push it in after uploading a miniature of it
1270 if (im->cache_entry.flags.preload_done && tex->w > 2 * EVAS_GL_TILE_SIZE && tex->h > 2 * EVAS_GL_TILE_SIZE) 1270 if (im->cache_entry.flags.preload_done
1271 && (tex->w > (2 * EVAS_GL_TILE_SIZE))
1272 && (tex->h > (2 * EVAS_GL_TILE_SIZE))
1273 && evas_gl_preload_enabled())
1271 { 1274 {
1272 Evas_GL_Texture_Async_Preload *async; 1275 Evas_GL_Texture_Async_Preload *async;
1273 unsigned char *in; 1276 unsigned char *in;