void Surface::damage(const QRect &rect)
{
- if (m_bufferQueue.size()) {
- SurfaceBuffer *surfaceBuffer = m_bufferQueue.last();
- if (surfaceBuffer)
- surfaceBuffer->setDamage(rect);
- else
- qWarning() << "Surface::damage() null buffer";
- if (!m_backBuffer)
- advanceBufferQueue();
- } else {
- // we've receicved a second damage for the same buffer
- currentSurfaceBuffer()->setDamage(rect);
- }
+ SurfaceBuffer *surfaceBuffer = m_bufferQueue.isEmpty() ? currentSurfaceBuffer() : m_bufferQueue.last();
+ if (surfaceBuffer)
+ surfaceBuffer->setDamage(rect);
+ else
+ qWarning() << "Surface::damage() null buffer";
+
+ if (!m_bufferQueue.isEmpty() && !m_backBuffer)
+ advanceBufferQueue();
+
doUpdate();
}
{
if (visible) {
+ if (mBuffer)
+ wl_surface_attach(mSurface, mBuffer->buffer(), 0, 0);
+
if (!mSentInitialResize) {
QWindowSystemInterface::handleSynchronousGeometryChange(window(), geometry());
mSentInitialResize = true;
}
+
QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size()));
- if (mBuffer) {
- wl_surface_attach(mSurface, mBuffer->buffer(),0,0);
- }
} else {
QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size()));
wl_surface_attach(mSurface, 0,0,0);