This is an automated email from the git hooks/post-receive script.
git pushed a commit to reference refs/pull/221/head
in repository enlightenment.
View the commit online.
commit 2e11e6228cc09cad1efe8b762dfa614c053b07ba
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 28 14:05:36 2026 -0600
e_comp_object - turn a window when only its buffer transform changes
wl_surface.set_buffer_transform is double buffered surface state: it
applies on the next commit, also to the buffer already attached. E only
turned the image after copying in a new buffer, so a commit changing
the transform alone resized the window but drew it the old way round
until the client sent another frame.
The orientation is now set on the image and its mirrors as soon as it
changes. It stays across new buffers: evas keeps an image's
orientation when its data is set.
e_comp_object.c is shared with X11, which never sets an orientation.
wl-buffer-transform now also sets the transform back to normal without
a new buffer and checks the pixels; that step fails without this.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/bin/e_comp_object.c | 7 ++++
src/tests/wayland/test_buffer_transform.c | 57 ++++++++++++++++++++-----------
2 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index 0565d2f35..1937e5338 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -4206,8 +4206,15 @@ e_comp_object_content_size_set(Evas_Object *obj, int w, int h)
EINTERN void
e_comp_object_content_orient_set(Evas_Object *obj, Evas_Image_Orient orient)
{
+ Eina_List *l;
+ Evas_Object *o;
+
API_ENTRY;
+ if (cw->content_orient == orient) return;
cw->content_orient = orient;
+ if (cw->obj) _e_comp_object_content_orient_apply(cw, cw->obj);
+ EINA_LIST_FOREACH(cw->obj_mirror, l, o)
+ _e_comp_object_content_orient_apply(cw, o);
}
/* mark an object as dirty and setup damages */
diff --git a/src/tests/wayland/test_buffer_transform.c b/src/tests/wayland/test_buffer_transform.c
index bcba7aaf6..a3a209792 100644
--- a/src/tests/wayland/test_buffer_transform.c
+++ b/src/tests/wayland/test_buffer_transform.c
@@ -160,16 +160,42 @@ _size_check(Ctx *ctx, struct wl_surface *surface, int w, int h,
w, h);
}
+/* Checks the size and the pixels of the 200x100 buffer shown under a
+ * transform. */
+static void
+_shown_check(Ctx *ctx, struct wl_surface *surface, int transform,
+ const char *step)
+{
+ uint32_t colors[4] = { TL, TR, BL, BR };
+ int i, x, y, w, h, bx, by;
+ char what[96];
+
+ w = (transform & 1) ? 100 : 200;
+ h = (transform & 1) ? 200 : 100;
+ snprintf(what, sizeof(what), "transform %d, %s", transform, step);
+ _size_check(ctx, surface, w, h, what);
+ tk_surface_geometry(ctx->tk, surface, &x, &y, NULL, NULL);
+ for (i = 0; i < 4; i++)
+ {
+ int sx = (i & 1) ? (3 * w / 4) : (w / 4);
+ int sy = (i & 2) ? (3 * h / 4) : (h / 4);
+
+ _buffer_coord(transform, w, h, sx, sy, &bx, &by);
+ snprintf(what, sizeof(what), "transform %d, %s, at %d,%d",
+ transform, step, sx, sy);
+ _pixel_wait(ctx, x + sx, y + sy,
+ colors[((by >= 50) * 2) + (bx >= 100)], what);
+ }
+}
+
int
main(void)
{
- uint32_t colors[4] = { TL, TR, BL, BR };
struct xdg_surface *xdg_surface;
struct xdg_toplevel *toplevel;
struct wl_surface *surface;
Ctx ctx = { 0 };
- int transform, frame, i, x, y, w, h, bx, by;
- char what[64];
+ int transform, frame;
ctx.tk = tk_connect(PROG);
ctx.tester = tk_bind(ctx.tk, &wl_test_interface, 9);
@@ -202,25 +228,16 @@ main(void)
wl_surface_commit(surface);
tk_settle(ctx.tk);
tk_expect(ctx.tk, APP_ID);
-
- w = (transform & 1) ? 100 : 200;
- h = (transform & 1) ? 200 : 100;
- snprintf(what, sizeof(what), "transform %d, frame %d", transform, frame);
- _size_check(&ctx, surface, w, h, what);
- tk_surface_geometry(ctx.tk, surface, &x, &y, NULL, NULL);
- for (i = 0; i < 4; i++)
- {
- int sx = (i & 1) ? (3 * w / 4) : (w / 4);
- int sy = (i & 2) ? (3 * h / 4) : (h / 4);
-
- _buffer_coord(transform, w, h, sx, sy, &bx, &by);
- snprintf(what, sizeof(what), "transform %d, frame %d, at %d,%d",
- transform, frame, sx, sy);
- _pixel_wait(&ctx, x + sx, y + sy,
- colors[((by >= 50) * 2) + (bx >= 100)], what);
- }
+ _shown_check(&ctx, surface, transform, frame ? "frame 1" : "frame 0");
}
+ /* A transform applies to the buffer already attached too. */
+ wl_surface_set_buffer_transform(surface, WL_OUTPUT_TRANSFORM_NORMAL);
+ wl_surface_commit(surface);
+ tk_settle(ctx.tk);
+ _shown_check(&ctx, surface, WL_OUTPUT_TRANSFORM_NORMAL,
+ "without a new buffer");
+
wl_surface_set_buffer_transform(surface, WL_OUTPUT_TRANSFORM_FLIPPED_270 + 1);
if (tk_protocol_error(ctx.tk, NULL) != WL_SURFACE_ERROR_INVALID_TRANSFORM)
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.