aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_object_image.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-03-03 16:38:52 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-03-03 18:11:32 +0900
commita14492ef73c9267042c5bf505080d0e90af394de (patch)
tree2d7d9e5b1532f3a6a7beeca278a3050763911116 /src/lib/evas/canvas/evas_object_image.c
parentevas-3d: recycling of resources for .ply import/export example (diff)
downloadefl-a14492ef73c9267042c5bf505080d0e90af394de.tar.gz
Evas GL: Automatic fallback to indirect rendering when the scene has
not changed. Automatically fallback to indirect rendering on FBO or X11 Pixmap if the Evas Object Image is not marked as dirty. This should improve the performance and/or power consumption in those rare cases where this area of the canvas needs to be redrawn but the GL content has not changed. @feature
Diffstat (limited to 'src/lib/evas/canvas/evas_object_image.c')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 63f777f04a..e4aa44863d 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -2853,11 +2853,9 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
if (ENFN->image_native_get)
{
Evas_Native_Surface *ns;
+
ns = ENFN->image_native_get(ENDT, o->engine_data);
- if ( (ns) &&
- (ns->type == EVAS_NATIVE_SURFACE_OPENGL) &&
- (ns->data.opengl.texture_id) &&
- (!ns->data.opengl.framebuffer_id) )
+ if (ns)
{
Eina_Bool direct_renderable = EINA_FALSE;
@@ -2880,6 +2878,8 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
{
if (ENFN->gl_get_pixels_set)
ENFN->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj);
+ if (ENFN->gl_image_direct_set)
+ ENFN->gl_image_direct_set(output, o->engine_data, EINA_TRUE);
o->direct_render = EINA_TRUE;
}
else
@@ -2919,9 +2919,28 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
else
{
// Check if the it's not dirty but it has direct rendering
- if (o->direct_render)
+ if (o->direct_render && ENFN->image_native_get)
{
- ENFN->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj);
+ Evas_Native_Surface *ns;
+ ns = ENFN->image_native_get(output, o->engine_data);
+ if (ENFN->gl_direct_override_get)
+ ENFN->gl_direct_override_get(output, &direct_override, &direct_force_off);
+ if (ENFN->gl_surface_direct_renderable_get)
+ ENFN->gl_surface_direct_renderable_get(output, ns, &direct_override);
+
+ if (direct_override && !direct_force_off)
+ {
+ // always use direct rendering
+ ENFN->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj);
+ }
+ else
+ {
+ // Auto-fallback to FBO rendering (for perf & power consumption)
+ o->pixels->func.get_pixels(o->pixels->func.get_pixels_data, obj->object);
+ //if (ENFN->get_pixels_render_post)
+ //ENFN->get_pixels_render_post(output);
+ o->direct_render = EINA_FALSE;
+ }
}
}
@@ -3019,9 +3038,9 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
// Clear out the pixel get stuff..
if (ENFN->gl_get_pixels_set)
- {
- ENFN->gl_get_pixels_set(output, NULL, NULL, NULL);
- }
+ ENFN->gl_get_pixels_set(output, NULL, NULL, NULL);
+ if (ENFN->gl_image_direct_set)
+ ENFN->gl_image_direct_set(output, o->engine_data, EINA_FALSE);
Evas_Object_Protected_Data *source =
(o->cur->source ?