Prepare client-visibility transport
authorMartin Zielinski <martin.zielinski@nokia.com>
Wed, 22 Jun 2011 10:12:38 +0000 (12:12 +0200)
committerMartin Zielinski <martin.zielinski@nokia.com>
Wed, 22 Jun 2011 10:12:38 +0000 (12:12 +0200)
Added clientRenderingEnabled property to WaylandSurfaceItem. This will be used
to inform the client application whether it should render or not.

src/qt-compositor/compositor_api/waylandsurfaceitem.cpp
src/qt-compositor/compositor_api/waylandsurfaceitem.h

index 0a41c55..89fdda2 100644 (file)
@@ -224,3 +224,12 @@ void WaylandSurfaceItem::setUseTextureAlpha(bool useTextureAlpha)
         update();
     }
 }
+
+void WaylandSurfaceItem::setClientRenderingEnabled(bool enabled)
+{
+    if (m_clientRenderingEnabled != enabled) {
+        m_clientRenderingEnabled = enabled;
+        //qDebug() << "CLIENT RENDERING ENABLED: " << enabled;
+        emit clientRenderingEnabledChanged();
+    }
+}
index 5786fef..f2a9e23 100644 (file)
@@ -55,7 +55,8 @@ class WaylandSurfaceItem : public QSGItem, public QSGTextureProvider
     Q_INTERFACES(QSGTextureProvider)
     Q_PROPERTY(WaylandSurface* surface READ surface WRITE setSurface)
     Q_PROPERTY(bool paintEnabled READ paintEnabled WRITE setPaintEnabled)
-    Q_PROPERTY(bool useTextureAlpha READ useTextureAlpha WRITE setUseTextureAlpha)
+    Q_PROPERTY(bool useTextureAlpha READ useTextureAlpha WRITE setUseTextureAlpha NOTIFY useTextureAlphaChanged)
+    Q_PROPERTY(bool clientRenderingEnabled READ clientRenderingEnabled WRITE setClientRenderingEnabled NOTIFY clientRenderingEnabledChanged)
 
 public:
     WaylandSurfaceItem(QSGItem *parent = 0);
@@ -72,6 +73,10 @@ public:
 
     bool paintEnabled() const;
     bool useTextureAlpha() const  { return m_useTextureAlpha; }
+    bool clientRenderingEnabled() const { return m_clientRenderingEnabled; }
+
+    void setUseTextureAlpha(bool useTextureAlpha);
+    void setClientRenderingEnabled(bool enabled);
 
 protected:
     void mousePressEvent(QGraphicsSceneMouseEvent *event);
@@ -84,7 +89,6 @@ protected:
 public slots:
     void takeFocus();
     void setPaintEnabled(bool paintEnabled);
-    void setUseTextureAlpha(bool useTextureAlpha);
 
 private slots:
     void surfaceMapped(const QRect &rect);
@@ -93,6 +97,8 @@ private slots:
 
 signals:
     void textureChanged();
+    void useTextureAlphaChanged();
+    void clientRenderingEnabledChanged();
 
 protected:
     QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
@@ -105,6 +111,7 @@ private:
     QSGTexture *m_texture;
     bool m_paintEnabled;
     bool m_useTextureAlpha;
+    bool m_clientRenderingEnabled;
 };
 
 #endif