[RFC weston] compositor: note, weston_surface_damage does it wrong
Pekka Paalanen
ppaalanen at gmail.com
Thu Feb 19 04:05:38 PST 2015
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
The fix is not trivial, so I want to document the problem before I
forget about it again.
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Cc: Jason Ekstrand <jason at jlekstrand.net>
---
src/compositor.c | 10 ++++++++++
src/compositor.h | 3 +++
2 files changed, 13 insertions(+)
diff --git a/src/compositor.c b/src/compositor.c
index 9db9ca8..d30de96 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1397,6 +1397,16 @@ weston_view_schedule_repaint(struct weston_view *view)
weston_output_schedule_repaint(output);
}
+/**
+ * XXX: This function does it the wrong way.
+ * surface->damage is the damage from the client, and causes
+ * surface_flush_damage() to copy pixels. No window management action can
+ * cause damage to the client-provided content, warranting re-upload!
+ *
+ * Instead of surface->damage, this function should record the damage
+ * with all the views for this surface to avoid extraneous texture
+ * uploads.
+ */
WL_EXPORT void
weston_surface_damage(struct weston_surface *surface)
{
diff --git a/src/compositor.h b/src/compositor.h
index 86f0e49..3f1882c 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -862,7 +862,10 @@ struct weston_surface {
struct wl_resource *resource;
struct wl_signal destroy_signal;
struct weston_compositor *compositor;
+
+ /** Damage in local coordinates from the client, for tex upload. */
pixman_region32_t damage;
+
pixman_region32_t opaque; /* part of geometry, see below */
pixman_region32_t input;
int32_t width, height;
--
2.0.5
More information about the wayland-devel
mailing list