[webkit-changes] [WebKit/WebKit] 45759e: Creating a transparency layer to draw a single ima...
mattwoodrow
noreply at github.com
Mon Apr 17 13:44:15 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 45759e33816f429a82e7b53b122abb0c579a45a8
https://github.com/WebKit/WebKit/commit/45759e33816f429a82e7b53b122abb0c579a45a8
Author: Matt Woodrow <mattwoodrow at apple.com>
Date: 2023-04-17 (Mon, 17 Apr 2023)
Changed paths:
M Source/WebCore/rendering/RenderLayer.cpp
M Source/WebCore/rendering/RenderLayer.h
M Source/WebCore/rendering/RenderLayerBacking.cpp
Log Message:
-----------
Creating a transparency layer to draw a single image with opacity can be slow.
https://bugs.webkit.org/show_bug.cgi?id=24438
<rdar://103334931>
Reviewed by Dean Jackson.
This detects the case where we want to create a transparency layer, but the only contents that
will be drawn is a single bitmap image. We can instead just set the alpha on the GraphicsContext
and save the transparency layer (as well as the save/restore pair and the clip).
This could be extended in the future to detect more cases where we will only do a single draw call
within the transparency layer.
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::calculateClipRects const):
* Source/WebCore/rendering/RenderLayer.h:
(WebCore::RenderLayer::paintsWithTransparency const):
(WebCore::RenderLayer::canPaintTransparencyWithSetOpacity const):
(WebCore::RenderLayer::hasNonOpacityTransparency const):
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isBitmapOnly const):
Canonical link: https://commits.webkit.org/263035@main
More information about the webkit-changes
mailing list