summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/qwaylandwindow.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-06-23 10:14:51 +0200
committerQt by Nokia <qt-info@nokia.com>2011-06-23 17:04:21 +0200
commit1b9c679eb5efe0e4ab746f02127de6456796f642 (patch)
treedc6cdd2468e082706e3e76b81a9dac8ba9ec3b9f /src/plugins/platforms/wayland/qwaylandwindow.cpp
parente9d36991233278d68257f5d9632ceace6d7b243d (diff)
Make sure to call damage on the buffer when we damage it
Change-Id: Id325a1dee322c2b37215e6577870068260f5f7cc Reviewed-on: http://codereview.qt.nokia.com/683 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylandwindow.cpp')
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index 3afe907a4a..e79a712a3c 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -127,28 +127,25 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer)
}
}
-void QWaylandWindow::damage(const QRegion &region)
+void QWaylandWindow::damage(const QRect &rect)
{
//We have to do sync stuff before calling damage, or we might
//get a frame callback before we get the timestamp
- mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this);
- mWaitingForFrameSync = true;
-
- QVector<QRect> rects = region.rects();
- for (int i = 0; i < rects.size(); i++) {
- const QRect rect = rects.at(i);
- wl_buffer_damage(mBuffer->buffer(), rect.x(), rect.y(), rect.width(), rect.height());
- wl_surface_damage(mSurface,
- rect.x(), rect.y(), rect.width(), rect.height());
- wl_buffer_damage(mBuffer->buffer(),
- rect.x(), rect.y(), rect.width(), rect.height());
+ if (!mWaitingForFrameSync) {
+ mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this);
+ mWaitingForFrameSync = true;
}
+
+ wl_surface_damage(mSurface,
+ rect.x(), rect.y(), rect.width(), rect.height());
}
void QWaylandWindow::newSurfaceCreated()
{
if (mBuffer) {
wl_surface_attach(mSurface,mBuffer->buffer(),0,0);
+ wl_surface_damage(mSurface,
+ 0,0,mBuffer->size().width(),mBuffer->size().height());
}
}