We still support not having custome shaders
authorJørgen Lind <jorgen.lind@nokia.com>
Fri, 6 May 2011 11:50:14 +0000 (13:50 +0200)
committerJørgen Lind <jorgen.lind@nokia.com>
Fri, 6 May 2011 11:50:14 +0000 (13:50 +0200)
src/qt-compositor/compositor_api/waylandsurfaceitem.cpp
src/qt-compositor/wayland_wrapper/wlsurface.cpp

index 597bff0..1504316 100644 (file)
@@ -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);
index deec00e..5095383 100644 (file)
@@ -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;