Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Vogtinator:kwinperf
kwin5
0001-scenes-opengl-Avoid-blending-for-entirely-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-scenes-opengl-Avoid-blending-for-entirely-opaque-Sur.patch of Package kwin5
From 21c7298274bb40cd05f7319d7d5ec30fc24cc325 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fabian@ritter-vogt.de> Date: Fri, 6 Aug 2021 11:01:18 +0200 Subject: [PATCH] scenes/opengl: Avoid blending for entirely opaque SurfaceItems Blending is quite expensive especially with software rendering. In the case of Firefox on Wayland, it uses a ARGB8888 buffer but marks the entire surface as opaque, so the alpha channel can be ignored. CCBUG: 440386 --- src/plugins/scenes/opengl/scene_opengl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/scenes/opengl/scene_opengl.cpp b/src/plugins/scenes/opengl/scene_opengl.cpp index 0b457a0b9..19e810434 100644 --- a/src/plugins/scenes/opengl/scene_opengl.cpp +++ b/src/plugins/scenes/opengl/scene_opengl.cpp @@ -983,12 +983,14 @@ void OpenGLWindow::createRenderNode(Item *item, RenderContext *context) if (!quads.isEmpty()) { SurfacePixmap *pixmap = surfaceItem->pixmap(); if (pixmap) { + // 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{ .texture = bindSurfaceTexture(surfaceItem), .quads = quads, .transformMatrix = transformation(item, context), .opacity = context->paintData.opacity(), - .hasAlpha = pixmap->hasAlphaChannel(), + .hasAlpha = hasAlpha, .coordinateType = UnnormalizedCoordinates, }); } -- 2.32.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor