summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:54:59 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:54:59 -0700
commite7527e06d6e28c251f48cb774796c807ea6c8ea6 (patch)
tree3d6dd87428d829ee4411c3e8af624f3d6a7c31c7
parent7453980ccf2acf755c37846285af01e1301b1f44 (diff)
evas: decorrelate canvas size from output size.
-rw-r--r--src/lib/evas/canvas/evas_main.c15
-rw-r--r--src/lib/evas/canvas/evas_out.c14
-rw-r--r--src/lib/evas/canvas/evas_render.c47
-rw-r--r--src/lib/evas/include/evas_private.h4
4 files changed, 54 insertions, 26 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 9a8e1992d2..cb01effbd8 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -461,7 +461,7 @@ next_zombie:
461EAPI Evas_Engine_Info * 461EAPI Evas_Engine_Info *
462evas_engine_info_get(const Evas *obj) 462evas_engine_info_get(const Evas *obj)
463{ 463{
464 const Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS); 464 Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
465 Efl_Canvas_Output *output; 465 Efl_Canvas_Output *output;
466 466
467 output = eina_list_data_get(e->outputs); 467 output = eina_list_data_get(e->outputs);
@@ -470,6 +470,7 @@ evas_engine_info_get(const Evas *obj)
470 output = efl_canvas_output_add((Evas*) obj); 470 output = efl_canvas_output_add((Evas*) obj);
471 } 471 }
472 if (!output) return NULL; 472 if (!output) return NULL;
473 e->output.legacy = EINA_TRUE;
473 474
474 return efl_canvas_output_engine_info_get(output); 475 return efl_canvas_output_engine_info_get(output);
475} 476}
@@ -483,6 +484,8 @@ evas_engine_info_set(Evas *obj, Evas_Engine_Info *info)
483 output = eina_list_data_get(e->outputs); 484 output = eina_list_data_get(e->outputs);
484 if (!output) return EINA_FALSE; 485 if (!output) return EINA_FALSE;
485 if (!info) return EINA_FALSE; 486 if (!info) return EINA_FALSE;
487 efl_canvas_output_view_set(output, 0, 0,
488 e->output.w, e->output.h);
486 return efl_canvas_output_engine_info_set(output, info); 489 return efl_canvas_output_engine_info_set(output, info);
487} 490}
488 491
@@ -1106,9 +1109,17 @@ evas_output_size_set(Evas *eo_e, int w, int h)
1106 evas_canvas_async_block(e); 1109 evas_canvas_async_block(e);
1107 e->output.w = w; 1110 e->output.w = w;
1108 e->output.h = h; 1111 e->output.h = h;
1109 e->output.changed = 1;
1110 e->output_validity++; 1112 e->output_validity++;
1111 e->changed = 1; 1113 e->changed = 1;
1114
1115 if (e->output.legacy)
1116 {
1117 Efl_Canvas_Output *output;
1118
1119 output = eina_list_data_get(e->outputs);
1120 efl_canvas_output_view_set(output, 0, 0, w, h);
1121 }
1122
1112 evas_render_invalidate(eo_e); 1123 evas_render_invalidate(eo_e);
1113} 1124}
1114 1125
diff --git a/src/lib/evas/canvas/evas_out.c b/src/lib/evas/canvas/evas_out.c
index 42f8ed4401..c5687de4b2 100644
--- a/src/lib/evas/canvas/evas_out.c
+++ b/src/lib/evas/canvas/evas_out.c
@@ -50,6 +50,7 @@ efl_canvas_output_add(Evas *canvas)
50 if (!r) return NULL; 50 if (!r) return NULL;
51 51
52 efl_wref_add(canvas, &r->canvas); 52 efl_wref_add(canvas, &r->canvas);
53 r->changed = EINA_TRUE;
53 54
54 e = _efl_canvas_output_async_block(r); 55 e = _efl_canvas_output_async_block(r);
55 // Track this output in Evas 56 // Track this output in Evas
@@ -97,11 +98,18 @@ efl_canvas_output_view_set(Efl_Canvas_Output *output,
97 e = _efl_canvas_output_async_block(output); 98 e = _efl_canvas_output_async_block(output);
98 if (!e) return ; 99 if (!e) return ;
99 100
101 if (output->geometry.x != x) goto changed;
102 if (output->geometry.y != y) goto changed;
103 if (output->geometry.w != w) goto changed;
104 if (output->geometry.h != h) goto changed;
105 return;
106
107 changed:
100 output->geometry.x = x; 108 output->geometry.x = x;
101 output->geometry.y = y; 109 output->geometry.y = y;
102 output->geometry.w = w; 110 output->geometry.w = w;
103 output->geometry.h = h; 111 output->geometry.h = h;
104 // XXX: tell engine about any output size etc. changes 112 output->changed = EINA_TRUE;
105 // XXX: tell evas to add damage if viewport loc/size changed 113 // XXX: tell evas to add damage if viewport loc/size changed
106} 114}
107 115
@@ -131,7 +139,7 @@ efl_canvas_output_engine_info_set(Efl_Canvas_Output *output,
131 if (e->engine.func->output_update) 139 if (e->engine.func->output_update)
132 { 140 {
133 e->engine.func->output_update(_evas_engine_context(e), output->output, info, 141 e->engine.func->output_update(_evas_engine_context(e), output->output, info,
134 e->output.w, e->output.h); 142 output->geometry.w, output->geometry.h);
135 } 143 }
136 else 144 else
137 { 145 {
@@ -152,7 +160,7 @@ efl_canvas_output_engine_info_set(Efl_Canvas_Output *output,
152 160
153 setup: 161 setup:
154 output->output = e->engine.func->output_setup(_evas_engine_context(e), info, 162 output->output = e->engine.func->output_setup(_evas_engine_context(e), info,
155 e->output.w, e->output.h); 163 output->geometry.w, output->geometry.h);
156 } 164 }
157 165
158 return !!output->output; 166 return !!output->output;
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 2527243ef2..a2d30daeb1 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -3133,6 +3133,7 @@ evas_render_updates_internal(Evas *eo_e,
3133 Evas_Object *eo_obj; 3133 Evas_Object *eo_obj;
3134 Evas_Object_Protected_Data *obj; 3134 Evas_Object_Protected_Data *obj;
3135 Evas_Public_Data *evas, *e; 3135 Evas_Public_Data *evas, *e;
3136 Efl_Canvas_Output *out;
3136 Eina_List *ll; 3137 Eina_List *ll;
3137 Eina_Bool clean_them = EINA_FALSE; 3138 Eina_Bool clean_them = EINA_FALSE;
3138 Eina_Bool rendering = EINA_FALSE; 3139 Eina_Bool rendering = EINA_FALSE;
@@ -3250,11 +3251,6 @@ evas_render_updates_internal(Evas *eo_e,
3250 { 3251 {
3251 ENFN->output_redraws_rect_add(ENC, 0, 0, e->output.w, e->output.h); 3252 ENFN->output_redraws_rect_add(ENC, 0, 0, e->output.w, e->output.h);
3252 } 3253 }
3253 if (e->output.changed)
3254 {
3255 ENFN->output_resize(ENC, ENDT, e->output.w, e->output.h);
3256 ENFN->output_redraws_rect_add(ENC, 0, 0, e->output.w, e->output.h);
3257 }
3258 if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h)) 3254 if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
3259 { 3255 {
3260 ERR("viewport size != output size!"); 3256 ERR("viewport size != output size!");
@@ -3323,13 +3319,25 @@ evas_render_updates_internal(Evas *eo_e,
3323 } 3319 }
3324 eina_evlog("-render_phase5", eo_e, 0.0, NULL); 3320 eina_evlog("-render_phase5", eo_e, 0.0, NULL);
3325 3321
3322 /* phase 6. Initialize output */
3323 out = eina_list_data_get(e->outputs);
3324 if (out->changed)
3325 {
3326 ENFN->output_resize(ENC, out->output,
3327 out->geometry.w, out->geometry.h);
3328 ENFN->output_redraws_rect_add(ENC,
3329 out->geometry.x, out->geometry.y,
3330 out->geometry.w, out->geometry.h);
3331 out->changed = EINA_FALSE;
3332 }
3333
3326 /* Define the output for Evas_GL operation */ 3334 /* Define the output for Evas_GL operation */
3327 if (ENFN->gl_output_set) 3335 if (ENFN->gl_output_set)
3328 ENFN->gl_output_set(ENC, ENDT); 3336 ENFN->gl_output_set(ENC, out->output);
3329 3337
3330 /* phase 6. check if video surface should be inlined or stay in their hardware plane */ 3338 /* phase 7. check if video surface should be inlined or stay in their hardware plane */
3331 eina_evlog("+render_phase6", eo_e, 0.0, NULL); 3339 eina_evlog("+render_phase7", eo_e, 0.0, NULL);
3332 alpha = ENFN->canvas_alpha_get(ENDT); 3340 alpha = ENFN->canvas_alpha_get(out->output);
3333 3341
3334 EINA_LIST_FOREACH(e->video_objects, ll, eo_obj) 3342 EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
3335 { 3343 {
@@ -3380,10 +3388,10 @@ evas_render_updates_internal(Evas *eo_e,
3380 _evas_object_image_plane_release(eo_obj2, obj2, output); 3388 _evas_object_image_plane_release(eo_obj2, obj2, output);
3381 } 3389 }
3382 } 3390 }
3383 eina_evlog("-render_phase6", eo_e, 0.0, NULL); 3391 eina_evlog("-render_phase7", eo_e, 0.0, NULL);
3384 3392
3385 /* phase 7. go thru each update rect and render objects in it*/ 3393 /* phase 8. go thru each update rect and render objects in it*/
3386 eina_evlog("+render_phase7", eo_e, 0.0, NULL); 3394 eina_evlog("+render_phase8", eo_e, 0.0, NULL);
3387 if (do_draw) 3395 if (do_draw)
3388 { 3396 {
3389 Render_Updates *ru; 3397 Render_Updates *ru;
@@ -3401,7 +3409,7 @@ evas_render_updates_internal(Evas *eo_e,
3401 // FIXME: handle multiple output 3409 // FIXME: handle multiple output
3402 while ((surface = 3410 while ((surface =
3403 ENFN->output_redraws_next_update_get 3411 ENFN->output_redraws_next_update_get
3404 (ENC, ENDT, 3412 (ENC, out->output,
3405 &ux, &uy, &uw, &uh, 3413 &ux, &uy, &uw, &uh,
3406 &cx, &cy, &cw, &ch))) 3414 &cx, &cy, &cw, &ch)))
3407 { 3415 {
@@ -3453,7 +3461,7 @@ evas_render_updates_internal(Evas *eo_e,
3453 3461
3454 RD(0, " SNAPSHOT %s [sfc:%p ur:%d,%d %dx%d]\n", RDNAME(snap), pseudo_canvas, ur.x, ur.y, ur.w, ur.h); 3462 RD(0, " SNAPSHOT %s [sfc:%p ur:%d,%d %dx%d]\n", RDNAME(snap), pseudo_canvas, ur.x, ur.y, ur.w, ur.h);
3455 ctx = ENFN->context_new(ENC); 3463 ctx = ENFN->context_new(ENC);
3456 clean_them |= evas_render_updates_internal_loop(eo_e, e, ENDT, pseudo_canvas, ctx, 3464 clean_them |= evas_render_updates_internal_loop(eo_e, e, out->output, pseudo_canvas, ctx,
3457 snap, 3465 snap,
3458 ur.x, ur.y, ur.w, ur.h, 3466 ur.x, ur.y, ur.w, ur.h,
3459 cr.x, cr.y, cr.w, cr.h, 3467 cr.x, cr.y, cr.w, cr.h,
@@ -3481,7 +3489,7 @@ evas_render_updates_internal(Evas *eo_e,
3481 } 3489 }
3482 3490
3483 ctx = ENFN->context_new(ENC); 3491 ctx = ENFN->context_new(ENC);
3484 clean_them |= evas_render_updates_internal_loop(eo_e, e, ENDT, surface, 3492 clean_them |= evas_render_updates_internal_loop(eo_e, e, out->output, surface,
3485 ctx, NULL, 3493 ctx, NULL,
3486 ux, uy, uw, uh, 3494 ux, uy, uw, uh,
3487 cx, cy, cw, ch, 3495 cx, cy, cw, ch,
@@ -3495,7 +3503,7 @@ evas_render_updates_internal(Evas *eo_e,
3495 if (!do_async) 3503 if (!do_async)
3496 { 3504 {
3497 eina_evlog("+render_push", eo_e, 0.0, NULL); 3505 eina_evlog("+render_push", eo_e, 0.0, NULL);
3498 ENFN->output_redraws_next_update_push(ENC, ENDT, surface, ux, uy, uw, uh, render_mode); 3506 ENFN->output_redraws_next_update_push(ENC, out->output, surface, ux, uy, uw, uh, render_mode);
3499 eina_evlog("-render_push", eo_e, 0.0, NULL); 3507 eina_evlog("-render_push", eo_e, 0.0, NULL);
3500 } 3508 }
3501 } 3509 }
@@ -3520,7 +3528,7 @@ evas_render_updates_internal(Evas *eo_e,
3520 _evas_object_image_video_overlay_do(eo_obj); 3528 _evas_object_image_video_overlay_do(eo_obj);
3521 } 3529 }
3522 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL); 3530 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
3523 ENFN->output_flush(ENC, ENDT, EVAS_RENDER_MODE_SYNC); 3531 ENFN->output_flush(ENC, out->output, EVAS_RENDER_MODE_SYNC);
3524 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL); 3532 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
3525 eina_evlog("-render_output_flush", eo_e, 0.0, NULL); 3533 eina_evlog("-render_output_flush", eo_e, 0.0, NULL);
3526 } 3534 }
@@ -3528,13 +3536,13 @@ evas_render_updates_internal(Evas *eo_e,
3528 rendering = haveup; 3536 rendering = haveup;
3529 eina_evlog("-render_surface", eo_e, 0.0, NULL); 3537 eina_evlog("-render_surface", eo_e, 0.0, NULL);
3530 } 3538 }
3531 eina_evlog("-render_phase7", eo_e, 0.0, NULL); 3539 eina_evlog("-render_phase8", eo_e, 0.0, NULL);
3532 3540
3533 eina_evlog("+render_clear", eo_e, 0.0, NULL); 3541 eina_evlog("+render_clear", eo_e, 0.0, NULL);
3534 if (!do_async && rendering) 3542 if (!do_async && rendering)
3535 { 3543 {
3536 /* clear redraws */ 3544 /* clear redraws */
3537 ENFN->output_redraws_clear(ENC, ENDT); 3545 ENFN->output_redraws_clear(ENC, out->output);
3538 } 3546 }
3539 eina_evlog("-render_clear", eo_e, 0.0, NULL); 3547 eina_evlog("-render_clear", eo_e, 0.0, NULL);
3540 3548
@@ -3614,7 +3622,6 @@ evas_render_updates_internal(Evas *eo_e,
3614 eina_evlog("+render_end", eo_e, 0.0, NULL); 3622 eina_evlog("+render_end", eo_e, 0.0, NULL);
3615 e->changed = EINA_FALSE; 3623 e->changed = EINA_FALSE;
3616 e->viewport.changed = EINA_FALSE; 3624 e->viewport.changed = EINA_FALSE;
3617 e->output.changed = EINA_FALSE;
3618 e->framespace.changed = EINA_FALSE; 3625 e->framespace.changed = EINA_FALSE;
3619 e->invalidate = EINA_FALSE; 3626 e->invalidate = EINA_FALSE;
3620 3627
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 146238b5f8..0a28680d05 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -871,7 +871,7 @@ struct _Evas_Public_Data
871 struct { 871 struct {
872 int w, h; 872 int w, h;
873 DATA32 render_method; 873 DATA32 render_method;
874 unsigned char changed : 1; 874 Eina_Bool legacy : 1;
875 } output; 875 } output;
876 876
877 struct 877 struct
@@ -1341,6 +1341,8 @@ struct _Efl_Canvas_Output
1341 Eina_Rectangle geometry; 1341 Eina_Rectangle geometry;
1342 1342
1343 int info_magic; 1343 int info_magic;
1344
1345 Eina_Bool changed : 1;
1344}; 1346};
1345 1347
1346struct _Evas_Object_Func 1348struct _Evas_Object_Func