: QSGItem(parent)
, m_surface(0)
, m_texture(0)
+ , m_hidden(false)
{
}
: QSGItem(parent)
, m_surface(0)
, m_texture(0)
+ , m_hidden(false)
{
init(surface);
}
m_surface = 0;
}
+bool WaylandSurfaceItem::hidden() const
+{
+ return m_hidden;
+}
+
+void WaylandSurfaceItem::setHidden(bool h)
+{
+ m_hidden = h;
+ update();
+}
+
QSGNode *WaylandSurfaceItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
QSGSimpleTextureNode *node = static_cast<QSGSimpleTextureNode *>(oldNode);
- if (!m_texture) {
+ if (!m_texture || m_hidden) {
delete oldNode;
return 0;
}
Q_OBJECT
Q_INTERFACES(QSGTextureProvider)
Q_PROPERTY(WaylandSurface* surface READ surface WRITE setSurface)
+ Q_PROPERTY(bool hidden READ hidden WRITE setHidden)
public:
WaylandSurfaceItem(QSGItem *parent = 0);
QSGTexture *texture() const;
const char *textureChangedSignal() const { return SIGNAL(textureChanged()); }
+ bool hidden() const;
+
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
public slots:
void takeFocus();
+ void setHidden(bool hidden);
private slots:
void surfaceMapped(const QRect &rect);
WaylandSurface *m_surface;
QSGTexture *m_texture;
+ bool m_hidden;
};
#endif