[PATCH] weston-test: schedule repaint after moving surface in test extension
Kristian Høgsberg
hoegsberg at gmail.com
Fri Jul 12 22:28:52 PDT 2013
On Tue, Jul 09, 2013 at 06:38:20PM -0700, U. Artie Eoff wrote:
> From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>
>
> After some discussion with Rob Bradford (robster), we concluded that
> we need to schedule a compositor repaint in
> weston-test.c:test_configure_surface(...) to ensure that the moved
> surface gets a frame callback/repaint.
>
> This fixes https://bugs.freedesktop.org/show_bug.cgi?id=66133
>
> Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
> ---
> tests/weston-test.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tests/weston-test.c b/tests/weston-test.c
> index b625f42..580612d 100644
> --- a/tests/weston-test.c
> +++ b/tests/weston-test.c
> @@ -88,6 +88,8 @@ test_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy, i
>
> if (!weston_surface_is_mapped(surface))
> weston_surface_update_transform(surface);
> +
> + weston_compositor_schedule_repaint(surface->compositor);
The wl_surface_commit that the test client issues after moving the
surface should be scheduling a repaint. You can see the call to
weston_surface_schedule_repaint() as the last thing in
weston_surface_commit(). The problem is that
weston_surface_schedule_repaint() schedules a repaint for the outputs
that the surface is *currently* on. When you move a surface onto a
new output, the surface output mask (which we use for determining
which outputs to repaint) isn't updated until we hit
weston_output_repaint(), and we don't actually schedule a repaint for
the new output.
In general, when we update surface geometry, we don't know which
outputs need to be repainted, which is why we use
weston_compositor_schedule_repaint() in the animation functions and
during interactive surface move and resize for example. But a client
can attach a bigger buffer that makes a surface extend into a new
output, for example, and in that case we end up missing a repaint.
Adding the weston_compositor_schedule_repaint(surface->compositor) in
weston-test makes the test case pass but papers over a subtle issue in
core weston.
The right fix here is to just always call
weston_surface_update_transform() in weston_surface_commit() and then
schedule repaints for the outputs the surface was on before *and*
after updating the transform. I'm just a little concerned about
making a subtle change like that just before releasing 1.2, so I'll
leave this problem as is and we can then review and evaluate the fix
properly for a 1.2.1 release.
Kristian
> }
>
> static void
> --
> 1.7.11.7
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list