Title: [236415] trunk
Revision
236415
Author
simon.fra...@apple.com
Date
2018-09-24 11:20:22 -0700 (Mon, 24 Sep 2018)

Log Message

CSS reference filter with feDisplacementMap shows buffer corruption on Retina displays
https://bugs.webkit.org/show_bug.cgi?id=188486
<rdar://problem/43189750>

Reviewed by Dean Jackson.
Source/WebCore:

The paintSize needs to be scaled by filterScale on Retina displays.

Test: css3/filters/hidpi-feDisplacementMap.html

* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDisplacementMap.h:

LayoutTests:

* css3/filters/hidpi-feDisplacementMap-expected.html: Added.
* css3/filters/hidpi-feDisplacementMap.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (236414 => 236415)


--- trunk/LayoutTests/ChangeLog	2018-09-24 18:19:09 UTC (rev 236414)
+++ trunk/LayoutTests/ChangeLog	2018-09-24 18:20:22 UTC (rev 236415)
@@ -1,5 +1,16 @@
 2018-09-24  Simon Fraser  <simon.fra...@apple.com>
 
+        CSS reference filter with feDisplacementMap shows buffer corruption on Retina displays
+        https://bugs.webkit.org/show_bug.cgi?id=188486
+        <rdar://problem/43189750>
+
+        Reviewed by Dean Jackson.
+
+        * css3/filters/hidpi-feDisplacementMap-expected.html: Added.
+        * css3/filters/hidpi-feDisplacementMap.html: Added.
+
+2018-09-24  Simon Fraser  <simon.fra...@apple.com>
+
         Garbled rendering of image when applied feConvolveMatrix to it, on Retina display
         https://bugs.webkit.org/show_bug.cgi?id=189748
         <rdar://problem/44621494>

Added: trunk/LayoutTests/css3/filters/hidpi-feDisplacementMap-expected.html (0 => 236415)


--- trunk/LayoutTests/css3/filters/hidpi-feDisplacementMap-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/hidpi-feDisplacementMap-expected.html	2018-09-24 18:20:22 UTC (rev 236415)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+    .box {
+        margin: 10px;
+        width: 200px;
+        height: 200px;
+        background-color: green;
+    }
+    .obscurer {
+        position: absolute;
+        background-color: gray;
+    }
+    </style>
+</head>
+<body>
+    <div class="box"></div>
+    <div class="obscurer" style="height: 20px; width: 210px; left: 18px; top: 200px;"></div>
+    <div class="obscurer" style="height: 210px; width: 20px; left: 210px; top: 10px;"></div>
+</body>
+</html>

Added: trunk/LayoutTests/css3/filters/hidpi-feDisplacementMap.html (0 => 236415)


--- trunk/LayoutTests/css3/filters/hidpi-feDisplacementMap.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/hidpi-feDisplacementMap.html	2018-09-24 18:20:22 UTC (rev 236415)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+    .box {
+        margin: 10px;
+        width: 200px;
+        height: 200px;
+        background-color: green;
+        filter: url(#filter);
+    }
+    .obscurer {
+        position: absolute;
+        background-color: gray;
+    }
+    </style>
+</head>
+<body>
+    <svg style="display:none">
+        <filter id="filter">
+            <feFlood flood-color="black" flood-opacity="1"/>
+            <feDisplacementmap in="SourceGraphic" scale="10"/>
+        </filter>
+    </svg>
+    <div class="box"></div>
+    <div class="obscurer" style="height: 20px; width: 210px; left: 18px; top: 200px;"></div>
+    <div class="obscurer" style="height: 210px; width: 20px; left: 210px; top: 10px;"></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (236414 => 236415)


--- trunk/Source/WebCore/ChangeLog	2018-09-24 18:19:09 UTC (rev 236414)
+++ trunk/Source/WebCore/ChangeLog	2018-09-24 18:20:22 UTC (rev 236415)
@@ -1,5 +1,21 @@
 2018-09-24  Simon Fraser  <simon.fra...@apple.com>
 
+        CSS reference filter with feDisplacementMap shows buffer corruption on Retina displays
+        https://bugs.webkit.org/show_bug.cgi?id=188486
+        <rdar://problem/43189750>
+
+        Reviewed by Dean Jackson.
+        
+        The paintSize needs to be scaled by filterScale on Retina displays.
+
+        Test: css3/filters/hidpi-feDisplacementMap.html
+
+        * platform/graphics/filters/FEDisplacementMap.cpp:
+        (WebCore::FEDisplacementMap::platformApplySoftware):
+        * platform/graphics/filters/FEDisplacementMap.h:
+
+2018-09-24  Simon Fraser  <simon.fra...@apple.com>
+
         ReferenceFilterOperation doesn't need to store the FilterEffect
         https://bugs.webkit.org/show_bug.cgi?id=189904
 

Modified: trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp (236414 => 236415)


--- trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp	2018-09-24 18:19:09 UTC (rev 236414)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp	2018-09-24 18:20:22 UTC (rev 236415)
@@ -112,6 +112,8 @@
 
     Filter& filter = this->filter();
     IntSize paintSize = absolutePaintRect().size();
+    paintSize.scale(filter.filterScale());
+
     FloatSize scale = filter.scaledByFilterResolution({ m_scale, m_scale });
     float scaleForColorX = scale.width() / 255.0;
     float scaleForColorY = scale.height() / 255.0;

Modified: trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h (236414 => 236415)


--- trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h	2018-09-24 18:19:09 UTC (rev 236414)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h	2018-09-24 18:20:22 UTC (rev 236415)
@@ -37,7 +37,7 @@
 
 class FEDisplacementMap : public FilterEffect {
 public:
-    static Ref<FEDisplacementMap> create(Filter&, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+    static Ref<FEDisplacementMap> create(Filter&, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale);
 
     ChannelSelectorType xChannelSelector() const { return m_xChannelSelector; }
     bool setXChannelSelector(const ChannelSelectorType);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to