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>
master
Kai Uwe Broulik 2 years ago committed by Kai Uwe Broulik
parent 1e3a81249c
commit 4c6010b078

@ -363,10 +363,10 @@ void SceneOpenGL::createRenderNode(Item *item, RenderContext *context)
});
}
} else if (auto surfaceItem = qobject_cast<SurfaceItem *>(item)) {
WindowQuadList quads = clipQuads(item, context);
if (!quads.isEmpty()) {
SurfacePixmap *pixmap = surfaceItem->pixmap();
if (pixmap) {
SurfacePixmap *pixmap = surfaceItem->pixmap();
if (pixmap) {
WindowQuadList quads = clipQuads(item, context);
if (!quads.isEmpty()) {
// Don't bother with blending if the entire surface is opaque
bool hasAlpha = pixmap->hasAlphaChannel() && !surfaceItem->shape().subtracted(surfaceItem->opaque()).isEmpty();
context->renderNodes.append(RenderNode{

Loading…
Cancel
Save