[webkit-changes] [WebKit/WebKit] 120f5b: [Skia] Fix corner cases involving drawing shadows
Pawel Lampe
noreply at github.com
Fri Jun 14 03:59:05 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 120f5b1d4f902ccd085929982aa6d9cf6bb8a4fb
https://github.com/WebKit/WebKit/commit/120f5b1d4f902ccd085929982aa6d9cf6bb8a4fb
Author: Pawel Lampe <plampe at igalia.com>
Date: 2024-06-14 (Fri, 14 Jun 2024)
Changed paths:
A LayoutTests/fast/canvas/canvas-composite-fill-with-shadow-and-fitting-perfectly-expected.txt
A LayoutTests/fast/canvas/canvas-composite-fill-with-shadow-and-fitting-perfectly.html
A LayoutTests/fast/canvas/canvas-composite-fill-with-shadow-expected.txt
A LayoutTests/fast/canvas/canvas-composite-fill-with-shadow.html
M LayoutTests/platform/glib/TestExpectations
M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
M Source/WebCore/platform/graphics/BifurcatedGraphicsContext.cpp
M Source/WebCore/platform/graphics/BifurcatedGraphicsContext.h
M Source/WebCore/platform/graphics/GraphicsContext.cpp
M Source/WebCore/platform/graphics/GraphicsContext.h
M Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
M Source/WebCore/platform/graphics/cg/GraphicsContextCG.h
M Source/WebCore/platform/graphics/displaylists/DisplayListItem.h
M Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
M Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h
M Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp
M Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h
M Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp
M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h
M Source/WebCore/rendering/GlyphDisplayListCache.cpp
M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp
M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h
M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in
M Source/WebKit/Scripts/webkit/messages.py
M Source/WebKit/Shared/DisplayListArgumentCoders.serialization.in
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h
Log Message:
-----------
[Skia] Fix corner cases involving drawing shadows
https://bugs.webkit.org/show_bug.cgi?id=273239
Reviewed by Adrian Perez de Castro.
So far - in the ports that use skia - shadows were being drawn in the same draw call as the original drawing operation.
This was possible as shadows were basically created using a filter that can be added to every drawing operation in skia.
The problem with such apporach is, however, that it does not work properly with some composite operations.
Some composite operations such as e.g. 'destination-atop' are expected to alter drawing in a way that shadow
is being drawn in front of it's origin.
To achieve that with skia:
- drawing of shadow must be done as a separate draw call.
- drawing of both shadow and shadow origin must be done on separate transparency layers so that shadow, shadow origin,
and the original content present before draw operation will overlap correctly.
* LayoutTests/fast/canvas/canvas-composite-fill-with-shadow-and-fitting-perfectly-expected.txt: Added.
* LayoutTests/fast/canvas/canvas-composite-fill-with-shadow-and-fitting-perfectly.html: Added.
* LayoutTests/fast/canvas/canvas-composite-fill-with-shadow-expected.txt: Added.
* LayoutTests/fast/canvas/canvas-composite-fill-with-shadow.html: Added.
* LayoutTests/platform/glib/TestExpectations:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
(WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
(WebCore::CanvasRenderingContext2DBase::fillRect):
* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.cpp:
(WebCore::BifurcatedGraphicsContext::beginTransparencyLayer):
* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.h:
* Source/WebCore/platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::beginTransparencyLayer):
* Source/WebCore/platform/graphics/GraphicsContext.h:
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::beginTransparencyLayer):
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItem.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::BeginTransparencyLayerWithCompositeMode::apply const):
(WebCore::DisplayList::BeginTransparencyLayerWithCompositeMode::dump const):
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::BeginTransparencyLayerWithCompositeMode::BeginTransparencyLayerWithCompositeMode):
(WebCore::DisplayList::BeginTransparencyLayerWithCompositeMode::compositeMode const):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::beginTransparencyLayer):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::recordBeginTransparencyLayer):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h:
* Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::beginTransparencyLayer):
* Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp:
(WebCore::FontCascade::drawGlyphs):
* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::drawRect):
(WebCore::GraphicsContextSkia::drawNativeImageInternal):
(WebCore::GraphicsContextSkia::drawSkiaPath):
(WebCore::GraphicsContextSkia::fillPath):
(WebCore::GraphicsContextSkia::strokePath):
(WebCore::GraphicsContextSkia::createDropShadowFilterIfNeeded const):
(WebCore::GraphicsContextSkia::drawOutsetShadow):
(WebCore::GraphicsContextSkia::drawSkiaRect):
(WebCore::GraphicsContextSkia::fillRect):
(WebCore::GraphicsContextSkia::beginTransparencyLayer):
(WebCore::GraphicsContextSkia::endTransparencyLayer):
(WebCore::GraphicsContextSkia::strokeRect):
(WebCore::GraphicsContextSkia::fillRoundedRectImpl):
(WebCore::GraphicsContextSkia::drawSkiaText):
* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h:
* Source/WebCore/rendering/GlyphDisplayListCache.cpp:
(WebCore::GlyphDisplayListCache::canShareDisplayList):
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
(WebKit::RemoteDisplayListRecorder::beginTransparencyLayerWithCompositeMode):
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h:
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in:
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/DisplayListArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::recordBeginTransparencyLayer):
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
Co-authored-by: Carlos Garcia Campos <cgarcia at igalia.com>
Canonical link: https://commits.webkit.org/280008@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list