diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/evas/canvas/evas_render.c | 133 | ||||
-rw-r--r-- | src/lib/evas/include/evas_private.h | 1 |
2 files changed, 74 insertions, 60 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 5aa5d38aca..a67c1299aa 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c | |||
@@ -13,8 +13,8 @@ | |||
13 | #include "evas_render2.h" | 13 | #include "evas_render2.h" |
14 | 14 | ||
15 | /* Enable this for extra verbose rendering debug logs */ | 15 | /* Enable this for extra verbose rendering debug logs */ |
16 | //#define REND_DBG 1 | 16 | #define REND_DBG 1 |
17 | #define STDOUT_DBG | 17 | //#define STDOUT_DBG |
18 | 18 | ||
19 | #ifdef REND_DBG | 19 | #ifdef REND_DBG |
20 | static FILE *dbf = NULL; | 20 | static FILE *dbf = NULL; |
@@ -184,6 +184,25 @@ _accumulate_time(double before, Eina_Bool async) | |||
184 | 184 | ||
185 | static int _render_busy = 0; | 185 | static int _render_busy = 0; |
186 | 186 | ||
187 | static inline Eina_Bool | ||
188 | _is_obj_in_framespace(Evas_Object_Protected_Data *obj, int x, int y, int w, int h) | ||
189 | { | ||
190 | Eina_Rectangle crect, orect; | ||
191 | |||
192 | if (obj->is_frame) return EINA_TRUE; | ||
193 | |||
194 | EINA_RECTANGLE_SET(&crect, x, y, w, h); | ||
195 | EINA_RECTANGLE_SET(&orect, obj->cur->geometry.x, obj->cur->geometry.y, | ||
196 | obj->cur->geometry.w, obj->cur->geometry.h); | ||
197 | |||
198 | return eina_rectangles_intersect(&crect, &orect); | ||
199 | /* if (RECTS_INTERSECT(x, y, w, h, obj->cur->geometry.x, obj->cur->geometry.y, */ | ||
200 | /* obj->cur->geometry.w, obj->cur->geometry.h)) */ | ||
201 | /* return EINA_TRUE; */ | ||
202 | |||
203 | /* return EINA_FALSE; */ | ||
204 | } | ||
205 | |||
187 | static void | 206 | static void |
188 | _evas_render_cleanup(void) | 207 | _evas_render_cleanup(void) |
189 | { | 208 | { |
@@ -1213,6 +1232,12 @@ _proxy_context_clip(Evas_Public_Data *evas, void *ctx, Evas_Proxy_Render_Data *p | |||
1213 | const Evas_Coord_Rectangle *clip; | 1232 | const Evas_Coord_Rectangle *clip; |
1214 | Evas_Object_Protected_Data *clipper; | 1233 | Evas_Object_Protected_Data *clipper; |
1215 | int cw, ch; | 1234 | int cw, ch; |
1235 | int fx, fy, fw, fh; | ||
1236 | |||
1237 | fx = evas->framespace.x; | ||
1238 | fy = evas->framespace.y; | ||
1239 | fw = evas->viewport.w - evas->framespace.w; | ||
1240 | fh = evas->viewport.h - evas->framespace.h; | ||
1216 | 1241 | ||
1217 | /* cache.clip can not be relied on, since the evas is frozen, but we need | 1242 | /* cache.clip can not be relied on, since the evas is frozen, but we need |
1218 | * to set the clip. so we recurse from clipper to clipper until we reach | 1243 | * to set the clip. so we recurse from clipper to clipper until we reach |
@@ -1226,6 +1251,9 @@ _proxy_context_clip(Evas_Public_Data *evas, void *ctx, Evas_Proxy_Render_Data *p | |||
1226 | obj->cur->cache.clip.x + off_x, | 1251 | obj->cur->cache.clip.x + off_x, |
1227 | obj->cur->cache.clip.y + off_y, | 1252 | obj->cur->cache.clip.y + off_y, |
1228 | obj->cur->cache.clip.w, obj->cur->cache.clip.h); | 1253 | obj->cur->cache.clip.w, obj->cur->cache.clip.h); |
1254 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1255 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1256 | |||
1229 | ENFN->context_clip_get(ENDT, ctx, NULL, NULL, &cw, &ch); | 1257 | ENFN->context_clip_get(ENDT, ctx, NULL, NULL, &cw, &ch); |
1230 | return ((cw > 0) && (ch > 0)); | 1258 | return ((cw > 0) && (ch > 0)); |
1231 | } | 1259 | } |
@@ -1236,6 +1264,8 @@ _proxy_context_clip(Evas_Public_Data *evas, void *ctx, Evas_Proxy_Render_Data *p | |||
1236 | if (!clipper->cur->visible) return EINA_FALSE; | 1264 | if (!clipper->cur->visible) return EINA_FALSE; |
1237 | clip = &clipper->cur->geometry; | 1265 | clip = &clipper->cur->geometry; |
1238 | ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h); | 1266 | ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h); |
1267 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1268 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1239 | ENFN->context_clip_get(ENDT, ctx, NULL, NULL, &cw, &ch); | 1269 | ENFN->context_clip_get(ENDT, ctx, NULL, NULL, &cw, &ch); |
1240 | if ((cw <= 0) || (ch <= 0)) return EINA_FALSE; | 1270 | if ((cw <= 0) || (ch <= 0)) return EINA_FALSE; |
1241 | 1271 | ||
@@ -1254,6 +1284,12 @@ _evas_render_mapped_context_clip_set(Evas_Public_Data *evas, Evas_Object *eo_obj | |||
1254 | { | 1284 | { |
1255 | int x, y, w, h; | 1285 | int x, y, w, h; |
1256 | Eina_Bool proxy_src_clip = EINA_TRUE; | 1286 | Eina_Bool proxy_src_clip = EINA_TRUE; |
1287 | int fx, fy, fw, fh; | ||
1288 | |||
1289 | fx = evas->framespace.x; | ||
1290 | fy = evas->framespace.y; | ||
1291 | fw = evas->viewport.w - evas->framespace.w; | ||
1292 | fh = evas->viewport.h - evas->framespace.h; | ||
1257 | 1293 | ||
1258 | if (proxy_render_data) proxy_src_clip = proxy_render_data->source_clip; | 1294 | if (proxy_render_data) proxy_src_clip = proxy_render_data->source_clip; |
1259 | 1295 | ||
@@ -1271,6 +1307,8 @@ _evas_render_mapped_context_clip_set(Evas_Public_Data *evas, Evas_Object *eo_obj | |||
1271 | obj->cur->clipper->cur->cache.clip.h); | 1307 | obj->cur->clipper->cur->cache.clip.h); |
1272 | 1308 | ||
1273 | ENFN->context_clip_set(ENDT, ctx, x + off_x, y + off_y, w, h); | 1309 | ENFN->context_clip_set(ENDT, ctx, x + off_x, y + off_y, w, h); |
1310 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1311 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1274 | } | 1312 | } |
1275 | else if (evas->is_frozen) | 1313 | else if (evas->is_frozen) |
1276 | { | 1314 | { |
@@ -1286,6 +1324,8 @@ _evas_render_mapped_context_clip_set(Evas_Public_Data *evas, Evas_Object *eo_obj | |||
1286 | w = obj->cur->clipper->cur->geometry.w; | 1324 | w = obj->cur->clipper->cur->geometry.w; |
1287 | h = obj->cur->clipper->cur->geometry.h; | 1325 | h = obj->cur->clipper->cur->geometry.h; |
1288 | ENFN->context_clip_clip(ENDT, ctx, x, y, w, h); | 1326 | ENFN->context_clip_clip(ENDT, ctx, x, y, w, h); |
1327 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1328 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1289 | } | 1329 | } |
1290 | } | 1330 | } |
1291 | } | 1331 | } |
@@ -1302,6 +1342,12 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, | |||
1302 | Eina_Bool clean_them = EINA_FALSE; | 1342 | Eina_Bool clean_them = EINA_FALSE; |
1303 | Eina_Bool proxy_src_clip = EINA_TRUE; | 1343 | Eina_Bool proxy_src_clip = EINA_TRUE; |
1304 | void *ctx; | 1344 | void *ctx; |
1345 | int fx, fy, fw, fh; | ||
1346 | |||
1347 | fx = evas->framespace.x; | ||
1348 | fy = evas->framespace.y; | ||
1349 | fw = evas->viewport.w - evas->framespace.w; | ||
1350 | fh = evas->viewport.h - evas->framespace.h; | ||
1305 | 1351 | ||
1306 | if (!proxy_render_data) | 1352 | if (!proxy_render_data) |
1307 | { | 1353 | { |
@@ -1345,6 +1391,8 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, | |||
1345 | int _c, _cx, _cy, _cw, _ch; | 1391 | int _c, _cx, _cy, _cw, _ch; |
1346 | _c = ENFN->context_clip_get(ENDT, context, &_cx, &_cy, &_cw, &_ch); | 1392 | _c = ENFN->context_clip_get(ENDT, context, &_cx, &_cy, &_cw, &_ch); |
1347 | RD(level, " context clip: [%d] %d,%d %dx%d\n", _c, _cx, _cy, _cw, _ch); | 1393 | RD(level, " context clip: [%d] %d,%d %dx%d\n", _c, _cx, _cy, _cw, _ch); |
1394 | RD(level, "\n"); | ||
1395 | RD(level, "Framespace: %d %d %d %d\n", fx, fy, fw, fh); | ||
1348 | } | 1396 | } |
1349 | #endif | 1397 | #endif |
1350 | 1398 | ||
@@ -1547,6 +1595,9 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, | |||
1547 | obj->cur->geometry.h); | 1595 | obj->cur->geometry.h); |
1548 | 1596 | ||
1549 | ENFN->context_clip_set(ENDT, ctx, x, y, w, h); | 1597 | ENFN->context_clip_set(ENDT, ctx, x, y, w, h); |
1598 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1599 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1600 | |||
1550 | #ifdef REND_DBG | 1601 | #ifdef REND_DBG |
1551 | int _c, _cx, _cy, _cw, _ch; | 1602 | int _c, _cx, _cy, _cw, _ch; |
1552 | _c = ENFN->context_clip_get(ENDT, ctx, &_cx, &_cy, &_cw, &_ch); | 1603 | _c = ENFN->context_clip_get(ENDT, ctx, &_cx, &_cy, &_cw, &_ch); |
@@ -1620,6 +1671,8 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, | |||
1620 | } | 1671 | } |
1621 | } | 1672 | } |
1622 | ENFN->context_clip_clip(ENDT, ctx, ecx, ecy, ecw, ech); | 1673 | ENFN->context_clip_clip(ENDT, ctx, ecx, ecy, ecw, ech); |
1674 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1675 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1623 | if (obj->cur->cache.clip.visible || !proxy_src_clip) | 1676 | if (obj->cur->cache.clip.visible || !proxy_src_clip) |
1624 | { | 1677 | { |
1625 | ENFN->context_multiplier_unset(ENDT, ctx); | 1678 | ENFN->context_multiplier_unset(ENDT, ctx); |
@@ -1718,6 +1771,8 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, | |||
1718 | { | 1771 | { |
1719 | const Evas_Coord_Rectangle *clip = &obj->cur->geometry; | 1772 | const Evas_Coord_Rectangle *clip = &obj->cur->geometry; |
1720 | ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h); | 1773 | ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h); |
1774 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1775 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1721 | 1776 | ||
1722 | if (obj->cur->clipper && (mapped > 1)) | 1777 | if (obj->cur->clipper && (mapped > 1)) |
1723 | { | 1778 | { |
@@ -1793,8 +1848,14 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, | |||
1793 | clipper->cur->cache.clip.w, | 1848 | clipper->cur->cache.clip.w, |
1794 | clipper->cur->cache.clip.h); | 1849 | clipper->cur->cache.clip.h); |
1795 | ENFN->context_clip_set(ENDT, ctx, x + off_x, y + off_y, w, h); | 1850 | ENFN->context_clip_set(ENDT, ctx, x + off_x, y + off_y, w, h); |
1851 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1852 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1796 | if (proxy_src_clip) | 1853 | if (proxy_src_clip) |
1797 | ENFN->context_clip_clip(ENDT, ctx, ecx, ecy, ecw, ech); | 1854 | { |
1855 | ENFN->context_clip_clip(ENDT, ctx, ecx, ecy, ecw, ech); | ||
1856 | if (!_is_obj_in_framespace(obj, fx, fy, fw, fh)) | ||
1857 | ENFN->context_clip_clip(ENDT, ctx, fx, fy, fw, fh); | ||
1858 | } | ||
1798 | } | 1859 | } |
1799 | else | 1860 | else |
1800 | { | 1861 | { |
@@ -2267,10 +2328,16 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e, | |||
2267 | int off_x, off_y; | 2328 | int off_x, off_y; |
2268 | unsigned int i, j; | 2329 | unsigned int i, j; |
2269 | Eina_Bool clean_them = EINA_FALSE; | 2330 | Eina_Bool clean_them = EINA_FALSE; |
2331 | int fxx, fyy, fw, fh; | ||
2270 | 2332 | ||
2271 | eina_evlog("+render_setup", eo_e, 0.0, NULL); | 2333 | eina_evlog("+render_setup", eo_e, 0.0, NULL); |
2272 | RD(level, " [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh); | 2334 | RD(level, " [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh); |
2273 | 2335 | ||
2336 | fxx = e->framespace.x; | ||
2337 | fyy = e->framespace.y; | ||
2338 | fw = e->viewport.w - e->framespace.w; | ||
2339 | fh = e->viewport.h - e->framespace.h; | ||
2340 | |||
2274 | off_x = cx - ux; | 2341 | off_x = cx - ux; |
2275 | off_y = cy - uy; | 2342 | off_y = cy - uy; |
2276 | /* build obscuring objects list (in order from bottom to top) */ | 2343 | /* build obscuring objects list (in order from bottom to top) */ |
@@ -2359,6 +2426,10 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e, | |||
2359 | context, | 2426 | context, |
2360 | x, y, w, h); | 2427 | x, y, w, h); |
2361 | 2428 | ||
2429 | if (!_is_obj_in_framespace(obj, fxx, fyy, fw, fh)) | ||
2430 | e->engine.func->context_clip_clip(e->engine.data.output, | ||
2431 | context, fxx, fyy, fw, fh); | ||
2432 | |||
2362 | /* Clipper masks */ | 2433 | /* Clipper masks */ |
2363 | if (_evas_render_object_is_mask(obj->cur->clipper)) | 2434 | if (_evas_render_object_is_mask(obj->cur->clipper)) |
2364 | mask = obj->cur->clipper; // main object clipped by this mask | 2435 | mask = obj->cur->clipper; // main object clipped by this mask |
@@ -2458,7 +2529,6 @@ evas_render_updates_internal(Evas *eo_e, | |||
2458 | Evas_Render_Mode render_mode = !do_async ? | 2529 | Evas_Render_Mode render_mode = !do_async ? |
2459 | EVAS_RENDER_MODE_SYNC : | 2530 | EVAS_RENDER_MODE_SYNC : |
2460 | EVAS_RENDER_MODE_ASYNC_INIT; | 2531 | EVAS_RENDER_MODE_ASYNC_INIT; |
2461 | Eina_Rectangle clip_rect; | ||
2462 | 2532 | ||
2463 | MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); | 2533 | MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); |
2464 | return EINA_FALSE; | 2534 | return EINA_FALSE; |
@@ -2520,57 +2590,6 @@ evas_render_updates_internal(Evas *eo_e, | |||
2520 | eina_evlog("-render_phase1", eo_e, 0.0, NULL); | 2590 | eina_evlog("-render_phase1", eo_e, 0.0, NULL); |
2521 | } | 2591 | } |
2522 | 2592 | ||
2523 | if (!strncmp(e->engine.module->definition->name, "wayland", 7)) | ||
2524 | { | ||
2525 | evas_event_freeze(eo_e); | ||
2526 | /* check for master clip */ | ||
2527 | if (!e->framespace.clip) | ||
2528 | { | ||
2529 | e->framespace.clip = evas_object_rectangle_add(eo_e); | ||
2530 | evas_object_color_set(e->framespace.clip, 255, 255, 255, 255); | ||
2531 | evas_object_move(e->framespace.clip, 0, 0); | ||
2532 | evas_object_resize(e->framespace.clip, | ||
2533 | e->viewport.w - e->framespace.w, | ||
2534 | e->viewport.h - e->framespace.h); | ||
2535 | evas_object_pass_events_set(e->framespace.clip, EINA_TRUE); | ||
2536 | evas_object_layer_set(e->framespace.clip, EVAS_LAYER_MIN); | ||
2537 | evas_object_show(e->framespace.clip); | ||
2538 | } | ||
2539 | |||
2540 | /* setup master clip rectangle for comparison to objects */ | ||
2541 | EINA_RECTANGLE_SET(&clip_rect, e->framespace.x, e->framespace.y, | ||
2542 | e->viewport.w - e->framespace.w, | ||
2543 | e->viewport.h - e->framespace.h); | ||
2544 | |||
2545 | for (i = 0; i < e->render_objects.count; ++i) | ||
2546 | { | ||
2547 | Eina_Rectangle obj_rect; | ||
2548 | |||
2549 | obj = eina_array_data_get(&e->render_objects, i); | ||
2550 | if (obj->delete_me) continue; | ||
2551 | if (obj->is_frame) continue; | ||
2552 | if (obj->object == e->framespace.clip) continue; | ||
2553 | |||
2554 | /* setup object rectangle for comparison to clip rectangle */ | ||
2555 | EINA_RECTANGLE_SET(&obj_rect, | ||
2556 | obj->cur->geometry.x, obj->cur->geometry.y, | ||
2557 | obj->cur->geometry.w, obj->cur->geometry.h); | ||
2558 | |||
2559 | /* check if this object intersects with the master clip */ | ||
2560 | if (!eina_rectangles_intersect(&clip_rect, &obj_rect)) | ||
2561 | continue; | ||
2562 | |||
2563 | if ((!evas_object_clip_get(obj->object)) && (!obj->smart.parent)) | ||
2564 | { | ||
2565 | /* clip this object to the master clip */ | ||
2566 | evas_object_clip_set(obj->object, e->framespace.clip); | ||
2567 | } | ||
2568 | } | ||
2569 | if (!evas_object_clipees_has(e->framespace.clip)) | ||
2570 | evas_object_hide(e->framespace.clip); | ||
2571 | evas_event_thaw(eo_e); | ||
2572 | } | ||
2573 | |||
2574 | /* phase 1.5. check if the video should be inlined or stay in their overlay */ | 2593 | /* phase 1.5. check if the video should be inlined or stay in their overlay */ |
2575 | alpha = e->engine.func->canvas_alpha_get(e->engine.data.output, | 2594 | alpha = e->engine.func->canvas_alpha_get(e->engine.data.output, |
2576 | e->engine.data.context); | 2595 | e->engine.data.context); |
@@ -2633,10 +2652,6 @@ evas_render_updates_internal(Evas *eo_e, | |||
2633 | ERR("viewport size != output size!"); | 2652 | ERR("viewport size != output size!"); |
2634 | } | 2653 | } |
2635 | 2654 | ||
2636 | if (e->framespace.clip && (e->framespace.changed || e->viewport.changed)) | ||
2637 | evas_object_resize(e->framespace.clip, | ||
2638 | e->viewport.w - e->framespace.w, | ||
2639 | e->viewport.h - e->framespace.h); | ||
2640 | if (e->framespace.changed) | 2655 | if (e->framespace.changed) |
2641 | { | 2656 | { |
2642 | /* NB: If the framespace changes, we need to add a redraw rectangle | 2657 | /* NB: If the framespace changes, we need to add a redraw rectangle |
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 474a66ebba..c29fb4aac6 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h | |||
@@ -820,7 +820,6 @@ struct _Evas_Public_Data | |||
820 | { | 820 | { |
821 | Evas_Coord x, y, w, h; | 821 | Evas_Coord x, y, w, h; |
822 | Eina_Bool changed : 1; | 822 | Eina_Bool changed : 1; |
823 | Evas_Object *clip; | ||
824 | } framespace; | 823 | } framespace; |
825 | 824 | ||
826 | Eina_List *damages; | 825 | Eina_List *damages; |