Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cbeeab739cd01915a42b80fc8c37891407f440fc
https://github.com/WebKit/WebKit/commit/cbeeab739cd01915a42b80fc8c37891407f440fc
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M Source/WebCore/platform/graphics/skia/SkiaBackingStore.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp
M Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferExternalOES.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferRGB.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTileBuffer.cpp
Log Message:
-----------
[WPE][Skia] Compositor keeps GL_BLEND enabled for opaque layers
https://bugs.webkit.org/show_bug.cgi?id=318962
Reviewed by Carlos Garcia Campos.
The Skia compositor draws every layer with the default blend mode
(SkBlendMode::kSrcOver). With that mode Skia always keeps GL_BLEND
turned on, even for fully opaque layers that do not need blending.
Skia can turn blending off, but only on ARM GPUs and only when the
input is opaque -- neither is true here, so we always pay for blending
we do not use.
TextureMapper does better: it turns GL_BLEND on only when a layer is
actually non-opaque (opacity < 1 or a non-opaque texture). Do the same
on the Skia side: When a layer is opaque, drawn at full opacity, and
uses the default blend mode, draw it with SkBlendMode::kSrc instead.
Skia then turns GL_BLEND off, which lowers GPU bandwidth on tiled GPUs
with no changes to Skia itself. Anti-aliased edges still look correct
because Skia handles them separately.
For that to hold, the SkImages/surfaces Skia composites must also carry
the correct alpha type: an opaque source must be kOpaque_SkAlphaType,
not kPremul_SkAlphaType, otherwise Skia does not know it can drop the
blend. Several compositor paths hardcoded kPremul even though the
opaqueness was already known -- the tile buffers know it through their
Flags, and the RGB/ExternalOES layer buffers know it through the
ShouldBlend TextureMapper flag their producers set from the real source
alpha. Fix those cases as well.
* Source/WebCore/platform/graphics/skia/SkiaBackingStore.cpp:
(WebCore::SkiaBackingStore::Tile::image const):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintContents):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp:
(WebCore::CoordinatedPlatformLayer::flushCompositingStateOnSkiaTarget):
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferExternalOES.cpp:
(WebCore::CoordinatedPlatformLayerBufferExternalOES::skiaImage):
*
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferRGB.cpp:
(WebCore::CoordinatedPlatformLayerBufferRGB::skiaImage):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTileBuffer.cpp:
(WebCore::CoordinatedUnacceleratedTileBuffer::canvas):
(WebCore::CoordinatedAcceleratedTileBuffer::create):
Canonical link: https://commits.webkit.org/316881@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications