Title: [246979] releases/WebKitGTK/webkit-2.24
Revision
246979
Author
carlo...@webkit.org
Date
2019-07-01 02:21:40 -0700 (Mon, 01 Jul 2019)

Log Message

Merge r246309 - [cairo][SVG] Putting multiple path elements in clippath causes rendering artifacts
https://bugs.webkit.org/show_bug.cgi?id=198701

Source/WebCore:

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 Carlos Garcia Campos.

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.

LayoutTests:

Reviewed by Carlos Garcia Campos.

* 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.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog (246978 => 246979)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog	2019-07-01 08:53:43 UTC (rev 246978)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog	2019-07-01 09:21:40 UTC (rev 246979)
@@ -1,3 +1,19 @@
+2019-06-11  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [cairo][SVG] Putting multiple path elements in clippath causes rendering artifacts
+        https://bugs.webkit.org/show_bug.cgi?id=198701
+
+        Reviewed by Carlos Garcia Campos.
+
+        * 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-18  Zan Dobersek  <zdober...@igalia.com>
 
         [WebGL] Extensions3DOpenGLES::bindVertexArrayOES() should allow zero array object

Modified: releases/WebKitGTK/webkit-2.24/LayoutTests/platform/gtk/TestExpectations (246978 => 246979)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/platform/gtk/TestExpectations	2019-07-01 08:53:43 UTC (rev 246978)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/platform/gtk/TestExpectations	2019-07-01 09:21:40 UTC (rev 246979)
@@ -3572,8 +3572,6 @@
 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 ]
 

Modified: releases/WebKitGTK/webkit-2.24/LayoutTests/platform/wpe/TestExpectations (246978 => 246979)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/platform/wpe/TestExpectations	2019-07-01 08:53:43 UTC (rev 246978)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/platform/wpe/TestExpectations	2019-07-01 09:21:40 UTC (rev 246979)
@@ -1319,8 +1319,6 @@
 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 ]

Added: releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/clip-opacity-expected.html (0 => 246979)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/clip-opacity-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/clip-opacity-expected.html	2019-07-01 09:21:40 UTC (rev 246979)
@@ -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>

Added: releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/clip-opacity.html (0 => 246979)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/clip-opacity.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/clip-opacity.html	2019-07-01 09:21:40 UTC (rev 246979)
@@ -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>

Added: releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/svg-in-html-expected.html (0 => 246979)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/svg-in-html-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/svg-in-html-expected.html	2019-07-01 09:21:40 UTC (rev 246979)
@@ -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>

Added: releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/svg-in-html.html (0 => 246979)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/svg-in-html.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/svg/clip-path/svg-in-html.html	2019-07-01 09:21:40 UTC (rev 246979)
@@ -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>

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (246978 => 246979)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-07-01 08:53:43 UTC (rev 246978)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-07-01 09:21:40 UTC (rev 246979)
@@ -1,3 +1,21 @@
+2019-06-11  Fujii Hironori  <hironori.fu...@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 Carlos Garcia Campos.
+
+        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-18  Zan Dobersek  <zdober...@igalia.com>
 
         [WebGL] Extensions3DOpenGLES::bindVertexArrayOES() should allow zero array object

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp (246978 => 246979)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp	2019-07-01 08:53:43 UTC (rev 246978)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp	2019-07-01 09:21:40 UTC (rev 246979)
@@ -110,24 +110,7 @@
     // 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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to