scenes/opengl: Check whether pixmap is valid before generating quads
Quad generation needs a valid surface pixmap. This did not surface before as the pixmap was only accessed when looping the region which typically was empty without a pixmap. Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
This commit is contained in:
parent
1e3a81249c
commit
4c6010b078
1 changed files with 4 additions and 4 deletions
|
@ -363,10 +363,10 @@ void SceneOpenGL::createRenderNode(Item *item, RenderContext *context)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (auto surfaceItem = qobject_cast<SurfaceItem *>(item)) {
|
} else if (auto surfaceItem = qobject_cast<SurfaceItem *>(item)) {
|
||||||
WindowQuadList quads = clipQuads(item, context);
|
|
||||||
if (!quads.isEmpty()) {
|
|
||||||
SurfacePixmap *pixmap = surfaceItem->pixmap();
|
SurfacePixmap *pixmap = surfaceItem->pixmap();
|
||||||
if (pixmap) {
|
if (pixmap) {
|
||||||
|
WindowQuadList quads = clipQuads(item, context);
|
||||||
|
if (!quads.isEmpty()) {
|
||||||
// Don't bother with blending if the entire surface is opaque
|
// Don't bother with blending if the entire surface is opaque
|
||||||
bool hasAlpha = pixmap->hasAlphaChannel() && !surfaceItem->shape().subtracted(surfaceItem->opaque()).isEmpty();
|
bool hasAlpha = pixmap->hasAlphaChannel() && !surfaceItem->shape().subtracted(surfaceItem->opaque()).isEmpty();
|
||||||
context->renderNodes.append(RenderNode{
|
context->renderNodes.append(RenderNode{
|
||||||
|
|
Loading…
Reference in a new issue