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.
This commit is contained in:
Jean-Philippe Andre 2015-03-04 17:11:26 +09:00
parent 53d3cb4fec
commit f020171bf2
3 changed files with 17 additions and 5 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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;