Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 9d5ce39e6de489a2292584160d51ef49789d3f00 https://github.com/WebKit/WebKit/commit/9d5ce39e6de489a2292584160d51ef49789d3f00 Author: Simon Fraser <simon.fra...@apple.com> Date: 2024-09-03 (Tue, 03 Sep 2024)
Changed paths: A LayoutTests/fast/backgrounds/background-clip-border-area-alpha-expected.html A LayoutTests/fast/backgrounds/background-clip-border-area-alpha.html A LayoutTests/fast/backgrounds/background-clip-text-alpha-expected.html A LayoutTests/fast/backgrounds/background-clip-text-alpha.html M Source/WebCore/rendering/BackgroundPainter.cpp M Source/WebCore/rendering/RenderBoxModelObject.cpp M Source/WebCore/rendering/RenderBoxModelObject.h Log Message: ----------- Render background-clip effects with a transparency layer instead of a buffer https://bugs.webkit.org/show_bug.cgi?id=279070 rdar://135205084 Reviewed by Matt Woodrow. `BackgroundPainter::paintFillLayer()` currently uses an ImageBuffer and `CompositeOperator::DestinationIn` to render the masking-based background-clip modes (`text` and `border-area`). Making an ImageBuffer is expensive; it's more efficient to do this with transparency layers. Factor common code into a `setupMaskingBackgroundClip()` lambda, which takes a callback for drawing the masking content. Previously the code used a transparency layer and an ImageBuffer; now we use two transparency layers. First we start a transparency layer, and render the masking content. Then we set the composited operator to SourceIn, and start a second layer which will contain the pixels to be masked. Two TransparencyLayerScopes ensure we close the layers in the correct order. Added a test to ensure we didn't break rendering with alpha. * LayoutTests/fast/backgrounds/background-clip-border-area-alpha-expected.html: Added. * LayoutTests/fast/backgrounds/background-clip-border-area-alpha.html: Added. * LayoutTests/fast/backgrounds/background-clip-text-alpha-expected.html: Added. * LayoutTests/fast/backgrounds/background-clip-text-alpha.html: Added. * Source/WebCore/rendering/BackgroundPainter.cpp: (WebCore::BackgroundPainter::paintFillLayer const): * Source/WebCore/rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintMaskForTextFillBox): This can just take a GraphicsContxet now. * Source/WebCore/rendering/RenderBoxModelObject.h: Canonical link: https://commits.webkit.org/283135@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes