Title: [104352] trunk
Revision
104352
Author
[email protected]
Date
2012-01-06 15:39:07 -0800 (Fri, 06 Jan 2012)

Log Message

Avoid falling into tiled layers more often when the device scale factor is > 1
<rdar://problem/10588725>

Source/WebCore:

Reviewed by John Sullivan.

Stop taking the device scale factor into account when deciding to make
tiled layers.

Test: compositing/tiled-layers-hidpi.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::requiresTiledLayer):

LayoutTests:

Reviewed by John Sullivan.

Tests that a large layer with a device scale factor of 2 is not tiled.

* compositing/tiled-layers-hidpi-expected.txt: Added.
* compositing/tiled-layers-hidpi.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (104351 => 104352)


--- trunk/LayoutTests/ChangeLog	2012-01-06 23:34:53 UTC (rev 104351)
+++ trunk/LayoutTests/ChangeLog	2012-01-06 23:39:07 UTC (rev 104352)
@@ -1,3 +1,15 @@
+2012-01-05  Simon Fraser  <[email protected]>
+
+        Avoid falling into tiled layers more often when the device scale factor is > 1
+        <rdar://problem/10588725>
+
+        Reviewed by John Sullivan.
+        
+        Tests that a large layer with a device scale factor of 2 is not tiled.
+
+        * compositing/tiled-layers-hidpi-expected.txt: Added.
+        * compositing/tiled-layers-hidpi.html: Added.
+
 2012-01-06  Adam Barth  <[email protected]>
 
         Rebaseline editing/input/caret-at-the-edge-of-input.html.

Added: trunk/LayoutTests/compositing/tiled-layers-hidpi-expected.txt (0 => 104352)


--- trunk/LayoutTests/compositing/tiled-layers-hidpi-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/tiled-layers-hidpi-expected.txt	2012-01-06 23:39:07 UTC (rev 104352)
@@ -0,0 +1,16 @@
+(GraphicsLayer
+  (bounds 1808.00 585.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 1808.00 585.00)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 1800.00 10.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
Property changes on: trunk/LayoutTests/compositing/tiled-layers-hidpi-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/tiled-layers-hidpi.html (0 => 104352)


--- trunk/LayoutTests/compositing/tiled-layers-hidpi.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/tiled-layers-hidpi.html	2012-01-06 23:39:07 UTC (rev 104352)
@@ -0,0 +1,31 @@
+<html>
+	<style>
+		#composited {
+			width: 1800px;
+			height: 10px;
+			-webkit-transform: translateZ(0);
+			background-color: blue;
+		}
+	</style>
+    <script>
+        function startTest() {
+            if (window.layoutTestController) {
+                layoutTestController.waitUntilDone();
+                layoutTestController.dumpAsText();
+                layoutTestController.setBackingScaleFactor(2, finishTest);
+            }
+        }
+        
+        function finishTest() {
+            setTimeout(function() {
+				document.getElementById('layer-tree').innerText = window.layoutTestController.layerTreeAsText();
+				layoutTestController.notifyDone();
+			}, 0);
+        }
+        </script>
+    </head>
+    <body _onload_="startTest();">
+        <div id="composited"></div>
+<pre id="layer-tree">Layer tree goes here in DRT</pre>
+    </body>
+</html>
Property changes on: trunk/LayoutTests/compositing/tiled-layers-hidpi.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (104351 => 104352)


--- trunk/Source/WebCore/ChangeLog	2012-01-06 23:34:53 UTC (rev 104351)
+++ trunk/Source/WebCore/ChangeLog	2012-01-06 23:39:07 UTC (rev 104352)
@@ -1,3 +1,18 @@
+2012-01-05  Simon Fraser  <[email protected]>
+
+        Avoid falling into tiled layers more often when the device scale factor is > 1
+        <rdar://problem/10588725>
+
+        Reviewed by John Sullivan.
+        
+        Stop taking the device scale factor into account when deciding to make
+        tiled layers.
+
+        Test: compositing/tiled-layers-hidpi.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::requiresTiledLayer):
+
 2012-01-06  Ryosuke Niwa  <[email protected]>
 
         Touch a bunch of files in an attempt to fix Mac release builds.

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (104351 => 104352)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2012-01-06 23:34:53 UTC (rev 104351)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2012-01-06 23:39:07 UTC (rev 104352)
@@ -2181,10 +2181,8 @@
     if (!m_drawsContent || !m_allowTiledLayer || m_layer->layerType() == PlatformCALayer::LayerTypeTileCacheLayer)
         return false;
 
-    float contentsScale = pageScaleFactor * deviceScaleFactor();
-
     // FIXME: catch zero-size height or width here (or earlier)?
-    return m_size.width() * contentsScale > cMaxPixelDimension || m_size.height() * contentsScale > cMaxPixelDimension;
+    return m_size.width() * pageScaleFactor > cMaxPixelDimension || m_size.height() * pageScaleFactor > cMaxPixelDimension;
 }
 
 void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float pageScaleFactor, const FloatPoint& positionRelativeToBase)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to