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);
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);
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;
return async_loader_init;
}
+
+EAPI Eina_Bool
+evas_gl_preload_enabled(void)
+{
+ return (async_loader_init >= 1);
+}
}
// 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;