mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Join text clip paths before application in Skia painter
Each item in clip_paths represents a glyph run, and applying them as a clip in intersection mode one by one results in an empty clip. Instead, now all clip paths are joined and applied as a clip together. This change fixes rendering of "background-clip: text" when an element has more than one glyph run. Fixed ref-test: Tests/LibWeb/Ref/css-background-clip-text.html
This commit is contained in:
parent
dbc2f7ed48
commit
66c88b432f
Notes:
sideshowbarker
2024-07-18 02:44:55 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/66c88b432fe Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/678
1 changed files with 11 additions and 9 deletions
|
@ -359,15 +359,17 @@ static SkSamplingOptions to_skia_sampling_options(Gfx::ScalingMode scaling_mode)
|
|||
}
|
||||
}
|
||||
|
||||
#define APPLY_PATH_CLIP_IF_NEEDED \
|
||||
ScopeGuard restore_path_clip { [&] { \
|
||||
if (command.clip_paths.size() > 0) \
|
||||
surface().canvas().restore(); \
|
||||
} }; \
|
||||
if (command.clip_paths.size() > 0) { \
|
||||
surface().canvas().save(); \
|
||||
for (auto const& path : command.clip_paths) \
|
||||
surface().canvas().clipPath(to_skia_path(path), true); \
|
||||
#define APPLY_PATH_CLIP_IF_NEEDED \
|
||||
ScopeGuard restore_path_clip { [&] { \
|
||||
if (command.clip_paths.size() > 0) \
|
||||
surface().canvas().restore(); \
|
||||
} }; \
|
||||
if (command.clip_paths.size() > 0) { \
|
||||
surface().canvas().save(); \
|
||||
SkPath clip_path; \
|
||||
for (auto const& path : command.clip_paths) \
|
||||
clip_path.addPath(to_skia_path(path)); \
|
||||
surface().canvas().clipPath(clip_path, true); \
|
||||
}
|
||||
|
||||
DisplayListPlayerSkia::SkiaSurface& DisplayListPlayerSkia::surface() const
|
||||
|
|
Loading…
Reference in a new issue