summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:52:52 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:52:52 -0700
commit7f8bbe497275ae229562fbf50ac682c1a983b476 (patch)
tree36821f1549398c551e599cfe70b6856e4d9cd0c6
parent440238a899166007c859610a0a2825718429797a (diff)
evas: reorder rendering phase to group output related operation.
-rw-r--r--src/lib/evas/canvas/evas_render.c118
1 files changed, 60 insertions, 58 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 17e4a1b368..653158874b 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -3224,59 +3224,6 @@ evas_render_updates_internal(Evas *eo_e,
3224 eina_evlog("-render_phase1", eo_e, 0.0, NULL); 3224 eina_evlog("-render_phase1", eo_e, 0.0, NULL);
3225 } 3225 }
3226 3226
3227 /* phase 1.5. check if the video should be inlined or stay in their overlay */
3228 alpha = ENFN->canvas_alpha_get(ENDT);
3229
3230 EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
3231 {
3232 Efl_Canvas_Output *output;
3233 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
3234
3235 output = _evas_overlay_output_find(e, obj);
3236
3237 /* we need the surface to be transparent to display the underlying overlay */
3238 if (output && alpha && _evas_render_can_use_overlay(e, eo_obj, output))
3239 _evas_object_image_video_overlay_show(eo_obj);
3240 else
3241 _evas_object_image_video_overlay_hide(eo_obj);
3242 }
3243
3244 /* check if individual image objects can be dropped into hardware planes */
3245 if (ENFN->image_plane_assign)
3246 EINA_INARRAY_FOREACH(&evas->active_objects, ao)
3247 {
3248 Evas_Object_Protected_Data *obj2;
3249 Evas_Object *eo_obj2;
3250 Efl_Canvas_Output *output;
3251 Eina_List *lo;
3252
3253 obj2 = ao->obj;
3254 eo_obj2 = obj2->object;
3255
3256 if (!efl_isa(eo_obj2, EFL_CANVAS_IMAGE_INTERNAL_CLASS)) continue;
3257
3258 if (evas_object_image_video_surface_get(eo_obj2)) continue;
3259
3260 /* Find the output the object was in */
3261 EINA_LIST_FOREACH(e->outputs, lo, output)
3262 {
3263 if (!eina_list_data_find(output->planes, obj2)) continue ;
3264 _evas_object_image_plane_release(eo_obj2, obj2, output);
3265 break;
3266 }
3267
3268 /* A video object can only be in one output at a time, check that first */
3269 output = _evas_overlay_output_find(e, obj2);
3270 if (!output) continue ;
3271
3272 if (!_evas_render_can_use_overlay(e, eo_obj2, output))
3273 {
3274 /* This may free up things temporarily allocated by
3275 * _can_use_overlay() testing in the engine */
3276 _evas_object_image_plane_release(eo_obj2, obj2, output);
3277 }
3278 }
3279
3280 eina_evlog("+render_phase1_direct", eo_e, 0.0, NULL); 3227 eina_evlog("+render_phase1_direct", eo_e, 0.0, NULL);
3281 /* phase 1.8. pre render for proxy */ 3228 /* phase 1.8. pre render for proxy */
3282 _evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects, 3229 _evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects,
@@ -3384,11 +3331,66 @@ evas_render_updates_internal(Evas *eo_e,
3384 } 3331 }
3385 eina_evlog("-render_phase5", eo_e, 0.0, NULL); 3332 eina_evlog("-render_phase5", eo_e, 0.0, NULL);
3386 3333
3334 /* phase 6. check if video surface should be inlined or stay in their hardware plane */
3335 eina_evlog("+render_phase6", eo_e, 0.0, NULL);
3336 alpha = ENFN->canvas_alpha_get(ENDT);
3337
3338 EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
3339 {
3340 Efl_Canvas_Output *output;
3341 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
3342
3343 output = _evas_overlay_output_find(e, obj);
3344
3345 /* we need the surface to be transparent to display the underlying overlay */
3346 if (output && alpha && _evas_render_can_use_overlay(e, eo_obj, output))
3347 _evas_object_image_video_overlay_show(eo_obj);
3348 else
3349 _evas_object_image_video_overlay_hide(eo_obj);
3350 }
3351
3352 /* check if individual image objects can be dropped into hardware planes */
3353 if (ENFN->image_plane_assign)
3354 EINA_INARRAY_FOREACH(&evas->active_objects, ao)
3355 {
3356 Evas_Object_Protected_Data *obj2;
3357 Evas_Object *eo_obj2;
3358 Efl_Canvas_Output *output;
3359 Eina_List *lo;
3360
3361 obj2 = ao->obj;
3362 eo_obj2 = obj2->object;
3363
3364 if (!efl_isa(eo_obj2, EFL_CANVAS_IMAGE_INTERNAL_CLASS)) continue;
3365
3366 if (evas_object_image_video_surface_get(eo_obj2)) continue;
3367
3368 /* Find the output the object was in */
3369 EINA_LIST_FOREACH(e->outputs, lo, output)
3370 {
3371 if (!eina_list_data_find(output->planes, obj2)) continue ;
3372 _evas_object_image_plane_release(eo_obj2, obj2, output);
3373 break;
3374 }
3375
3376 /* A video object can only be in one output at a time, check that first */
3377 output = _evas_overlay_output_find(e, obj2);
3378 if (!output) continue ;
3379
3380 if (!_evas_render_can_use_overlay(e, eo_obj2, output))
3381 {
3382 /* This may free up things temporarily allocated by
3383 * _can_use_overlay() testing in the engine */
3384 _evas_object_image_plane_release(eo_obj2, obj2, output);
3385 }
3386 }
3387 eina_evlog("-render_phase6", eo_e, 0.0, NULL);
3388
3387 /* save this list */ 3389 /* save this list */
3388 /* obscuring_objects_orig = obscuring_objects; */ 3390 /* obscuring_objects_orig = obscuring_objects; */
3389 /* obscuring_objects = NULL; */ 3391 /* obscuring_objects = NULL; */
3390 /* phase 6. go thru each update rect and render objects in it*/ 3392 /* phase 7. go thru each update rect and render objects in it*/
3391 eina_evlog("+render_phase6", eo_e, 0.0, NULL); 3393 eina_evlog("+render_phase7", eo_e, 0.0, NULL);
3392 if (do_draw) 3394 if (do_draw)
3393 { 3395 {
3394 Render_Updates *ru; 3396 Render_Updates *ru;
@@ -3414,7 +3416,7 @@ evas_render_updates_internal(Evas *eo_e,
3414 3416
3415 haveup = EINA_TRUE; 3417 haveup = EINA_TRUE;
3416 3418
3417 /* phase 6.1 render every snapshot that needs to be updated 3419 /* phase 7.1 render every snapshot that needs to be updated
3418 for this part of the screen */ 3420 for this part of the screen */
3419 eina_evlog("+render_snapshots", eo_e, 0.0, NULL); 3421 eina_evlog("+render_snapshots", eo_e, 0.0, NULL);
3420 for (j = e->snapshot_objects.count - 1; j >= 0; j--) 3422 for (j = e->snapshot_objects.count - 1; j >= 0; j--)
@@ -3473,7 +3475,7 @@ evas_render_updates_internal(Evas *eo_e,
3473 eina_evlog("-render_snapshots", eo_e, 0.0, NULL); 3475 eina_evlog("-render_snapshots", eo_e, 0.0, NULL);
3474 3476
3475 eina_evlog("+render_update", eo_e, 0.0, NULL); 3477 eina_evlog("+render_update", eo_e, 0.0, NULL);
3476 /* phase 6.2 render all the object on the target surface */ 3478 /* phase 7.2 render all the object on the target surface */
3477 if ((do_async) || (make_updates)) 3479 if ((do_async) || (make_updates))
3478 { 3480 {
3479 ru = malloc(sizeof(*ru)); 3481 ru = malloc(sizeof(*ru));
@@ -3533,7 +3535,7 @@ evas_render_updates_internal(Evas *eo_e,
3533 rendering = haveup; 3535 rendering = haveup;
3534 eina_evlog("-render_surface", eo_e, 0.0, NULL); 3536 eina_evlog("-render_surface", eo_e, 0.0, NULL);
3535 } 3537 }
3536 eina_evlog("-render_phase6", eo_e, 0.0, NULL); 3538 eina_evlog("-render_phase7", eo_e, 0.0, NULL);
3537 3539
3538 eina_evlog("+render_clear", eo_e, 0.0, NULL); 3540 eina_evlog("+render_clear", eo_e, 0.0, NULL);
3539 if (!do_async && rendering) 3541 if (!do_async && rendering)