summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-09-11 13:00:23 +0100
committerChris Michael <cp.michael@samsung.com>2013-09-11 14:10:27 +0100
commitd673cbc3982399a11be74a42f909e68b0f380dea (patch)
tree2b2d2dd134e6b5b59dadbb177a734178205f68ad
parentcd77853222d1c11d71da4ca9066abe35390dcd5e (diff)
Readd the master clip for rendering of wayland engines.
NB: Master clip is needed so that things don't draw outside the client area. NB: This is a partial fix. Still a work in progress. Some remaining issues with some various elm_tests that use evas_map. Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/evas/canvas/evas_render.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 3f8d942aa7..bdf147af1f 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1538,6 +1538,7 @@ evas_render_updates_internal(Evas *eo_e,
1538#ifdef EVAS_RENDER_DEBUG_TIMING 1538#ifdef EVAS_RENDER_DEBUG_TIMING
1539 double start_time = _time_get(); 1539 double start_time = _time_get();
1540#endif 1540#endif
1541 Eina_Rectangle clip_rect;
1541 1542
1542 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); 1543 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
1543 return EINA_FALSE; 1544 return EINA_FALSE;
@@ -1582,6 +1583,51 @@ evas_render_updates_internal(Evas *eo_e,
1582 &e->render_objects, 1583 &e->render_objects,
1583 &redraw_all); 1584 &redraw_all);
1584 1585
1586 if (!strncmp(e->engine.module->definition->name, "wayland", 7))
1587 {
1588 /* check for master clip */
1589 if (!e->framespace.clip)
1590 {
1591 e->framespace.clip = evas_object_rectangle_add(eo_e);
1592 evas_object_color_set(e->framespace.clip, 255, 255, 255, 255);
1593 evas_object_move(e->framespace.clip, 0, 0);
1594 evas_object_resize(e->framespace.clip,
1595 e->viewport.w - e->framespace.w,
1596 e->viewport.h - e->framespace.h);
1597 evas_object_show(e->framespace.clip);
1598 }
1599
1600 /* setup master clip rectangle for comparison to objects */
1601 EINA_RECTANGLE_SET(&clip_rect, e->framespace.x, e->framespace.y,
1602 e->viewport.w - e->framespace.w,
1603 e->viewport.h - e->framespace.h);
1604
1605 for (i = 0; i < e->render_objects.count; ++i)
1606 {
1607 Eina_Rectangle obj_rect;
1608
1609 obj = eina_array_data_get(&e->render_objects, i);
1610 if (obj->delete_me) continue;
1611 if (obj->is_frame) continue;
1612 if (obj->object == e->framespace.clip) continue;
1613
1614 /* setup object rectangle for comparison to clip rectangle */
1615 EINA_RECTANGLE_SET(&obj_rect,
1616 obj->cur->geometry.x, obj->cur->geometry.y,
1617 obj->cur->geometry.w, obj->cur->geometry.h);
1618
1619 /* check if this object intersects with the master clip */
1620 if (!eina_rectangles_intersect(&clip_rect, &obj_rect))
1621 continue;
1622
1623 if (!evas_object_clip_get(obj->object))
1624 {
1625 /* clip this object to the master clip */
1626 evas_object_clip_set(obj->object, e->framespace.clip);
1627 }
1628 }
1629 }
1630
1585 /* phase 1.5. check if the video should be inlined or stay in their overlay */ 1631 /* phase 1.5. check if the video should be inlined or stay in their overlay */
1586 alpha = e->engine.func->canvas_alpha_get(e->engine.data.output, 1632 alpha = e->engine.func->canvas_alpha_get(e->engine.data.output,
1587 e->engine.data.context); 1633 e->engine.data.context);
@@ -1914,6 +1960,27 @@ evas_render_updates_internal(Evas *eo_e,
1914 } 1960 }
1915 } 1961 }
1916 1962
1963 if (!strncmp(e->engine.module->definition->name, "wayland", 7))
1964 {
1965 /* unclip objects from master clip */
1966 for (i = 0; i < e->render_objects.count; ++i)
1967 {
1968 obj = eina_array_data_get(&e->render_objects, i);
1969 if (obj->is_frame) continue;
1970 if (obj->object == e->framespace.clip) continue;
1971
1972 if (evas_object_clip_get(obj->object) == e->framespace.clip)
1973 {
1974 /* unclip this object from the master clip */
1975 evas_object_clip_unset(obj->object);
1976 }
1977 }
1978
1979 /* delete master clip */
1980 evas_object_del(e->framespace.clip);
1981 e->framespace.clip = NULL;
1982 }
1983
1917 e->changed = EINA_FALSE; 1984 e->changed = EINA_FALSE;
1918 e->viewport.changed = EINA_FALSE; 1985 e->viewport.changed = EINA_FALSE;
1919 e->output.changed = EINA_FALSE; 1986 e->output.changed = EINA_FALSE;