Do not pass texture ownership to scenegraph in WaylandSurfaceItem
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Fri, 17 Aug 2012 09:16:44 +0000 (12:16 +0300)
committerJørgen Lind <jorgen.lind@nokia.com>
Fri, 17 Aug 2012 10:37:56 +0000 (12:37 +0200)
Doing so breaks many simple cases of GL rendering where there is one
attach followed by multiple damages. Letting SG destroy the GL texture
when deleting the old QSGTexture instance is wrong and results in
showing nothing but the very first frame on the screen.

Also, SurfaceBuffer does delete the GL texture upon destruction so the
ownership should stay with it.

This reverts c1ee015bab06e82bccbb723b522c185a8188cab5, not sure why
the change was introduced in the first place.

Change-Id: Ie91574daadeeb7214a55f8e32c10d0a316c0e2c8
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/compositor/compositor_api/waylandsurfaceitem.cpp

index 08fedc5..6a6d8c6 100644 (file)
@@ -349,7 +349,7 @@ void WaylandSurfaceItem::updateTexture()
         QSGTexture *oldTexture = texture;
         if (m_surface->type() == WaylandSurface::Texture) {
             QOpenGLContext *context = QOpenGLContext::currentContext();
-            QQuickCanvas::CreateTextureOptions opt = QQuickCanvas::TextureOwnsGLTexture;
+            QQuickCanvas::CreateTextureOptions opt = 0;
             if (useTextureAlpha()) {
                 opt |= QQuickCanvas::TextureHasAlphaChannel;
             }