Title: [231485] trunk
Revision
231485
Author
[email protected]
Date
2018-05-08 09:20:06 -0700 (Tue, 08 May 2018)

Log Message

feTurbulence is not rendered correctly on Retina display
https://bugs.webkit.org/show_bug.cgi?id=183798

Patch by Said Abou-Hallawa <[email protected]> on 2018-05-08
Reviewed by Simon Fraser.

Source/WebCore:

On 2x display the feTurbulence filter creates a scaled ImageBuffer but
processes only the unscaled size. This is a remaining work of r168577 and
is very similar to what was done for the feMorphology filter in r188271.

Test: fast/hidpi/filters-turbulence.html

* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
(WebCore::FETurbulence::platformApplySoftware):

LayoutTests:

* fast/hidpi/filters-turbulence-expected.html: Added.
* fast/hidpi/filters-turbulence.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (231484 => 231485)


--- trunk/LayoutTests/ChangeLog	2018-05-08 16:15:19 UTC (rev 231484)
+++ trunk/LayoutTests/ChangeLog	2018-05-08 16:20:06 UTC (rev 231485)
@@ -1,3 +1,13 @@
+2018-05-08  Said Abou-Hallawa  <[email protected]>
+
+        feTurbulence is not rendered correctly on Retina display
+        https://bugs.webkit.org/show_bug.cgi?id=183798
+
+        Reviewed by Simon Fraser.
+
+        * fast/hidpi/filters-turbulence-expected.html: Added.
+        * fast/hidpi/filters-turbulence.html: Added.
+
 2018-05-07  Chris Dumez  <[email protected]>
 
         Unreviewed, add frame name in form-iframe-target-before-load-crash.html

Added: trunk/LayoutTests/fast/hidpi/filters-turbulence-expected.html (0 => 231485)


--- trunk/LayoutTests/fast/hidpi/filters-turbulence-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/filters-turbulence-expected.html	2018-05-08 16:20:06 UTC (rev 231485)
@@ -0,0 +1,12 @@
+<script src=""
+<style>
+    div {
+        width: 200px;
+        height: 200px;
+        display: inline-block;
+        background-color: rgba(127, 127, 127, 0.5);
+    }
+</style>
+<body>
+    <div></div>
+</body>

Added: trunk/LayoutTests/fast/hidpi/filters-turbulence.html (0 => 231485)


--- trunk/LayoutTests/fast/hidpi/filters-turbulence.html	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/filters-turbulence.html	2018-05-08 16:20:06 UTC (rev 231485)
@@ -0,0 +1,17 @@
+<script src=""
+<style>
+    div {
+        width: 200px;
+        height: 200px;
+        display: inline-block;
+        filter: url('#filter');
+    }
+</style>
+<body>
+    <div></div>
+    <svg>
+        <filter id="filter" x="0" y="0" width="100%" height="100%"> 
+            <feTurbulence type="fractalNoise" numOctaves="0" />
+        </filter>
+  </svg>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (231484 => 231485)


--- trunk/Source/WebCore/ChangeLog	2018-05-08 16:15:19 UTC (rev 231484)
+++ trunk/Source/WebCore/ChangeLog	2018-05-08 16:20:06 UTC (rev 231485)
@@ -1,3 +1,20 @@
+2018-05-08  Said Abou-Hallawa  <[email protected]>
+
+        feTurbulence is not rendered correctly on Retina display
+        https://bugs.webkit.org/show_bug.cgi?id=183798
+
+        Reviewed by Simon Fraser.
+
+        On 2x display the feTurbulence filter creates a scaled ImageBuffer but
+        processes only the unscaled size. This is a remaining work of r168577 and
+        is very similar to what was done for the feMorphology filter in r188271.
+
+        Test: fast/hidpi/filters-turbulence.html
+
+        * platform/graphics/filters/FETurbulence.cpp:
+        (WebCore::FETurbulence::fillRegion const):
+        (WebCore::FETurbulence::platformApplySoftware):
+
 2018-05-07  Zalan Bujtas  <[email protected]>
 
         [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation

Modified: trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp (231484 => 231485)


--- trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp	2018-05-08 16:15:19 UTC (rev 231484)
+++ trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp	2018-05-08 16:20:06 UTC (rev 231485)
@@ -370,6 +370,7 @@
     ASSERT(endY > startY);
 
     IntRect filterRegion = absolutePaintRect();
+    filterRegion.scale(filter().filterScale());
     FloatPoint point(0, filterRegion.y() + startY);
     int indexOfPixelChannel = startY * (filterRegion.width() << 2);
     AffineTransform inverseTransfrom = filter().absoluteTransform().inverse().value_or(AffineTransform());
@@ -398,7 +399,10 @@
     if (!pixelArray)
         return;
 
-    if (absolutePaintRect().isEmpty()) {
+    IntSize resultSize(absolutePaintRect().size());
+    resultSize.scale(filter().filterScale());
+
+    if (resultSize.isEmpty()) {
         pixelArray->zeroFill();
         return;
     }
@@ -412,11 +416,11 @@
     PaintingData paintingData(m_seed, tileSize, baseFrequencyX, baseFrequencyY);
     initPaint(paintingData);
 
-    auto area = absolutePaintRect().area();
+    auto area = resultSize.area();
     if (area.hasOverflowed())
         return;
 
-    int height = absolutePaintRect().height();
+    int height = resultSize.height();
 
     unsigned maxNumThreads = height / 8;
     unsigned optimalThreadNumber = std::min<unsigned>(area.unsafeGet() / s_minimalRectDimension, maxNumThreads);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to