ecore/wayland: Add ecore_wl_window_alpha_set().

Just sets the "alpha" flag on the window and use it when calculating
opaque regions.
This commit is contained in:
Rafael Antognolli 2013-05-06 16:40:50 -03:00
parent 67179b4a71
commit 7a7a0b8297
3 changed files with 38 additions and 1 deletions

View File

@ -649,6 +649,9 @@ EAPI Eina_Bool ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd);
*/
EAPI struct wl_surface *ecore_wl_window_surface_create(Ecore_Wl_Window *win);
EAPI void ecore_wl_window_alpha_set(Ecore_Wl_Window *win, Eina_Bool alpha);
EAPI Eina_Bool ecore_wl_window_alpha_get(Ecore_Wl_Window *win);
#ifdef __cplusplus
}
#endif

View File

@ -454,6 +454,34 @@ ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent)
}
}
EAPI Eina_Bool
ecore_wl_window_alpha_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return EINA_FALSE;
return win->alpha;
}
EAPI void
ecore_wl_window_alpha_set(Ecore_Wl_Window *win, Eina_Bool alpha)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
win->alpha = alpha;
if (win->region.opaque) wl_region_destroy(win->region.opaque);
win->region.opaque = NULL;
if ((!win->transparent) && (!win->alpha))
{
win->region.opaque =
wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
wl_region_add(win->region.opaque, win->allocation.x, win->allocation.y,
win->allocation.w, win->allocation.h);
}
}
EAPI Eina_Bool
ecore_wl_window_transparent_get(Ecore_Wl_Window *win)
{

View File

@ -424,16 +424,22 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
static void
static void
_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
{
Evas_Engine_Info_Wayland_Egl *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
if ((ee->alpha == alpha)) return;
ee->alpha = alpha;
wdata = ee->engine.data;
if (wdata->win)
ecore_wl_window_alpha_set(wdata->win, alpha);
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
{
int fw, fh;