diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-06-23 14:30:04 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-06-23 14:30:22 +0200 |
commit | ce4d3435d75cf92d44b95522d24d0373a7aefb1b (patch) | |
tree | 6bac1b9d001d42b6d5b3e78c7b48972e561ee008 /src/plugins/platforms/wayland | |
parent | bbcc62efaae8addaa55281a8c9fab8877cb0d64f (diff) |
Make sure to call damage on the buffer when we damage it
Diffstat (limited to 'src/plugins/platforms/wayland')
4 files changed, 15 insertions, 17 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri index a61391b2d1..5f86bd9588 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri @@ -1,7 +1,4 @@ include (../xcomposite_share/xcomposite_share.pri) -load(qpa/egl/convenience) -load(qpa/egl/context) -load(qpa/egl/xlibintegration) LIBS += -lXcomposite -lEGL diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index ccb50a73fb..25a1b466d4 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp @@ -119,7 +119,12 @@ void QWaylandShmBackingStore::flush(QWindow *window, const QRegion ®ion, cons Q_UNUSED(offset); QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window->handle()); Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm); - waylandWindow->damage(region); + 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()); + waylandWindow->damage(rect); + } } void QWaylandShmBackingStore::resize(const QSize &size, const QRegion &) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 8fc8700d2f..2376df55c9 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -129,22 +129,17 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer) } } -void QWaylandWindow::damage(const QRegion ®ion) +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() @@ -152,6 +147,7 @@ void QWaylandWindow::newSurfaceCreated() if (mBuffer) { wl_surface_attach(mSurface,mBuffer->buffer(),0,0); QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size())); + wl_surface_damage(mSurface,0,0,mBuffer->size().width(),mBuffer->size().height()); } } diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h index ca9f4b14d3..4f1e2c8183 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.h +++ b/src/plugins/platforms/wayland/qwaylandwindow.h @@ -71,7 +71,7 @@ public: int32_t x, int32_t y, int32_t width, int32_t height); void attach(QWaylandBuffer *buffer); - void damage(const QRegion ®ion); + void damage(const QRect &rect); void waitForFrameSync(); |