From 2bd43e3603d383a6d0377c29f577daaa49cef4df Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 2 Nov 2024 15:34:40 +0100 Subject: [PATCH] LibWeb: Remove save() call in DisplayListPlayerSkia::add_mask() This save() call did not have matching restore(). For mask application it's display list builder responsibility to emit save() and restore() so mask is applied only to relevant portion. Progress on https://www.jetbrains.com/ --- Tests/LibWeb/Ref/background-clip-text.html | 11 +++++++++++ .../Ref/reference/background-clip-text-ref.html | 7 +++++++ .../LibWeb/Painting/DisplayListPlayerSkia.cpp | 1 - 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Tests/LibWeb/Ref/background-clip-text.html create mode 100644 Tests/LibWeb/Ref/reference/background-clip-text-ref.html diff --git a/Tests/LibWeb/Ref/background-clip-text.html b/Tests/LibWeb/Ref/background-clip-text.html new file mode 100644 index 00000000000..7ea7a4d9145 --- /dev/null +++ b/Tests/LibWeb/Ref/background-clip-text.html @@ -0,0 +1,11 @@ + + +
hello
x diff --git a/Tests/LibWeb/Ref/reference/background-clip-text-ref.html b/Tests/LibWeb/Ref/reference/background-clip-text-ref.html new file mode 100644 index 00000000000..8ed5afe5949 --- /dev/null +++ b/Tests/LibWeb/Ref/reference/background-clip-text-ref.html @@ -0,0 +1,7 @@ + +
hello
x diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index 24647001120..33f2bd616b3 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -1233,7 +1233,6 @@ void DisplayListPlayerSkia::add_mask(AddMask const& command) mask_matrix.setTranslate(rect.x(), rect.y()); auto image = mask_surface->makeImageSnapshot(); auto shader = image->makeShader(SkSamplingOptions(), mask_matrix); - surface().canvas().save(); surface().canvas().clipShader(shader); }