Fixed missing texture updates.
authorSamuel Rødal <samuel.rodal@nokia.com>
Thu, 12 May 2011 08:49:10 +0000 (10:49 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Thu, 12 May 2011 08:53:21 +0000 (10:53 +0200)
Make sure we get a new texture id, so that
QSGSimpleTextureNode::setTexture() doesn't return early.

src/qt-compositor/compositor_api/waylandsurfaceitem.cpp

index 772fb31..9281831 100644 (file)
@@ -51,8 +51,7 @@
 
 void WaylandSurfaceItem::surfaceDamaged(const QRect &)
 {
-    if (m_texture)
-        delete m_texture;
+    QSGTexture *oldTexture = m_texture;
 
     if (m_surface->type() == WaylandSurface::Texture) {
         m_texture = canvas()->sceneGraphEngine()->createTextureFromId(m_surface->texture(),
@@ -61,6 +60,8 @@ void WaylandSurfaceItem::surfaceDamaged(const QRect &)
         m_texture = canvas()->sceneGraphEngine()->createTextureFromImage(m_surface->image());
     }
 
+    delete oldTexture;
+
     emit textureChanged();
 }