diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compositor/compositor_api/waylandsurfaceitem.cpp | 18 | ||||
-rw-r--r-- | src/compositor/compositor_api/waylandsurfaceitem.h | 1 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/compositor/compositor_api/waylandsurfaceitem.cpp b/src/compositor/compositor_api/waylandsurfaceitem.cpp index aff24cd54..7a192448c 100644 --- a/src/compositor/compositor_api/waylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/waylandsurfaceitem.cpp @@ -311,15 +311,17 @@ public: setFlag(UsePreprocess,true); } void preprocess() { - if (m_item->m_damaged) + if (m_item->m_damaged) { + m_item->updateTexture(); m_item->updateNodeTexture(this); + } } private: WaylandSurfaceItem *m_item; }; -void WaylandSurfaceItem::updateNodeTexture(WaylandSurfaceNode *node) +void WaylandSurfaceItem::updateTexture() { if (m_damaged) { QSGTexture *oldTexture = m_texture; @@ -342,15 +344,23 @@ void WaylandSurfaceItem::updateNodeTexture(WaylandSurfaceNode *node) m_provider->t = m_texture; m_provider->smooth = smooth(); } +} +void WaylandSurfaceItem::updateNodeTexture(WaylandSurfaceNode *node) +{ node->setTexture(m_texture); node->setFiltering(smooth() ? QSGTexture::Linear : QSGTexture::Nearest); } - QSGNode *WaylandSurfaceItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { - if (!m_surface || !m_paintEnabled) { + if (!m_surface) { + delete oldNode; + return 0; + } + + updateTexture(); + if (!m_texture || !m_paintEnabled) { delete oldNode; return 0; } diff --git a/src/compositor/compositor_api/waylandsurfaceitem.h b/src/compositor/compositor_api/waylandsurfaceitem.h index b59ce8e53..da07b0066 100644 --- a/src/compositor/compositor_api/waylandsurfaceitem.h +++ b/src/compositor/compositor_api/waylandsurfaceitem.h @@ -124,6 +124,7 @@ protected: private: friend class WaylandSurfaceNode; + void updateTexture(); void updateNodeTexture(WaylandSurfaceNode *newNode); QPoint toSurface(const QPointF &pos) const; void init(WaylandSurface *); |