summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-03-05 13:34:50 +0100
committerPaul Olav Tvete <paul.tvete@nokia.com>2012-03-05 14:06:35 +0100
commitce1e3fd8dc416a9a4f6550a6c139aec435e79940 (patch)
tree10575956258fcd6a6e0695cfd6f028c47a364fab /src
parent3825f99882d684d91c5439464ed965f67ba28e6d (diff)
Fixed WaylandSurfaceItem for when paint enabled is false.
This broke in change c5163c53337b72e0c28ae. Even when paint enabled is false meaning we don't create a paint node, we want to update the QSGTexture and the texture provider, so that the WaylandSurfaceItem can function as a shader effect source. Change-Id: I8d40c774f8a28240902d2d9919aee8645db9dbe7 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/compositor_api/waylandsurfaceitem.cpp18
-rw-r--r--src/compositor/compositor_api/waylandsurfaceitem.h1
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 *);