From dadfd7aec8e729651f64ab0423b202e440b97225 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 1 Nov 2022 16:39:45 +0000 Subject: [PATCH] Drop isCompletelyOpaque optimisation With the floating geometry this becomes a non-trivial check, at some point this will cost more than the gl blend itself. --- src/scenes/opengl/scene_opengl.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index 8141c8e2b4..00d5abbfa3 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -386,24 +386,12 @@ void SceneOpenGL::createRenderNode(Item *item, RenderContext *context) SurfacePixmap *pixmap = surfaceItem->pixmap(); if (pixmap) { if (!geometry.isEmpty()) { - bool hasAlpha = pixmap->hasAlphaChannel(); - bool isCompletelyOpaque = true; - // Don't bother with blending if the entire surface is opaque - const QVector shape = surfaceItem->shape(); - for (const QRectF &shapePart : shape) { - if (!item->opaque().contains(shapePart.toRect())) { - isCompletelyOpaque = false; - break; - } - } - hasAlpha &= !isCompletelyOpaque; - context->renderNodes.append(RenderNode{ .texture = bindSurfaceTexture(surfaceItem), .geometry = geometry, .transformMatrix = context->transformStack.top(), .opacity = context->opacityStack.top(), - .hasAlpha = hasAlpha, + .hasAlpha = pixmap->hasAlphaChannel(), .coordinateType = NormalizedCoordinates, .scale = scale, });