Title: [166926] trunk
Revision
166926
Author
za...@apple.com
Date
2014-04-08 07:52:33 -0700 (Tue, 08 Apr 2014)

Log Message

Subpixel rendering: Paint the filter effect result image on device pixel position.
https://bugs.webkit.org/show_bug.cgi?id=131255

Reviewed by Simon Fraser.

This patch moves filter effect images from integral to device pixel position. However,
result images are still integral based.

Source/WebCore:

Test: css3/filters/hidpi-filter-is-on-subpixel-position.html

* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRendererHelper::applyFilterEffect):

LayoutTests:

* css3/filters/hidpi-filter-is-on-subpixel-position-expected.html: Added.
* css3/filters/hidpi-filter-is-on-subpixel-position.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (166925 => 166926)


--- trunk/LayoutTests/ChangeLog	2014-04-08 14:50:38 UTC (rev 166925)
+++ trunk/LayoutTests/ChangeLog	2014-04-08 14:52:33 UTC (rev 166926)
@@ -1,5 +1,18 @@
 2014-04-08  Zalan Bujtas  <za...@apple.com>
 
+        Subpixel rendering: Paint the filter effect result image on device pixel position.
+        https://bugs.webkit.org/show_bug.cgi?id=131255
+
+        Reviewed by Simon Fraser.
+
+        This patch moves filter effect images from integral to device pixel position. However,
+        result images are still integral based.
+
+        * css3/filters/hidpi-filter-is-on-subpixel-position-expected.html: Added.
+        * css3/filters/hidpi-filter-is-on-subpixel-position.html: Added.
+
+2014-04-08  Zalan Bujtas  <za...@apple.com>
+
         Subpixel rendering: Make border images device pixel aware.
         https://bugs.webkit.org/show_bug.cgi?id=131209
 

Added: trunk/LayoutTests/css3/filters/hidpi-filter-is-on-subpixel-position-expected.html (0 => 166926)


--- trunk/LayoutTests/css3/filters/hidpi-filter-is-on-subpixel-position-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/hidpi-filter-is-on-subpixel-position-expected.html	2014-04-08 14:52:33 UTC (rev 166926)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that filter effects don't push content to different position when RenderLayer is present.</title>
+<style>
+  p {
+    position: fixed;
+    display: -webkit-flex;
+    -webkit-align-items: center;
+  }
+  
+  div {
+    width: 10px;
+    height: 10px;
+    background: black;
+    border: 2px solid white;
+    -webkit-filter: drop-shadow(black 0 0px 0px);
+ }
+</style>
+</head>
+<body>
+<span id="container"></span>
+<script>
+  var container = document.getElementById("container");
+  w = 15; h = 15;
+  for (i = 0; i < 10; ++i) {
+    for (j = 0; j < 10; ++j) {
+      var e = document.createElement("p");
+      e.style.top = ((w + 1) * i) + "px";
+      e.style.left = ((w + 1) * j) + "px";
+      e.style.height = h + "px";
+      e.appendChild(document.createElement("div"));
+      container.appendChild(e);
+      w+=1;
+      h+=1;
+    }
+  }
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/css3/filters/hidpi-filter-is-on-subpixel-position.html (0 => 166926)


--- trunk/LayoutTests/css3/filters/hidpi-filter-is-on-subpixel-position.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/hidpi-filter-is-on-subpixel-position.html	2014-04-08 14:52:33 UTC (rev 166926)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that filter effects don't push content to different position when RenderLayer is present.</title>
+<style>
+  p {
+    position: fixed;
+    display: -webkit-flex;
+    -webkit-align-items: center;
+  }
+  
+  div {
+    width: 10px;
+    height: 10px;
+    background: black;
+    border: 2px solid white;
+    -webkit-filter: drop-shadow(black 0 0px 0px);
+    -webkit-transform: translateX(0);
+ }
+</style>
+</head>
+<body>
+<span id="container"></span>
+<script>
+  var container = document.getElementById("container");
+  w = 15; h = 15;
+  for (i = 0; i < 10; ++i) {
+    for (j = 0; j < 10; ++j) {
+      var e = document.createElement("p");
+      e.style.top = ((w + 1) * i) + "px";
+      e.style.left = ((w + 1) * j) + "px";
+      e.style.height = h + "px";
+      e.appendChild(document.createElement("div"));
+      container.appendChild(e);
+      w+=1;
+      h+=1;
+    }
+  }
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (166925 => 166926)


--- trunk/Source/WebCore/ChangeLog	2014-04-08 14:50:38 UTC (rev 166925)
+++ trunk/Source/WebCore/ChangeLog	2014-04-08 14:52:33 UTC (rev 166926)
@@ -1,5 +1,20 @@
 2014-04-08  Zalan Bujtas  <za...@apple.com>
 
+        Subpixel rendering: Paint the filter effect result image on device pixel position.
+        https://bugs.webkit.org/show_bug.cgi?id=131255
+
+        Reviewed by Simon Fraser.
+
+        This patch moves filter effect images from integral to device pixel position. However,
+        result images are still integral based.
+
+        Test: css3/filters/hidpi-filter-is-on-subpixel-position.html
+
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRendererHelper::applyFilterEffect):
+
+2014-04-08  Zalan Bujtas  <za...@apple.com>
+
         Subpixel rendering: Make border images device pixel aware.
         https://bugs.webkit.org/show_bug.cgi?id=131209
 

Modified: trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp (166925 => 166926)


--- trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp	2014-04-08 14:50:38 UTC (rev 166925)
+++ trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp	2014-04-08 14:52:33 UTC (rev 166926)
@@ -434,9 +434,10 @@
     // Get the filtered output and draw it in place.
     LayoutRect destRect = filter->outputRect();
     destRect.move(m_paintOffset.x(), m_paintOffset.y());
-    
-    destinationContext->drawImageBuffer(filter->output(), m_renderLayer->renderer().style().colorSpace(), pixelSnappedIntRect(destRect), CompositeSourceOver);
-    
+
+    destinationContext->drawImageBuffer(filter->output(), m_renderLayer->renderer().style().colorSpace(),
+        pixelSnappedForPainting(destRect, m_renderLayer->renderer().document().deviceScaleFactor()), CompositeSourceOver);
+
     filter->clearIntermediateResults();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to