Skip to content

Commit

Permalink
Give texture ownership to scenegraph in WaylandSurfaceItem
Browse files Browse the repository at this point in the history
Change-Id: Ia40d73e11d54b96e27e65224d8fab6d17c5997b9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
  • Loading branch information
Andy Nichols committed May 18, 2012
1 parent 98d6e19 commit c1ee015
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compositor/compositor_api/waylandsurfaceitem.cpp
Expand Up @@ -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());
}
Expand Down

0 comments on commit c1ee015

Please sign in to comment.