ec->comp_data->pending.new_attach = EINA_TRUE;
}
-EINTERN void
-e_comp_wl_client_opaque_region_set(E_Client *ec, pixman_region32_t *region)
-{
- if (pixman_region32_not_empty(region))
- {
- if (ec->argb)
- {
- ec->argb = EINA_FALSE;
- ELOGF("COMP", "Set argb:%d", ec, ec->argb);
- EC_CHANGED(ec);
- _e_comp_wl_hook_call(E_COMP_WL_HOOK_CLIENT_ALPHA_CHANGE, ec);
- e_view_client_alpha_set(e_client_view_get(ec), EINA_FALSE);
- }
- }
- else
- {
- if (!ec->argb)
- {
- ec->argb = EINA_TRUE;
- ELOGF("COMP", "Set argb:%d", ec, ec->argb);
- EC_CHANGED(ec);
- _e_comp_wl_hook_call(E_COMP_WL_HOOK_CLIENT_ALPHA_CHANGE, ec);
- e_view_client_alpha_set(e_client_view_get(ec), EINA_TRUE);
- }
- }
-}
-
EINTERN void
e_comp_wl_client_input_region_set(E_Client *ec, pixman_region32_t *region)
{
EINTERN void e_comp_wl_client_surface_init(E_Client *ec);
EINTERN void e_comp_wl_client_surface_finish(E_Client *ec);
EINTERN void e_comp_wl_client_surface_pending_buffer_set(E_Client *ec, E_Comp_Wl_Buffer *buffer, int32_t sx, int32_t sy);
-EINTERN void e_comp_wl_client_opaque_region_set(E_Client *ec, pixman_region32_t *region);
EINTERN void e_comp_wl_client_input_region_set(E_Client *ec, pixman_region32_t *region);
EINTERN Eina_Bool e_comp_wl_client_subsurface_cyclic_reference_check(E_Client *ec, E_Client *parent);
ds_surface->current.dy);
}
-static void
-_e_surface_pending_opaque_region_update(E_Surface *surface)
-{
- struct ds_surface *ds_surface = surface->ds_surface;
- E_Client *ec = surface->ec;
-
- e_comp_wl_client_opaque_region_set(ec, &ds_surface->current.opaque);
-}
-
static void
_e_surface_pending_input_region_update(E_Surface *surface)
{
if (ds_surface->current.committed & DS_SURFACE_STATE_BUFFER)
_e_surface_pending_buffer_update(surface);
- if (ds_surface->current.committed & DS_SURFACE_STATE_OPAQUE_REGION)
- _e_surface_pending_opaque_region_update(surface);
-
if (ds_surface->current.committed & DS_SURFACE_STATE_INPUT_REGION)
_e_surface_pending_input_region_update(surface);
+#include "e_compositor_intern.h"
#include "e_log.h"
#include "e_types.h"
#include "e_comp_intern.h"
e_comp_wl_map_apply(view->ec);
}
+static Eina_Bool
+_surface_view_alpha_set(E_Surface_View *view)
+{
+ E_Client *ec = view->ec;
+
+ if (ec->argb)
+ return EINA_FALSE;
+
+ ESV_INF("Set argb", ec);
+
+ ec->argb = EINA_TRUE;
+ EC_CHANGED(ec);
+
+ e_view_client_alpha_set(e_client_view_get(ec), EINA_TRUE);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_surface_view_alpha_unset(E_Surface_View *view)
+{
+ E_Client *ec = view->ec;
+
+ if (!ec->argb)
+ return EINA_FALSE;
+
+ ESV_INF("Unset argb", ec);
+
+ ec->argb = EINA_FALSE;
+ EC_CHANGED(ec);
+
+ e_view_client_alpha_set(e_client_view_get(ec), EINA_FALSE);
+
+ return EINA_TRUE;
+}
+
+static void
+_surface_view_opaque_region_update(E_Surface_View *view)
+{
+ Eina_Bool is_opaque = pixman_region32_not_empty(e_surface_opaque_region_get(view->surface));
+ Eina_Bool changed = EINA_FALSE;
+
+ if (is_opaque)
+ changed = _surface_view_alpha_unset(view);
+ else
+ changed = _surface_view_alpha_set(view);
+
+ if (changed)
+ e_comp_wl_hook_call(E_COMP_WL_HOOK_CLIENT_ALPHA_CHANGE, view->ec);
+}
+
static void
_surface_view_cb_surface_commit(struct wl_listener *listener, void *data)
{
if (event->committed & E_SURFACE_STATE_BUFFER)
e_client_fps_update(view->ec);
+ if (event->committed & E_SURFACE_STATE_OPAQUE_REGION)
+ _surface_view_opaque_region_update(view);
+
if (e_comp_wl_remote_surface_commit(view->ec))
return;