summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-06-21 15:40:31 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-06-21 15:40:31 -0400
commit487213defdb16e62cbe90cc956a07297f391a6e3 (patch)
treeb38bea81f7825ee82191d403b1410ad5c4f56f8f
parentfd94bf0fd06560982decbb2c016973454ae55078 (diff)
Damage surface before attaching new buffer
This reverts cde9bfc80545030a6e5e4579a1adc7263ab7bfe8. We need to damage the area covered by the old surface when attaching a new buffer. The new surface area will be damaged by the client.
-rw-r--r--compositor/compositor.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/compositor/compositor.c b/compositor/compositor.c
index 781bb86..73affad 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -908,6 +908,13 @@ surface_attach(struct wl_client *client,
{
struct wlsc_surface *es = (struct wlsc_surface *) surface;
+ /* FIXME: This damages the entire old surface, but we should
+ * really just damage the part that's no longer covered by the
+ * surface. Anything covered by the new surface will be
+ * damaged by the client. */
+ if (es->buffer)
+ wlsc_surface_damage(es);
+
buffer->busy_count++;
wlsc_buffer_post_release(es->buffer);
@@ -927,12 +934,6 @@ surface_attach(struct wl_client *client,
wlsc_buffer_attach(buffer, surface);
- /* FIXME: This damages the entire old surface, but we should
- * really just damage the part that's no longer covered by the
- * surface. Anything covered by the new surface will be
- * damaged by the client. */
- wlsc_surface_damage(es);
-
es->compositor->shell->attach(es->compositor->shell, es);
}