diff options
author | Andy Nichols <andy.nichols@nokia.com> | 2012-04-25 16:48:04 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@nokia.com> | 2012-05-18 13:48:12 +0200 |
commit | c1ee015bab06e82bccbb723b522c185a8188cab5 (patch) | |
tree | 9a9e8c1bd2dc5e79066e02997bf1e6d0a58ef316 /src/compositor | |
parent | 98d6e198f896875d3cdb06c357d5bfdfd71ca394 (diff) |
Give texture ownership to scenegraph in WaylandSurfaceItem
Change-Id: Ia40d73e11d54b96e27e65224d8fab6d17c5997b9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/compositor')
-rw-r--r-- | src/compositor/compositor_api/waylandsurfaceitem.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compositor/compositor_api/waylandsurfaceitem.cpp b/src/compositor/compositor_api/waylandsurfaceitem.cpp index 4948cc366..6316bcabd 100644 --- a/src/compositor/compositor_api/waylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/waylandsurfaceitem.cpp @@ -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()); } |