Evas filters: Improve detection of the GL engine

According to cedric's horrified comment :)

And add a comment in the code. Yes, this IS a temporary solution,
but the GL engineS being what they are (tons of duplicated code),
I think it's still better for now to just make things work.
This commit is contained in:
Jean-Philippe Andre 2014-03-07 10:32:47 +09:00
parent a97844d415
commit 887585129b
1 changed files with 14 additions and 1 deletions

View File

@ -58,7 +58,20 @@ evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool async)
ctx->evas = evas;
ctx->async = async;
ctx->gl_engine = !!strstr(evas->engine.module->definition->name, "gl");
/* Note:
* For now, we need to detect whether the engine is full SW or GL.
* In case of GL, we will have two buffers in parallel:
* RGBA_Image backing and a GL texture (glimage). We can't just leave it
* to the engine to handle the image data since it will try to discard the
* original buffer as early as possible to save memory, but we still need
* it for filtering.
* In the future, Evas_Engine functions need to be added to abstract this
* better and implement filters direcly with shaders.
*/
ctx->gl_engine = (evas->engine.func->gl_surface_read_pixels != NULL);
if (ctx->gl_engine)
DBG("Detected GL engine. All filters will still run in software (SLOW).");
return ctx;
}