-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Skia] Fix corner cases involving drawing shadows #28168
[Skia] Fix corner cases involving drawing shadows #28168
Conversation
EWS run on previous version of this PR (hash 6b77a21) |
To be continued once #27513 lands |
6b77a21
to
bc704b8
Compare
EWS run on previous version of this PR (hash bc704b8) |
bc704b8
to
74e35e6
Compare
EWS run on previous version of this PR (hash 74e35e6) |
74e35e6
to
ebfd534
Compare
EWS run on previous version of this PR (hash ebfd534) |
The change in current form makes skia implementation to behave as close to CG/cairo as possible, although full alignment is not possible as CG and cairo work differently in some cases due to likely problems with spec, see whatwg/html#10338 |
Can you rebase this? For some reason the base commit is not building in some bots. |
ebfd534
to
29df349
Compare
EWS run on previous version of this PR (hash 29df349) |
29df349
to
a8662c0
Compare
EWS run on previous version of this PR (hash a8662c0) |
a8662c0
to
910e7da
Compare
EWS run on previous version of this PR (hash 910e7da) |
EWS run on previous version of this PR (hash 69bfa2f) |
cae4d4e
to
18d9fdd
Compare
EWS run on previous version of this PR (hash cae4d4e) |
18d9fdd
to
1fb2acf
Compare
EWS run on previous version of this PR (hash 18d9fdd) |
1fb2acf
to
01d8c19
Compare
EWS run on previous version of this PR (hash 01d8c19) |
EWS run on previous version of this PR (hash 1fb2acf) |
01d8c19
to
1817523
Compare
EWS run on previous version of this PR (hash 1817523) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch looks reasonable to me, I left only a very small nit.
FWIW, good idea reusing the cross-port entry points for setting the temporary composition layer; and thanks for taking the time to write the commit log notesβthey do help to understand what's the intention ππΌ
1817523
to
165007e
Compare
EWS run on current version of this PR (hash 165007e) |
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 <[email protected]> Canonical link: https://commits.webkit.org/280008@main
165007e
to
120f5b1
Compare
Committed 280008@main (120f5b1): https://commits.webkit.org/280008@main Reviewed commits have been landed. Closing PR #28168 and removing active labels. |
120f5b1
165007e