}
static void
+_rotation_effect_object_transform_pos_map(E_Client *ec, int sx, int sy, int *dx, int *dy)
+{
+ E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport;
+ int transform = vp->buffer.transform;
+ int bw, bh, tx, ty;
+
+ e_pixmap_size_get(ec->pixmap, &bw, &bh);
+
+ /* for subsurface, it should be swap 90 and 270 */
+ if (ec->comp_data->sub.data)
+ switch (transform)
+ {
+ case WL_OUTPUT_TRANSFORM_90: transform = WL_OUTPUT_TRANSFORM_270; break;
+ case WL_OUTPUT_TRANSFORM_270: transform = WL_OUTPUT_TRANSFORM_90; break;
+ case WL_OUTPUT_TRANSFORM_FLIPPED_90: transform = WL_OUTPUT_TRANSFORM_FLIPPED_270; break;
+ case WL_OUTPUT_TRANSFORM_FLIPPED_270: transform = WL_OUTPUT_TRANSFORM_FLIPPED_90; break;
+ default: break;
+ }
+
+ switch (transform)
+ {
+ case WL_OUTPUT_TRANSFORM_NORMAL:
+ default: tx = sx, ty = sy; break;
+ case WL_OUTPUT_TRANSFORM_90: tx = sy, ty = bw - sx; break;
+ case WL_OUTPUT_TRANSFORM_180: tx = bw - sx, ty = bh - sy; break;
+ case WL_OUTPUT_TRANSFORM_270: tx = bh - sy, ty = sx; break;
+ case WL_OUTPUT_TRANSFORM_FLIPPED: tx = bw - sx, ty = sy; break;
+ case WL_OUTPUT_TRANSFORM_FLIPPED_90: tx = sy, ty = sx; break;
+ case WL_OUTPUT_TRANSFORM_FLIPPED_180: tx = sx, ty = bh - sy; break;
+ case WL_OUTPUT_TRANSFORM_FLIPPED_270: tx = bh - sy, ty = bw - sx; break;
+ }
+
+ tx *= vp->buffer.scale;
+ ty *= vp->buffer.scale;
+
+ *dx = tx;
+ *dy = ty;
+}
+
+static void
+_rotation_effect_object_transform_apply(Rotation_Effect_Object *eobj)
+{
+ Evas_Map *map;
+ E_Client *ec;
+ int x1, y1, x2, y2, x, y, bw, bh;
+ char buffer[128];
+ char *p = buffer;
+ int l, remain = sizeof buffer;
+
+ if (!(ec = eobj->ec)) return;
+ if (!ec->comp_data) return;
+
+ if (!ec->comp_data->scaler.buffer_viewport.buffer.transform &&
+ ec->comp_data->scaler.buffer_viewport.buffer.scale == 1)
+ return;
+
+ map = evas_map_new(4);
+ if (!map) return;
+
+ e_pixmap_size_get(ec->pixmap, &bw, &bh);
+
+ x1 = y1 = 0;
+ x2 = bw;
+ y2 = bh;
+
+ evas_map_util_points_populate_from_geometry(map, ec->x, ec->y, bw, bh, 0);
+
+ _rotation_effect_object_transform_pos_map(ec, x1, y1, &x, &y);
+ evas_map_point_image_uv_set(map, 0, x, y);
+ l = snprintf(p, remain, " %d,%d", x, y);
+ p += l, remain -= l;
+
+ _rotation_effect_object_transform_pos_map(ec, x2, y1, &x, &y);
+ evas_map_point_image_uv_set(map, 1, x, y);
+ l = snprintf(p, remain, " %d,%d", x, y);
+ p += l, remain -= l;
+
+ _rotation_effect_object_transform_pos_map(ec, x2, y2, &x, &y);
+ evas_map_point_image_uv_set(map, 2, x, y);
+ l = snprintf(p, remain, " %d,%d", x, y);
+ p += l, remain -= l;
+
+ _rotation_effect_object_transform_pos_map(ec, x1, y2, &x, &y);
+ evas_map_point_image_uv_set(map, 3, x, y);
+ l = snprintf(p, remain, " %d,%d", x, y);
+ p += l, remain -= l;
+
+ evas_object_map_set(eobj->img, map);
+ evas_object_map_enable_set(eobj->img, EINA_TRUE);
+
+ evas_map_free(map);
+}
+
+static void
_rotation_effect_object_free(Rotation_Effect_Object *eobj)
{
if (!eobj) return;
eobj = _rotation_effect_object_create(target);
if (!eobj) continue;
+ _rotation_effect_object_transform_apply(eobj);
+
ctx_begin->objects = eina_list_append(ctx_begin->objects, eobj);
if (eobj->ec)
effect->waiting_list = eina_list_append(effect->waiting_list, eobj->ec);
eobj = _rotation_effect_object_create(target);
if (!eobj) continue;
+ _rotation_effect_object_transform_apply(eobj);
+
evas_object_geometry_get(target, &x, &y, &w, &h);
ctx_end->objects = eina_list_append(ctx_end->objects, eobj);