summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-11-04 16:10:47 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-11-18 11:43:31 -0500
commitf856b20db5a678544cd578fb4d80afc2d878faf2 (patch)
treeabf8bd2d5ef3758f7f4bbc26fb5d63fe95b847eb
parentd95e3a77e8c1967b22ca8924093e5d7636cf0377 (diff)
Fix wayland opaque regions
Similar set of changes to the recent input region changes. They may not have been quite so broken to begin with, but it's probably less confusing to treat both types of region the same way.
-rw-r--r--src/bin/e_comp_wl.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 4a26ac9df..53f6df327 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -1244,8 +1244,7 @@ _e_comp_wl_surface_state_init(E_Comp_Wl_Surface_State *state, int w, int h)
1244 1244
1245 state->input = NULL; 1245 state->input = NULL;
1246 1246
1247 state->opaque = eina_tiler_new(w, h); 1247 state->opaque = NULL;
1248 eina_tiler_tile_size_set(state->opaque, 1, 1);
1249} 1248}
1250 1249
1251static void 1250static void
@@ -1490,24 +1489,34 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
1490 } 1489 }
1491 1490
1492 /* put state opaque into surface */ 1491 /* put state opaque into surface */
1493 e_pixmap_image_opaque_set(ec->pixmap, 0, 0, 0, 0);
1494 if (state->opaque) 1492 if (state->opaque)
1495 { 1493 {
1496 Eina_Rectangle *rect; 1494 if (!eina_tiler_empty(state->opaque))
1497 Eina_Iterator *itr;
1498
1499 itr = eina_tiler_iterator_new(state->opaque);
1500 EINA_ITERATOR_FOREACH(itr, rect)
1501 { 1495 {
1502 Eina_Rectangle r; 1496 Eina_Rectangle *rect;
1497 Eina_Iterator *itr;
1503 1498
1504 EINA_RECTANGLE_SET(&r, rect->x, rect->y, rect->w, rect->h); 1499 /* This is seriously wrong and results in only the first
1505 E_RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, 0, 0, state->bw, state->bh); 1500 * rectangle in the region being set, but in the usual
1506 e_pixmap_image_opaque_set(ec->pixmap, r.x, r.y, r.w, r.h); 1501 * case there's only one rectangle.
1507 break; 1502 */
1508 } 1503 itr = eina_tiler_iterator_new(state->opaque);
1504 EINA_ITERATOR_FOREACH(itr, rect)
1505 {
1506 Eina_Rectangle r;
1507
1508 EINA_RECTANGLE_SET(&r, rect->x, rect->y, rect->w, rect->h);
1509 E_RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, 0, 0, state->bw, state->bh);
1510 e_pixmap_image_opaque_set(ec->pixmap, r.x, r.y, r.w, r.h);
1511 break;
1512 }
1509 1513
1510 eina_iterator_free(itr); 1514 eina_iterator_free(itr);
1515 eina_tiler_free(state->opaque);
1516 state->opaque = NULL;
1517 }
1518 else
1519 e_pixmap_image_opaque_set(ec->pixmap, 0, 0, 0, 0);
1511 } 1520 }
1512 1521
1513 /* put state input into surface */ 1522 /* put state input into surface */
@@ -1651,7 +1660,9 @@ _e_comp_wl_surface_cb_opaque_region_set(struct wl_client *client EINA_UNUSED, st
1651 if (e_object_is_del(E_OBJECT(ec))) return; 1660 if (e_object_is_del(E_OBJECT(ec))) return;
1652 1661
1653 if (ec->comp_data->pending.opaque) 1662 if (ec->comp_data->pending.opaque)
1654 eina_tiler_clear(ec->comp_data->pending.opaque); 1663 eina_tiler_free(ec->comp_data->pending.opaque);
1664 ec->comp_data->pending.opaque = eina_tiler_new(65535, 65535);
1665 eina_tiler_tile_size_set(ec->comp_data->pending.opaque, 1, 1);
1655 if (region_resource) 1666 if (region_resource)
1656 { 1667 {
1657 Eina_Tiler *tmp; 1668 Eina_Tiler *tmp;
@@ -2011,8 +2022,6 @@ _e_comp_wl_subsurface_commit_to_cache(E_Client *ec)
2011{ 2022{
2012 E_Comp_Client_Data *cdata; 2023 E_Comp_Client_Data *cdata;
2013 E_Comp_Wl_Subsurf_Data *sdata; 2024 E_Comp_Wl_Subsurf_Data *sdata;
2014 Eina_Iterator *itr;
2015 Eina_Rectangle *rect;
2016 2025
2017 if (!(cdata = ec->comp_data)) return; 2026 if (!(cdata = ec->comp_data)) return;
2018 if (!(sdata = cdata->sub.data)) return; 2027 if (!(sdata = cdata->sub.data)) return;
@@ -2044,11 +2053,8 @@ _e_comp_wl_subsurface_commit_to_cache(E_Client *ec)
2044 /* cdata->pending.sy = 0; */ 2053 /* cdata->pending.sy = 0; */
2045 /* cdata->pending.new_attach = EINA_FALSE; */ 2054 /* cdata->pending.new_attach = EINA_FALSE; */
2046 2055
2047 /* copy cdata->pending.opaque into sdata->cached.opaque */ 2056 sdata->cached.opaque = cdata->pending.opaque;
2048 itr = eina_tiler_iterator_new(cdata->pending.opaque); 2057 cdata->pending.opaque = NULL;
2049 EINA_ITERATOR_FOREACH(itr, rect)
2050 eina_tiler_rect_add(sdata->cached.opaque, rect);
2051 eina_iterator_free(itr);
2052 2058
2053 sdata->cached.input = cdata->pending.input; 2059 sdata->cached.input = cdata->pending.input;
2054 cdata->pending.input = NULL; 2060 cdata->pending.input = NULL;