From ca98bcb2bedb7f521892a4c97119f11753b48d70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B8rgen=20Lind?= Date: Fri, 6 May 2011 13:50:14 +0200 Subject: [PATCH] We still support not having custome shaders --- src/qt-compositor/compositor_api/waylandsurfaceitem.cpp | 7 +++++++ src/qt-compositor/wayland_wrapper/wlsurface.cpp | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp b/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp index 597bff0..1504316 100644 --- a/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp +++ b/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp @@ -186,6 +186,13 @@ QSGNode *WaylandSurfaceItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa if (!node) { node = new QSGSimpleTextureNode(); } + + if (surface()->isYInverted()) { + node->setRect(0, height(), width(), -height()); + } else { + node->setRect(0, 0, width(), height()); + } + node->setTexture(m_texture); node->setFiltering(smooth() ? QSGTexture::Linear : QSGTexture::Nearest); diff --git a/src/qt-compositor/wayland_wrapper/wlsurface.cpp b/src/qt-compositor/wayland_wrapper/wlsurface.cpp index deec00e..5095383 100644 --- a/src/qt-compositor/wayland_wrapper/wlsurface.cpp +++ b/src/qt-compositor/wayland_wrapper/wlsurface.cpp @@ -196,10 +196,12 @@ WaylandSurface::Type Surface::type() const bool Surface::isYInverted() const { Q_D(const Surface); - if (d->type() == WaylandSurface::Texture || d->type() == WaylandSurface::Direct) { + if (d->type() == WaylandSurface::Texture) { if (textureId()) { return d->compositor->graphicsHWIntegration()->isYInverted(d->buffer()); } + } else if (d->type() == WaylandSurface::Direct) { + return d->compositor->graphicsHWIntegration()->isYInverted(d->buffer()); } //shm surfaces are not flipped (in our "world") return false; -- 2.7.4