Surface damage has a curious relationship with buffer damage.  If we
change our buffer orientation, the whole buffer contents will likely
change.  The application is really only supposed to tell us what parts
of the surface changed, which could still just be a subset.

Since the gl renderer uses the damage rectangles for texture uploads, it
won't upload the entire buffer contents after an orientation change.

To deal with this we just damage the entire surface any time the buffer
viewport changes.

This fixes weston_simple_damage --rotating-transform when using the gl
renderer.

Signed-off-by: Derek Foreman <[email protected]>
---
 src/compositor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compositor.c b/src/compositor.c
index 33d500e..5a2f3aa 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2761,6 +2761,10 @@ weston_surface_commit_state(struct weston_surface 
*surface,
                        surface->configure(surface, state->sx, state->sy);
        }
 
+       if (state->buffer_viewport.changed)
+               pixman_region32_union_rect(&surface->damage, &surface->damage,
+                                          0, 0, INT32_MAX, INT32_MAX);
+
        state->sx = 0;
        state->sy = 0;
        state->newly_attached = 0;
-- 
2.6.2

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to