Give texture ownership to scenegraph in WaylandSurfaceItem
authorAndy Nichols <andy.nichols@nokia.com>
Wed, 25 Apr 2012 14:48:04 +0000 (16:48 +0200)
committerAndy Nichols <andy.nichols@nokia.com>
Fri, 18 May 2012 11:48:12 +0000 (13:48 +0200)
Change-Id: Ia40d73e11d54b96e27e65224d8fab6d17c5997b9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/compositor/compositor_api/waylandsurfaceitem.cpp

index 4948cc3..6316bca 100644 (file)
@@ -372,11 +372,11 @@ void WaylandSurfaceItem::updateTexture()
         QSGTexture *oldTexture = texture;
         if (m_surface->type() == WaylandSurface::Texture) {
             QOpenGLContext *context = QOpenGLContext::currentContext();
-
-            QQuickCanvas::CreateTextureOptions opt = useTextureAlpha() ? QQuickCanvas::TextureHasAlphaChannel : QQuickCanvas::CreateTextureOptions(0);
-            texture = canvas()->createTextureFromId(m_surface->texture(context),
-                                                                       m_surface->size(),
-                                                                       opt);
+            QQuickCanvas::CreateTextureOptions opt = QQuickCanvas::TextureOwnsGLTexture;
+            if (useTextureAlpha()) {
+                opt |= QQuickCanvas::TextureHasAlphaChannel;
+            }
+            texture = canvas()->createTextureFromId(m_surface->texture(context), m_surface->size(), opt);
         } else {
             texture = canvas()->createTextureFromImage(m_surface->image());
         }