Title: [188271] trunk
Revision
188271
Author
[email protected]
Date
2015-08-11 12:27:12 -0700 (Tue, 11 Aug 2015)

Log Message

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

Patch by Said Abou-Hallawa <[email protected]> on 2015-08-11
Reviewed by Dean Jackson.

Source/WebCore:

The result ImageBuffer of any FilterEffect is already scaled up for 2x
display. The FEMorphology needs to fix its painting data dimension and
radius by multiplying them by the filter scale factor.

Test: fast/hidpi/filters-morphology.html

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

LayoutTests:

Ensure we take the filter scale factor into consideration when applying
the FEMorphology.

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

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (188270 => 188271)


--- trunk/LayoutTests/ChangeLog	2015-08-11 19:15:43 UTC (rev 188270)
+++ trunk/LayoutTests/ChangeLog	2015-08-11 19:27:12 UTC (rev 188271)
@@ -1,3 +1,16 @@
+2015-08-11  Said Abou-Hallawa  <[email protected]>
+
+        feMorphology is not rendered correctly on Retina display
+        https://bugs.webkit.org/show_bug.cgi?id=147589
+
+        Reviewed by Dean Jackson.
+
+        Ensure we take the filter scale factor into consideration when applying
+        the FEMorphology.
+
+        * fast/hidpi/filters-morphology-expected.html: Added.
+        * fast/hidpi/filters-morphology.html: Added.
+
 2015-08-11  Yusuke Suzuki  <[email protected]>
 
         Numeric setter on prototype doesn't get called.

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


--- trunk/LayoutTests/fast/hidpi/filters-morphology-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/filters-morphology-expected.html	2015-08-11 19:27:12 UTC (rev 188271)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <script src=""
+  <style>
+    div {
+      width: 120px;
+      height: 120px;
+      margin: 10px 10px 10px 10px;
+      border: none;
+      display: inline-block;
+      background-color: lime;
+    }
+  </style>
+</head>
+<body>
+  <div></div>
+</body>
+</html>

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


--- trunk/LayoutTests/fast/hidpi/filters-morphology.html	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/filters-morphology.html	2015-08-11 19:27:12 UTC (rev 188271)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <script src=""
+  <style>
+    div {
+      width: 100px;
+      height: 100px;
+      margin: 20px 20px 20px 16px;
+      border: none;
+      display: inline-block;
+      background-color: lime;
+    }
+  </style>
+</head>
+<body>
+  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="0" height="0">
+    <defs>
+	  <filter id="filter" primitiveUnits="userSpaceOnUse">
+		<feMorphology in="SourceGraphic" operator="dilate" radius="10"/>
+	  </filter>
+	</defs>
+  </svg>
+  <div style="-webkit-filter: url('#filter'); filter: url('#filter');"></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (188270 => 188271)


--- trunk/Source/WebCore/ChangeLog	2015-08-11 19:15:43 UTC (rev 188270)
+++ trunk/Source/WebCore/ChangeLog	2015-08-11 19:27:12 UTC (rev 188271)
@@ -1,3 +1,19 @@
+2015-08-11  Said Abou-Hallawa  <[email protected]>
+
+        feMorphology is not rendered correctly on Retina display
+        https://bugs.webkit.org/show_bug.cgi?id=147589
+
+        Reviewed by Dean Jackson.
+
+        The result ImageBuffer of any FilterEffect is already scaled up for 2x
+        display. The FEMorphology needs to fix its painting data dimension and
+        radius by multiplying them by the filter scale factor.
+ 
+        Test: fast/hidpi/filters-morphology.html
+
+        * platform/graphics/filters/FEMorphology.cpp:
+        (WebCore::FEMorphology::platformApplySoftware):
+
 2015-08-11  Myles C. Maxfield  <[email protected]>
 
         [iOS] Arabic letter Yeh is drawn in LastResort

Modified: trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp (188270 => 188271)


--- trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp	2015-08-11 19:15:43 UTC (rev 188270)
+++ trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp	2015-08-11 19:27:12 UTC (rev 188271)
@@ -238,10 +238,10 @@
     PaintingData paintingData;
     paintingData.srcPixelArray = srcPixelArray.get();
     paintingData.dstPixelArray = dstPixelArray;
-    paintingData.width = effectDrawingRect.width();
-    paintingData.height = effectDrawingRect.height();
-    paintingData.radiusX = radiusX;
-    paintingData.radiusY = radiusY;
+    paintingData.width = ceilf(effectDrawingRect.width() * filter.filterScale());
+    paintingData.height = ceilf(effectDrawingRect.height() * filter.filterScale());
+    paintingData.radiusX = ceilf(radiusX * filter.filterScale());
+    paintingData.radiusY = ceilf(radiusY * filter.filterScale());
 
     platformApply(&paintingData);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to