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>
This commit is contained in:
parent
e9d3699123
commit
1b9c679eb5
@ -91,7 +91,7 @@ void QWaylandXCompositeEGLContext::swapBuffers()
|
||||
QSize size = mWindow->geometry().size();
|
||||
|
||||
eglSwapBuffers(mEglIntegration->eglDisplay(),mEglWindowSurface);
|
||||
mWindow->damage(QRegion(QRect(QPoint(0,0),size)));
|
||||
mWindow->damage(QRect(QPoint(0,0),size));
|
||||
mWindow->waitForFrameSync();
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ void QWaylandXCompositeGLXContext::swapBuffers()
|
||||
QSize size = mWindow->geometry().size();
|
||||
|
||||
glXSwapBuffers(mGlxIntegration->xDisplay(),mXWindow);
|
||||
mWindow->damage(QRegion(QRect(QPoint(0,0),size)));
|
||||
mWindow->damage(QRect(QPoint(0,0),size));
|
||||
mWindow->waitForFrameSync();
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,12 @@ void QWaylandShmWindowSurface::flush(QWidget *widget, const QRegion ®ion, con
|
||||
Q_UNUSED(offset);
|
||||
QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->platformWindow());
|
||||
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 QWaylandShmWindowSurface::resize(const QSize &size)
|
||||
|
@ -127,28 +127,25 @@ 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()
|
||||
{
|
||||
if (mBuffer) {
|
||||
wl_surface_attach(mSurface,mBuffer->buffer(),0,0);
|
||||
wl_surface_damage(mSurface,
|
||||
0,0,mBuffer->size().width(),mBuffer->size().height());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user