summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2018-10-22 10:30:23 -0500
committerDerek Foreman <derek.foreman.samsung@gmail.com>2018-12-14 09:52:04 -0600
commit9362bc9bb2822b4e953990664a11ed6f26737f94 (patch)
treee43f1b0db10b7cf7fd34ca38ab1bbeb31f824606
parentac065749a667b96140efcba62d334993fd12c44e (diff)
downloadefl-9362bc9bb2822b4e953990664a11ed6f26737f94.tar.gz
evas_render: Refactor plane code
It's just tidier this way. Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com> Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7193
-rw-r--r--src/lib/evas/canvas/evas_render.c86
1 files changed, 47 insertions, 39 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index a97d2b0be2..72da7fb519 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -3136,6 +3136,52 @@ _evas_overlay_output_find(Efl_Canvas_Output *output,
return EVAS_3STATE_INSIDE;
}
+static void
+_evas_planes(Evas_Public_Data *evas)
+{
+ Evas_Active_Entry *ao;
+
+ /* check if individual image objects can be dropped into hardware planes */
+ if (ENFN->image_plane_assign)
+ EINA_INARRAY_FOREACH(&evas->active_objects, ao)
+ {
+ Evas_Object_Protected_Data *obj2;
+ Evas_Object *eo_obj2;
+ Efl_Canvas_Output *output;
+ Evas_3State state;
+ Eina_List *lo;
+
+ obj2 = ao->obj;
+ eo_obj2 = obj2->object;
+
+ if (!efl_isa(eo_obj2, EFL_CANVAS_IMAGE_INTERNAL_CLASS)) continue;
+
+ /* Find the output the object was in */
+ EINA_LIST_FOREACH(evas->outputs, lo, output)
+ {
+ if (!output->output) continue ;
+ if (!eina_list_data_find(output->planes, obj2)) continue;
+ _evas_object_image_plane_release(eo_obj2, obj2, output);
+ break;
+ }
+
+ if (evas_object_is_visible(eo_obj2, obj2))
+ EINA_LIST_FOREACH(evas->outputs, lo, output)
+ {
+ /* A video object can only be in one output at a time, check that first */
+ state = _evas_overlay_output_find(output, obj2);
+ if (state == EVAS_3STATE_OUTSIDE) continue;
+
+ if (!_evas_render_can_use_overlay(evas, eo_obj2, output))
+ {
+ /* This may free up things temporarily allocated by
+ * _can_use_overlay() testing in the engine */
+ _evas_object_image_plane_release(eo_obj2, obj2, output);
+ } else break;
+ }
+ }
+}
+
static Eina_Bool
evas_render_updates_internal(Evas *eo_e,
unsigned char make_updates,
@@ -3155,7 +3201,6 @@ evas_render_updates_internal(Evas *eo_e,
unsigned int i;
Phase1_Context p1ctx;
int redraw_all = 0;
- Evas_Active_Entry *ao;
Evas_Render_Mode render_mode = !do_async ?
EVAS_RENDER_MODE_SYNC :
EVAS_RENDER_MODE_ASYNC_INIT;
@@ -3368,44 +3413,7 @@ evas_render_updates_internal(Evas *eo_e,
else
_evas_object_image_video_overlay_hide(eo_obj);
}
-
- /* check if individual image objects can be dropped into hardware planes */
- if (ENFN->image_plane_assign)
- EINA_INARRAY_FOREACH(&evas->active_objects, ao)
- {
- Evas_Object_Protected_Data *obj2;
- Evas_Object *eo_obj2;
- Efl_Canvas_Output *output;
- Evas_3State state;
- Eina_List *lo;
-
- obj2 = ao->obj;
- eo_obj2 = obj2->object;
-
- if (!efl_isa(eo_obj2, EFL_CANVAS_IMAGE_INTERNAL_CLASS)) continue;
-
- if (evas_object_image_video_surface_get(eo_obj2)) continue;
-
- /* Find the output the object was in */
- EINA_LIST_FOREACH(e->outputs, lo, output)
- {
- if (!output->output) continue ;
- if (!eina_list_data_find(output->planes, obj2)) continue ;
- _evas_object_image_plane_release(eo_obj2, obj2, output);
- break;
- }
-
- /* A video object can only be in one output at a time, check that first */
- state = _evas_overlay_output_find(out, obj2);
- if (state == EVAS_3STATE_OUTSIDE) continue ;
-
- if (!_evas_render_can_use_overlay(e, eo_obj2, out))
- {
- /* This may free up things temporarily allocated by
- * _can_use_overlay() testing in the engine */
- _evas_object_image_plane_release(eo_obj2, obj2, out);
- }
- }
+ _evas_planes(e);
eina_evlog("-render_phase7", eo_e, 0.0, NULL);
/* phase 8. go thru each update rect and render objects in it*/