WebKit Bugzilla
Attachment 371838 Details for
Bug 198701
: [cairo][SVG] Putting multiple path elements in clippath causes rendering artifacts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198701-20190611200451.patch (text/plain), 11.95 KB, created by
Fujii Hironori
on 2019-06-11 04:04:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-06-11 04:04:52 PDT
Size:
11.95 KB
patch
obsolete
>Subversion Revision: 246095 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d6f7a003498a64ad8fe2546a67254218032faef1..da66fc41b33059e2c9ce84be98b85cd169cca5c4 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-06-11 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [cairo][SVG] Putting multiple path elements in clippath causes rendering artifacts >+ https://bugs.webkit.org/show_bug.cgi?id=198701 >+ >+ PlatformContextCairo::pushImageMask blits wrong position of the >+ surface to the background of masking objects. And, I don't know >+ the reason why this blitting is needed. Removed the blitting. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tests: svg/clip-path/clip-opacity.html >+ svg/clip-path/svg-in-html.html >+ >+ * platform/graphics/cairo/PlatformContextCairo.cpp: >+ (WebCore::PlatformContextCairo::pushImageMask): Don't blit the >+ surface to the background. >+ > 2019-06-04 Michael Catanzaro <mcatanzaro@igalia.com> > > Fix miscellaneous build warnings >diff --git a/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp b/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp >index eeeae86ef83a76f2014c4023a353c6f2ff1570df..7f242fdbecb39526c0e3c1c5a602046a786560b4 100644 >--- a/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp >@@ -110,24 +110,7 @@ void PlatformContextCairo::pushImageMask(cairo_surface_t* surface, const FloatRe > // Cairo doesn't support the notion of an image clip, so we push a group here > // and then paint it to the surface with an image mask (which is an immediate > // operation) during restorePlatformState. >- >- // We want to allow the clipped elements to composite with the surface as it >- // is now, but they are isolated in another group. To make this work, we're >- // going to blit the current surface contents onto the new group once we push it. >- cairo_surface_t* currentTarget = cairo_get_target(m_cr.get()); >- cairo_surface_flush(currentTarget); >- >- // Pushing a new group ensures that only things painted after this point are clipped. > cairo_push_group(m_cr.get()); >- cairo_set_operator(m_cr.get(), CAIRO_OPERATOR_SOURCE); >- >- // To avoid the limit of Pixman backend, we need to reduce the size of pattern matrix >- // See https://bugs.webkit.org/show_bug.cgi?id=154283 >- cairo_set_source_surface(m_cr.get(), currentTarget, rect.x(), rect.y()); >- cairo_translate(m_cr.get(), rect.x(), rect.y()); >- cairo_rectangle(m_cr.get(), 0, 0, rect.width(), rect.height()); >- cairo_fill(m_cr.get()); >- cairo_translate(m_cr.get(), -rect.x(), -rect.y()); > } > > } // namespace WebCore >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index aa617c5893b5f9ba31d23b7f550b796c2073c87e..0c7092d368f6127545389b703f9df5283d4720db 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2019-06-11 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [cairo][SVG] Putting multiple path elements in clippath causes rendering artifacts >+ https://bugs.webkit.org/show_bug.cgi?id=198701 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/gtk/TestExpectations: >+ * platform/wpe/TestExpectations: >+ Unskipped svg/gradients/spreadMethodDiagonal3.svg and svg/gradients/spreadMethodDiagonal4.svg. >+ >+ * svg/clip-path/clip-opacity-expected.html: Added. >+ * svg/clip-path/clip-opacity.html: Added. >+ * svg/clip-path/svg-in-html-expected.html: Added. >+ * svg/clip-path/svg-in-html.html: Added. >+ > 2019-06-04 Youenn Fablet <youenn@apple.com> > > Layout test landed flaky in 245873 [ Release ] http/wpt/service-workers/service-worker-networkprocess-crash.html is a flaky failure >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index abb0469bbad62a9259760d8524daf943c82bb367..3331c850f84783e259959db1b47d668dccda01d5 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -3631,8 +3631,6 @@ webkit.org/b/189737 editing/pasteboard/4930986-2-paste-as-quotation.html [ Failu > webkit.org/b/189737 editing/pasteboard/4930986-3-paste-as-quotation.html [ Failure ] > > webkit.org/b/189739 svg/gradients/spreadMethodClose2.svg [ ImageOnlyFailure ] >-webkit.org/b/189739 svg/gradients/spreadMethodDiagonal3.svg [ ImageOnlyFailure ] >-webkit.org/b/189739 svg/gradients/spreadMethodDiagonal4.svg [ ImageOnlyFailure ] > > webkit.org/b/189994 fast/files/xhr-response-blob.html [ Failure ] > >diff --git a/LayoutTests/platform/wpe/TestExpectations b/LayoutTests/platform/wpe/TestExpectations >index db1e3f0008ae955c37db606b4bf5bb280ee4a1bd..5799a849e27d6338012d5d3036f7c913f4ac19cf 100644 >--- a/LayoutTests/platform/wpe/TestExpectations >+++ b/LayoutTests/platform/wpe/TestExpectations >@@ -1306,8 +1306,6 @@ webkit.org/b/160137 svg/custom/non-scaling-stroke.svg [ Failure Pass ] > webkit.org/b/160137 svg/custom/non-scaling-stroke-update.svg [ ImageOnlyFailure Pass ] > webkit.org/b/112228 svg/custom/resources-css-scaled.html [ ImageOnlyFailure ] > webkit.org/b/189739 svg/gradients/spreadMethodClose2.svg [ ImageOnlyFailure ] >-webkit.org/b/189739 svg/gradients/spreadMethodDiagonal3.svg [ ImageOnlyFailure ] >-webkit.org/b/189739 svg/gradients/spreadMethodDiagonal4.svg [ ImageOnlyFailure ] > webkit.org/b/115440 svg/stroke/animated-non-scaling-stroke.html [ ImageOnlyFailure Pass ] > webkit.org/b/88230 svg/stroke/non-scaling-stroke-pattern.svg [ ImageOnlyFailure Pass ] > webkit.org/b/137096 svg/text/alt-glyph-for-surrogate-pair.svg [ ImageOnlyFailure ] >diff --git a/LayoutTests/svg/clip-path/clip-opacity-expected.html b/LayoutTests/svg/clip-path/clip-opacity-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..714e8aa69474c32c7df707ff1fec4fc1a11e1dfb >--- /dev/null >+++ b/LayoutTests/svg/clip-path/clip-opacity-expected.html >@@ -0,0 +1,23 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<svg xmlns="http://www.w3.org/2000/svg" width="350"> >+<g> >+ <circle cx="50" cy="50" r="50" fill="green"/> >+ <circle cx="100" cy="50" r="50" fill="red" /> >+ <g> >+ <circle cx="50" cy="100" r="50" fill="green" opacity=".5" /> >+ <circle cx="100" cy="100" r="50" fill="red" opacity=".5" /> >+ </g> >+</g> >+<g transform="translate(200,0)"> >+ <circle cx="50" cy="50" r="50" fill="green"/> >+ <circle cx="100" cy="50" r="50" fill="red" /> >+ <g> >+ <circle cx="50" cy="100" r="50" fill="green" opacity=".5" /> >+ <circle cx="100" cy="100" r="50" fill="red" opacity=".5" /> >+ </g> >+</g> >+</svg> >+</body> >+</html> >diff --git a/LayoutTests/svg/clip-path/clip-opacity.html b/LayoutTests/svg/clip-path/clip-opacity.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6f860fd1f45882debc8ec94b58d17b2e0128f1cd >--- /dev/null >+++ b/LayoutTests/svg/clip-path/clip-opacity.html >@@ -0,0 +1,32 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<svg xmlns="http://www.w3.org/2000/svg" width="350"> >+<defs> >+<clipPath id="clip1"> >+ <rect width="200" height="200"/> >+</clipPath> >+<clipPath id="clip2"> >+ <rect width="200" height="200"/> >+ <rect width="200" height="200"/> >+</clipPath> >+</defs> >+<g> >+ <circle cx="50" cy="50" r="50" fill="green"/> >+ <circle cx="100" cy="50" r="50" fill="red" /> >+ <g clip-path="url(#clip1)"> >+ <circle cx="50" cy="100" r="50" fill="green" opacity=".5" /> >+ <circle cx="100" cy="100" r="50" fill="red" opacity=".5" /> >+ </g> >+</g> >+<g transform="translate(200,0)"> >+ <circle cx="50" cy="50" r="50" fill="green"/> >+ <circle cx="100" cy="50" r="50" fill="red" /> >+ <g clip-path="url(#clip2)"> >+ <circle cx="50" cy="100" r="50" fill="green" opacity=".5" /> >+ <circle cx="100" cy="100" r="50" fill="red" opacity=".5" /> >+ </g> >+</g> >+</svg> >+</body> >+</html> >diff --git a/LayoutTests/svg/clip-path/svg-in-html-expected.html b/LayoutTests/svg/clip-path/svg-in-html-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..26e990cd63911b31f47c8faa1f8a1e0aec7b4fa6 >--- /dev/null >+++ b/LayoutTests/svg/clip-path/svg-in-html-expected.html >@@ -0,0 +1,40 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+body { >+ border: 2em blue solid; >+} >+svg { >+ background: pink; >+} >+</style> >+</head> >+<body> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <g> >+ <circle cx="1" cy="1" r="1" fill="green"></circle> >+ <circle cx="7" cy="1" r="1" fill="green"></circle> >+ </g> >+</svg> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <g> >+ <circle cx="1" cy="7" r="1" fill="green"></circle> >+ <circle cx="7" cy="7" r="1" fill="green"></circle> >+ </g> >+</svg> >+<br> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <g> >+ <circle cx="1" cy="1" r="1" fill="green"></circle> >+ <circle cx="7" cy="1" r="1" fill="green"></circle> >+ </g> >+</svg> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <g> >+ <circle cx="1" cy="7" r="1" fill="green"></circle> >+ <circle cx="7" cy="7" r="1" fill="green"></circle> >+ </g> >+</svg> >+</body> >+</html> >diff --git a/LayoutTests/svg/clip-path/svg-in-html.html b/LayoutTests/svg/clip-path/svg-in-html.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d689b448f99ce4c0ebf2b0ec63dc4a2710cd2b40 >--- /dev/null >+++ b/LayoutTests/svg/clip-path/svg-in-html.html >@@ -0,0 +1,62 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+body { >+ border: 2em blue solid; >+} >+svg { >+ background: pink; >+} >+</style> >+</head> >+<body> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <clippath id="clip1"> >+ <rect width="8" height="4"></rect> >+ </clippath> >+ <g clip-path="url(#clip1)"> >+ <circle cx="1" cy="1" r="1" fill="green"></circle> >+ <circle cx="7" cy="1" r="1" fill="green"></circle> >+ <circle cx="1" cy="7" r="1" fill="green"></circle> >+ <circle cx="7" cy="7" r="1" fill="green"></circle> >+ </g> >+</svg> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <clippath id="clip2"> >+ <rect y="4" width="8" height="4"></rect> >+ </clippath> >+ <g clip-path="url(#clip2)"> >+ <circle cx="1" cy="1" r="1" fill="green"></circle> >+ <circle cx="7" cy="1" r="1" fill="green"></circle> >+ <circle cx="1" cy="7" r="1" fill="green"></circle> >+ <circle cx="7" cy="7" r="1" fill="green"></circle> >+ </g> >+</svg> >+<br> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <clippath id="clip3"> >+ <rect width="8" height="2"></rect> >+ <rect y="4" width="8" height="2"></rect> >+ </clippath> >+ <g clip-path="url(#clip3)"> >+ <circle cx="1" cy="1" r="1" fill="green"></circle> >+ <circle cx="7" cy="1" r="1" fill="green"></circle> >+ <circle cx="1" cy="7" r="1" fill="green"></circle> >+ <circle cx="7" cy="7" r="1" fill="green"></circle> >+ </g> >+</svg> >+<svg width="200px" height="200px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> >+ <clippath id="clip4"> >+ <rect y="2" width="8" height="2"></rect> >+ <rect y="6" width="8" height="2"></rect> >+ </clippath> >+ <g clip-path="url(#clip4)"> >+ <circle cx="1" cy="1" r="1" fill="green"></circle> >+ <circle cx="7" cy="1" r="1" fill="green"></circle> >+ <circle cx="1" cy="7" r="1" fill="green"></circle> >+ <circle cx="7" cy="7" r="1" fill="green"></circle> >+ </g> >+</svg> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198701
:
371716
|
371717
|
371718
|
371720
|
371722
|
371821
|
371822
|
371824
|
371837
| 371838 |
371917