From: Paul Olav Tvete Date: Tue, 10 Jan 2012 12:40:31 +0000 (+0100) Subject: Direct rendering fix for previous fix. X-Git-Tag: qt-v5.0.0-alpha1~102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3e02faa0d59a3e383afb8773a91e9c5d037ecbc;p=profile%2Fivi%2Fqtwayland.git Direct rendering fix for previous fix. In the direct rendering case we disown the buffer, so we end up in yet another strange state. This code definitely needs refactoring... Change-Id: Ie5495f9cb1e993e195ba9ecbe19f74425600efa9 Sanity-Review: Qt Sanity Bot Reviewed-by: Jørgen Lind --- diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp index 7acd379..fdfd14b 100644 --- a/src/compositor/wayland_wrapper/wlsurface.cpp +++ b/src/compositor/wayland_wrapper/wlsurface.cpp @@ -266,10 +266,9 @@ public: void newCurrentBuffer() { //TODO release SHM buffer.... - if (surfaceBuffer && surfaceBuffer->isPosted()) + if (surfaceBuffer && surfaceBuffer->isPosted()) { surfaceBuffer->destructBufferState(); - - if (surfaceBuffer && !surfaceBuffer->isDisplayed()) { + } else if (surfaceBuffer && !surfaceBuffer->isDisplayed()) { qDebug() << "### not skipping undisplayed buffer"; return; } @@ -413,7 +412,7 @@ Surface::~Surface() WaylandSurface::Type Surface::type() const { Q_D(const Surface); - if (d->surfaceBuffer && !d->surfaceBuffer->bufferIsDestroyed()) { + if (d->surfaceBuffer && d->surfaceBuffer->handle()) { if (d->surfaceBuffer && d->surfaceBuffer->isShmBuffer()) { return WaylandSurface::Shm; } else if (d->surfaceBuffer){ @@ -430,7 +429,7 @@ bool Surface::isYInverted() const if (!d->surfaceBuffer) return false; - if (d->compositor->graphicsHWIntegration() && !d->surfaceBuffer->bufferIsDestroyed() && type() != WaylandSurface::Shm) { + if (d->compositor->graphicsHWIntegration() && d->surfaceBuffer->handle() && type() != WaylandSurface::Shm) { return d->compositor->graphicsHWIntegration()->isYInverted(d->surfaceBuffer->handle()); } #endif