From: Martin Zielinski Date: Wed, 22 Jun 2011 10:12:38 +0000 (+0200) Subject: Prepare client-visibility transport X-Git-Tag: qt-v5.0.0-alpha1~257 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b3e93517c876edc731f48adcfcbdcada7fc1b66;p=profile%2Fivi%2Fqtwayland.git Prepare client-visibility transport Added clientRenderingEnabled property to WaylandSurfaceItem. This will be used to inform the client application whether it should render or not. --- diff --git a/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp b/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp index 0a41c55..89fdda2 100644 --- a/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp +++ b/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp @@ -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(); + } +} diff --git a/src/qt-compositor/compositor_api/waylandsurfaceitem.h b/src/qt-compositor/compositor_api/waylandsurfaceitem.h index 5786fef..f2a9e23 100644 --- a/src/qt-compositor/compositor_api/waylandsurfaceitem.h +++ b/src/qt-compositor/compositor_api/waylandsurfaceitem.h @@ -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