Commit 4c6010b0 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik Committed by Kai Uwe Broulik
Browse files

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: default avatarVictoria Fischer <victoria.fischer@mbition.io>
parent 1e3a8124
Pipeline #209902 passed with stage
in 14 minutes and 51 seconds
......@@ -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{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment