summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2012-01-07 20:28:25 +0100
committerPaul Olav Tvete <paul.tvete@nokia.com>2012-01-10 13:49:31 +0100
commita0ad79fcadc9df6144ff91a8ba4b49321000f5cd (patch)
tree2a49b6ab9012d183f2d05e221a1d948f0cf41726 /src
parent8815c5f322bbf5570c283c95df69b6e41e133583 (diff)
Make compositor handle subsurfaces with shm buffers.
So we'r lying for now for shm buffers, and assuming they have allways been displayed. Also, this patch fixes so that if you attach a buffer, and the last buffer has not gotten any damages, then it will be released. Change-Id: Id1b9789aa8e4dcff75147f6c96220039defc0d8f Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/wayland_wrapper/wlsurface.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp
index c63886861..7acd379a8 100644
--- a/src/compositor/wayland_wrapper/wlsurface.cpp
+++ b/src/compositor/wayland_wrapper/wlsurface.cpp
@@ -151,7 +151,7 @@ public:
void setFinished() { m_is_frame_finished = true; }
inline bool isPosted() const { return m_is_posted; }
- inline bool isDisplayed() const { return m_texture || m_is_posted; }
+ inline bool isDisplayed() const { return m_texture || m_is_posted || wl_buffer_is_shm(m_buffer); }
inline bool isFinished() const { return m_is_frame_finished; }
inline QRect damageRect() const { return m_damageRect; }
@@ -544,6 +544,11 @@ void Surface::attach(struct wl_buffer *buffer)
d->surfaceBuffer = 0;
}
#endif
+ SurfaceBuffer *last = d->bufferQueue.size()?d->bufferQueue.last():0;
+ if (last && !last->damageRect().isValid()) {
+ last->destructBufferState();
+ d->bufferQueue.takeLast();
+ }
d->bufferQueue << newBuffer;
}