-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=269714 Reviewed by Carlos Garcia Campos. Move the drop shadow filter creation into a helper method, and refactor all callers of GraphicsContextSkia::createFillPaint() to manually create and apply a drop shadow. The helper method returns nullptr if there is no shadow, or if the shadow is effectively hidden, following Cairo's optimization. Add a selector enum for inset and outset shadows, used by the helper method aforementioned, and handle the case for both inset and outset shadows. The outset shadow case is just what was there before. The inset shadow case is a combination of two image filters. One creates a black shadow with the drop shadow parameters, and uses it as a mask to apply a color blend. The color blend is what uses the actual drop shadow color, and blends it with the SrcIn mode, which effectively inverts the drop shadow based on the pixel opacity. The only place in code that interprets GraphicsContext.dropShadow() as an inset shadow is inside GraphicsContext::fillRectWithRoundedHole(), which is implemented in this commit using SkCanvas::drawDRRect(). * Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp: (WebCore::FontCascade::drawGlyphs): * Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContextSkia::drawNativeImageInternal): (WebCore::GraphicsContextSkia::fillPath): (WebCore::GraphicsContextSkia::createDropShadowFilter const): (WebCore::GraphicsContextSkia::createFillPaint const): (WebCore::GraphicsContextSkia::fillRect): (WebCore::GraphicsContextSkia::fillRoundedRectImpl): (WebCore::GraphicsContextSkia::fillRectWithRoundedHole): * Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h: Canonical link: https://commits.webkit.org/275093@main
- Loading branch information
1 parent
8b4eddd
commit bcffee0
Showing
3 changed files
with
73 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters