summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_subsurf.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-10-06 10:36:35 -0400
committerChris Michael <cp.michael@samsung.com>2015-12-03 12:02:40 -0500
commit3e1b71b3d82cbabd4148e4b7df2f160a6e69463a (patch)
tree9573ab43c69ed803ca8d1588a02790db2b825167 /src/lib/ecore_wl2/ecore_wl2_subsurf.c
parent475ade8bf8832dafac3b8fa0e63e6c197fe4d08d (diff)
ecore-wl2: Add API function to set opaque region of a subsurface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_subsurf.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_subsurf.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_subsurf.c b/src/lib/ecore_wl2/ecore_wl2_subsurf.c
index 2456fd2aaa..254df53db6 100644
--- a/src/lib/ecore_wl2/ecore_wl2_subsurf.c
+++ b/src/lib/ecore_wl2/ecore_wl2_subsurf.c
@@ -143,3 +143,35 @@ ecore_wl2_subsurface_sync_set(Ecore_Wl2_Subsurface *subsurface, Eina_Bool sync)
143 else 143 else
144 wl_subsurface_set_desync(subsurface->wl.subsurface); 144 wl_subsurface_set_desync(subsurface->wl.subsurface);
145} 145}
146
147EAPI void
148ecore_wl2_subsurface_opaque_region_set(Ecore_Wl2_Subsurface *subsurface, int x, int y, int w, int h)
149{
150 EINA_SAFETY_ON_NULL_RETURN(subsurface);
151 EINA_SAFETY_ON_NULL_RETURN(subsurface->wl.subsurface);
152
153 if ((w > 0) && (h > 0))
154 {
155 Ecore_Wl2_Window *parent;
156
157 parent = subsurface->parent;
158 if (parent)
159 {
160 struct wl_region *region;
161
162 region =
163 wl_compositor_create_region(parent->display->wl.compositor);
164 if (!region)
165 {
166 ERR("Failed to create opaque region: %m");
167 return;
168 }
169
170 wl_region_add(region, x, y, w, h);
171 wl_surface_set_opaque_region(subsurface->wl.surface, region);
172 wl_region_destroy(region);
173 }
174 }
175 else
176 wl_surface_set_opaque_region(subsurface->wl.surface, NULL);
177}