summaryrefslogtreecommitdiff
path: root/src/lib/evas
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 /src/lib/evas
parentac065749a667b96140efcba62d334993fd12c44e (diff)
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
Diffstat (limited to 'src/lib/evas')
-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,
3136 return EVAS_3STATE_INSIDE; 3136 return EVAS_3STATE_INSIDE;
3137} 3137}
3138 3138
3139static void
3140_evas_planes(Evas_Public_Data *evas)
3141{
3142 Evas_Active_Entry *ao;
3143
3144 /* check if individual image objects can be dropped into hardware planes */
3145 if (ENFN->image_plane_assign)
3146 EINA_INARRAY_FOREACH(&evas->active_objects, ao)
3147 {
3148 Evas_Object_Protected_Data *obj2;
3149 Evas_Object *eo_obj2;
3150 Efl_Canvas_Output *output;
3151 Evas_3State state;
3152 Eina_List *lo;
3153
3154 obj2 = ao->obj;
3155 eo_obj2 = obj2->object;
3156
3157 if (!efl_isa(eo_obj2, EFL_CANVAS_IMAGE_INTERNAL_CLASS)) continue;
3158
3159 /* Find the output the object was in */
3160 EINA_LIST_FOREACH(evas->outputs, lo, output)
3161 {
3162 if (!output->output) continue ;
3163 if (!eina_list_data_find(output->planes, obj2)) continue;
3164 _evas_object_image_plane_release(eo_obj2, obj2, output);
3165 break;
3166 }
3167
3168 if (evas_object_is_visible(eo_obj2, obj2))
3169 EINA_LIST_FOREACH(evas->outputs, lo, output)
3170 {
3171 /* A video object can only be in one output at a time, check that first */
3172 state = _evas_overlay_output_find(output, obj2);
3173 if (state == EVAS_3STATE_OUTSIDE) continue;
3174
3175 if (!_evas_render_can_use_overlay(evas, eo_obj2, output))
3176 {
3177 /* This may free up things temporarily allocated by
3178 * _can_use_overlay() testing in the engine */
3179 _evas_object_image_plane_release(eo_obj2, obj2, output);
3180 } else break;
3181 }
3182 }
3183}
3184
3139static Eina_Bool 3185static Eina_Bool
3140evas_render_updates_internal(Evas *eo_e, 3186evas_render_updates_internal(Evas *eo_e,
3141 unsigned char make_updates, 3187 unsigned char make_updates,
@@ -3155,7 +3201,6 @@ evas_render_updates_internal(Evas *eo_e,
3155 unsigned int i; 3201 unsigned int i;
3156 Phase1_Context p1ctx; 3202 Phase1_Context p1ctx;
3157 int redraw_all = 0; 3203 int redraw_all = 0;
3158 Evas_Active_Entry *ao;
3159 Evas_Render_Mode render_mode = !do_async ? 3204 Evas_Render_Mode render_mode = !do_async ?
3160 EVAS_RENDER_MODE_SYNC : 3205 EVAS_RENDER_MODE_SYNC :
3161 EVAS_RENDER_MODE_ASYNC_INIT; 3206 EVAS_RENDER_MODE_ASYNC_INIT;
@@ -3368,44 +3413,7 @@ evas_render_updates_internal(Evas *eo_e,
3368 else 3413 else
3369 _evas_object_image_video_overlay_hide(eo_obj); 3414 _evas_object_image_video_overlay_hide(eo_obj);
3370 } 3415 }
3371 3416 _evas_planes(e);
3372 /* check if individual image objects can be dropped into hardware planes */
3373 if (ENFN->image_plane_assign)
3374 EINA_INARRAY_FOREACH(&evas->active_objects, ao)
3375 {
3376 Evas_Object_Protected_Data *obj2;
3377 Evas_Object *eo_obj2;
3378 Efl_Canvas_Output *output;
3379 Evas_3State state;
3380 Eina_List *lo;
3381
3382 obj2 = ao->obj;
3383 eo_obj2 = obj2->object;
3384
3385 if (!efl_isa(eo_obj2, EFL_CANVAS_IMAGE_INTERNAL_CLASS)) continue;
3386
3387 if (evas_object_image_video_surface_get(eo_obj2)) continue;
3388
3389 /* Find the output the object was in */
3390 EINA_LIST_FOREACH(e->outputs, lo, output)
3391 {
3392 if (!output->output) continue ;
3393 if (!eina_list_data_find(output->planes, obj2)) continue ;
3394 _evas_object_image_plane_release(eo_obj2, obj2, output);
3395 break;
3396 }
3397
3398 /* A video object can only be in one output at a time, check that first */
3399 state = _evas_overlay_output_find(out, obj2);
3400 if (state == EVAS_3STATE_OUTSIDE) continue ;
3401
3402 if (!_evas_render_can_use_overlay(e, eo_obj2, out))
3403 {
3404 /* This may free up things temporarily allocated by
3405 * _can_use_overlay() testing in the engine */
3406 _evas_object_image_plane_release(eo_obj2, obj2, out);
3407 }
3408 }
3409 eina_evlog("-render_phase7", eo_e, 0.0, NULL); 3417 eina_evlog("-render_phase7", eo_e, 0.0, NULL);
3410 3418
3411 /* phase 8. go thru each update rect and render objects in it*/ 3419 /* phase 8. go thru each update rect and render objects in it*/