_e_client_transform_sub_apply(E_Client *ec, E_Client *epc, double zoom)
{
E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
- E_Comp_Wl_Subsurf_Data *sdata = cdata->sub.data;
E_Client *subc;
Eina_List *l;
int px = 0, py = 0;
- int ox, oy, ow, oh;
+ int ox = 0, oy = 0, ow, oh;
int mx, my, mw, mh;
E_Map *map;
- EINA_SAFETY_ON_NULL_RETURN(sdata);
+ EINA_SAFETY_ON_FALSE_RETURN(e_comp_wl_subsurface_check(ec));
- ox = sdata->position.x;
- oy = sdata->position.y;
+ e_comp_wl_subsurface_position_get(ec, &ox, &oy);
ow = cdata->width_from_viewport;
oh = cdata->height_from_viewport;
E_API void
e_comp_wl_map_apply(E_Client *ec)
{
+ E_Client *parent;
E_Comp_Wl_Buffer_Viewport *vp;
E_Comp_Wl_Subsurf_Data *sdata;
E_Comp_Wl_Client_Data *cdata;
int x1, y1, x2, y2, x, y;
- int dx, dy;
+ int dx = 0, dy = 0;
Eina_Bool zoom_animating = EINA_FALSE;
if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) return;
(!cdata->viewport_transform))
return;
- sdata = ec->comp_data->sub.data;
- if (sdata)
+ if (e_comp_wl_subsurface_check(ec))
{
- dx = sdata->position.x;
- dy = sdata->position.y;
-
- if (sdata->parent)
+ e_comp_wl_subsurface_position_get(ec, &dx, &dy);
+ parent = e_comp_wl_subsurface_parent_get(ec);
+ if (parent)
{
- dx += sdata->parent->x;
- dy += sdata->parent->y;
+ dx += parent->x;
+ dy += parent->y;
}
+ sdata = ec->comp_data->sub.data;
if (sdata->remote_surface.offscreen_parent)
{
E_Client *offscreen_parent = sdata->remote_surface.offscreen_parent;
E_Client *ec;
E_Client *subc;
Eina_List *l;
- int x, y;
+ int x, y, sx = 0, sy = 0;
if (!(ec = data)) return;
if (e_object_is_del(E_OBJECT(ec))) return;
EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc)
{
- if (!subc->comp_data || !subc->comp_data->sub.data) continue;
- x = ec->x + subc->comp_data->sub.data->position.x;
- y = ec->y + subc->comp_data->sub.data->position.y;
+ if (!e_comp_wl_subsurface_check(subc)) continue;
+ e_comp_wl_subsurface_position_get(subc, &sx, &sy);
+ x = ec->x + sx;
+ y = ec->y + sy;
evas_object_move(subc->frame, x, y);
if (subc->comp_data->scaler.viewport)
EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
{
- if (!subc->comp_data || !subc->comp_data->sub.data) continue;
- x = ec->x + subc->comp_data->sub.data->position.x;
- y = ec->y + subc->comp_data->sub.data->position.y;
+ if (!e_comp_wl_subsurface_check(subc)) continue;
+ e_comp_wl_subsurface_position_get(subc, &sx, &sy);
+ x = ec->x + sx;
+ y = ec->y + sy;
evas_object_move(subc->frame, x, y);
if (subc->comp_data->scaler.viewport)
static void
_e_comp_wl_surface_output_viewport_get(E_Client *ec, Eina_Rectangle *out)
{
- E_Comp_Wl_Subsurf_Data *sdata = NULL;
+ E_Client *parent;
+ int x = 0, y = 0;
if (!out)
return;
if (!ec->comp_data)
return;
- sdata = ec->comp_data->sub.data;
- if (sdata)
+ if (e_comp_wl_subsurface_check(ec))
{
- if (sdata->parent)
+ e_comp_wl_subsurface_position_get(ec, &x, &y);
+ parent = e_comp_wl_subsurface_parent_get(ec);
+ if (parent)
{
- out->x = sdata->parent->x + sdata->position.x;
- out->y = sdata->parent->y + sdata->position.y;
+ out->x = parent->x + x;
+ out->y = parent->y + y;
}
else
{
- out->x = sdata->position.x;
- out->y = sdata->position.y;
+ out->x = x;
+ out->y = y;
}
}
else
_e_comp_wl_remote_surface_subsurface_commit(E_Comp_Wl_Remote_Provider *parent_provider,
E_Client *ec)
{
- E_Comp_Wl_Subsurf_Data *sdata;
E_Comp_Wl_Remote_Surface *onscreen_parent;
Eina_List *l;
Eina_Rectangle *rect;
int fx, fy, fw, fh;
int x, y, w, h;
+ int sx = 0, sy = 0;
Eina_Bool first_skip = EINA_TRUE;
E_Comp_Wl_Buffer *buffer;
if (!evas_object_visible_get(ec->frame)) return EINA_TRUE;
- sdata = ec->comp_data->sub.data;
evas_object_geometry_get(ec->frame, &fx, &fy, &fw, &fh);
+ e_comp_wl_subsurface_position_get(ec, &sx, &sy);
+
EINA_LIST_FOREACH(parent_provider->common.ec->comp_data->remote_surface.regions, l, rect)
{
E_Comp_Wl_Remote_Region *region;
region = container_of(rect, E_Comp_Wl_Remote_Region, geometry);
- x = sdata->position.x + rect->x;
- y = sdata->position.y + rect->y;
+ x = sx + rect->x;
+ y = sy + rect->y;
+
if (onscreen_parent->ec)
{
x += onscreen_parent->ec->x;
epc_cdata->sub.list_changed = EINA_TRUE;
}
+EINTERN Eina_Bool
+e_comp_wl_subsurface_position_get(E_Client *ec, int *x, int *y)
+{
+ E_Comp_Wl_Subsurf_Data *sdata;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(e_comp_wl_subsurface_check(ec), EINA_FALSE);
+
+ sdata = ec->comp_data->sub.data;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sdata, EINA_FALSE);
+
+ if (x) *x = sdata->position.x;
+ if (y) *y = sdata->position.y;
+
+ return EINA_TRUE;
+}
+
static void
_e_comp_wl_subsurface_cb_dummy_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
EINTERN Eina_Bool e_comp_wl_subsurface_check(E_Client *ec);
EINTERN E_Client *e_comp_wl_subsurface_parent_get(E_Client *ec);
EINTERN Eina_Bool e_comp_wl_subsurface_stand_alone_mode_get(E_Client *ec);
+EINTERN Eina_Bool e_comp_wl_subsurface_position_get(E_Client *ec, int *x, int *y);
#endif
E_Comp_Wl_Buffer_Viewport *vp;
Eina_Rectangle dst = {0,}, prect;
Eina_Bool changed = EINA_FALSE;
+ int sx = 0, sy = 0;
ec = viewport->ec;
vp = &ec->comp_data->scaler.buffer_viewport;
/* The values of below x, y, w, h are specified in the transform 0 and in the parent */
if (ec->comp_data->sub.data)
{
- if (ec->comp_data->sub.data->position.x != dst.x ||
- ec->comp_data->sub.data->position.y != dst.y)
+ e_comp_wl_subsurface_position_get(ec, &sx, &sy);
+ if ((sx != dst.x) || (sy != dst.y))
{
ec->comp_data->sub.data->position.x = dst.x;
ec->comp_data->sub.data->position.y = dst.y;
out->h = (ty1 <= ty2) ? ty2 - ty1 : ty1 - ty2;
}
-static E_Comp_Wl_Subsurf_Data *
-_e_video_hwc_client_subsurface_data_get(E_Client *ec)
-{
- if (ec->comp_data && ec->comp_data->sub.data)
- return ec->comp_data->sub.data;
-
- return NULL;
-}
-
static void
_e_video_hwc_geometry_output_rect_get(E_Client *ec, Eina_Rectangle *out)
{
- E_Comp_Wl_Subsurf_Data *sdata;
+ E_Client *parent;
+ int sx = 0, sy = 0;
- sdata = _e_video_hwc_client_subsurface_data_get(ec);
- if (sdata)
+ if (e_comp_wl_subsurface_check(ec))
{
- if (sdata->parent)
+ e_comp_wl_subsurface_position_get(ec, &sx, &sy);
+ parent = e_comp_wl_subsurface_parent_get(ec);
+ if (parent)
{
- out->x = sdata->parent->x + sdata->position.x;
- out->y = sdata->parent->y + sdata->position.y;
+ out->x = parent->x + sx;
+ out->y = parent->y + sy;
}
else
{
- out->x = sdata->position.x;
- out->y = sdata->position.y;
+ out->x = sx;
+ out->y = sy;
}
}
else