Make sure to call damage on the buffer when we damage it
This commit is contained in:
parent
bbcc62efaa
commit
ce4d3435d7
@ -1,7 +1,4 @@
|
|||||||
include (../xcomposite_share/xcomposite_share.pri)
|
include (../xcomposite_share/xcomposite_share.pri)
|
||||||
load(qpa/egl/convenience)
|
|
||||||
load(qpa/egl/context)
|
|
||||||
load(qpa/egl/xlibintegration)
|
|
||||||
|
|
||||||
LIBS += -lXcomposite -lEGL
|
LIBS += -lXcomposite -lEGL
|
||||||
|
|
||||||
|
@ -119,7 +119,12 @@ void QWaylandShmBackingStore::flush(QWindow *window, const QRegion ®ion, cons
|
|||||||
Q_UNUSED(offset);
|
Q_UNUSED(offset);
|
||||||
QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window->handle());
|
QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window->handle());
|
||||||
Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm);
|
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 &)
|
void QWaylandShmBackingStore::resize(const QSize &size, const QRegion &)
|
||||||
|
@ -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
|
//We have to do sync stuff before calling damage, or we might
|
||||||
//get a frame callback before we get the timestamp
|
//get a frame callback before we get the timestamp
|
||||||
mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this);
|
if (!mWaitingForFrameSync) {
|
||||||
mWaitingForFrameSync = true;
|
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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wl_surface_damage(mSurface,
|
||||||
|
rect.x(), rect.y(), rect.width(), rect.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandWindow::newSurfaceCreated()
|
void QWaylandWindow::newSurfaceCreated()
|
||||||
@ -152,6 +147,7 @@ void QWaylandWindow::newSurfaceCreated()
|
|||||||
if (mBuffer) {
|
if (mBuffer) {
|
||||||
wl_surface_attach(mSurface,mBuffer->buffer(),0,0);
|
wl_surface_attach(mSurface,mBuffer->buffer(),0,0);
|
||||||
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
|
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
|
||||||
|
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);
|
int32_t x, int32_t y, int32_t width, int32_t height);
|
||||||
|
|
||||||
void attach(QWaylandBuffer *buffer);
|
void attach(QWaylandBuffer *buffer);
|
||||||
void damage(const QRegion ®ion);
|
void damage(const QRect &rect);
|
||||||
|
|
||||||
void waitForFrameSync();
|
void waitForFrameSync();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user