diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-03-04 17:11:26 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-03-04 17:31:31 +0900 |
commit | f020171bf2fca0c2f30199904798b79dba929c65 (patch) | |
tree | 32af72903be3866c38de77a2d0e88e84706f6746 | |
parent | 53d3cb4fec32d7876aba1c878501fe7ca9e06c46 (diff) | |
download | efl-f020171bf2fca0c2f30199904798b79dba929c65.tar.gz |
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.
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_common.h | 5 | ||||
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_preload.c | 12 | ||||
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_texture.c | 5 |
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); EAPI void evas_gl_common_image_free(Evas_GL_Image *im); EAPI void evas_gl_common_image_native_enable(Evas_GL_Image *im); -EAPI int evas_gl_preload_init(void); -EAPI int evas_gl_preload_shutdown(void); +EAPI int evas_gl_preload_init(void); +EAPI int evas_gl_preload_shutdown(void); +EAPI Eina_Bool evas_gl_preload_enabled(void); EAPI Evas_Engine_GL_Context *evas_gl_common_context_new(void); 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) EAPI int evas_gl_preload_init(void) { - if (getenv("EVAS_GL_NOPRELOAD")) return 0; + const char *s = getenv("EVAS_GL_PRELOAD"); + if (!s || (atoi(s) != 1)) return 0; if (async_loader_init++) return async_loader_init; eina_lock_new(&async_loader_lock); @@ -368,7 +369,8 @@ evas_gl_preload_init(void) EAPI int evas_gl_preload_shutdown(void) { - if (getenv("EVAS_GL_NOPRELOAD")) return 0; + const char *s = getenv("EVAS_GL_PRELOAD"); + if (!s || (atoi(s) != 1)) return 0; if (--async_loader_init) return async_loader_init; async_loader_exit = EINA_TRUE; @@ -381,3 +383,9 @@ evas_gl_preload_shutdown(void) return async_loader_init; } + +EAPI Eina_Bool +evas_gl_preload_enabled(void) +{ + return (async_loader_init >= 1); +} 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) } // if preloaded, then async push it in after uploading a miniature of it - if (im->cache_entry.flags.preload_done && tex->w > 2 * EVAS_GL_TILE_SIZE && tex->h > 2 * EVAS_GL_TILE_SIZE) + if (im->cache_entry.flags.preload_done + && (tex->w > (2 * EVAS_GL_TILE_SIZE)) + && (tex->h > (2 * EVAS_GL_TILE_SIZE)) + && evas_gl_preload_enabled()) { Evas_GL_Texture_Async_Preload *async; unsigned char *in; |