Title: [132537] trunk
Revision
132537
Author
simon.fra...@apple.com
Date
2012-10-25 14:42:12 -0700 (Thu, 25 Oct 2012)

Log Message

Report the tile coverage rect in layer coords, and add some tests for tiled backing and zooming
https://bugs.webkit.org/show_bug.cgi?id=100416

Reviewed by Beth Dakin.

Source/WebCore:

The tileCoverageRect is computed in "tile" coordinates, which don't match
the visibleRect coordinates. It's more useful when testing to see the
tile coverage relative to the view bounds, so unapply the scale whem
reporting tile coverage in tests.

Tests: platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html
       platform/mac/tiled-drawing/tiled-drawing-zoom.html

* platform/graphics/ca/mac/TileCache.h:
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::tileCoverageRect):

LayoutTests:

New tests that exercise the page tiled backing under zooming.

* platform/mac/tiled-drawing/tiled-drawing-zoom-expected.txt: Added.
* platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt: Added.
* platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html: Added.
* platform/mac/tiled-drawing/tiled-drawing-zoom.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (132536 => 132537)


--- trunk/LayoutTests/ChangeLog	2012-10-25 21:36:39 UTC (rev 132536)
+++ trunk/LayoutTests/ChangeLog	2012-10-25 21:42:12 UTC (rev 132537)
@@ -1,3 +1,17 @@
+2012-10-25  Simon Fraser  <simon.fra...@apple.com>
+
+        Report the tile coverage rect in layer coords, and add some tests for tiled backing and zooming
+        https://bugs.webkit.org/show_bug.cgi?id=100416
+
+        Reviewed by Beth Dakin.
+
+        New tests that exercise the page tiled backing under zooming.
+
+        * platform/mac/tiled-drawing/tiled-drawing-zoom-expected.txt: Added.
+        * platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt: Added.
+        * platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html: Added.
+        * platform/mac/tiled-drawing/tiled-drawing-zoom.html: Added.
+
 2012-10-25  Mariusz Grzegorczyk  <marius...@samsung.com>
 
         [EFL] Add baselines for non problematic tests in editing subcategories: deleting, inserting, selection and style.

Added: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-expected.txt (0 => 132537)


--- trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-expected.txt	2012-10-25 21:42:12 UTC (rev 132537)
@@ -0,0 +1,22 @@
+(GraphicsLayer
+  (bounds 1805.00 1345.00)
+  (visible rect 2.00, 0.00 785.00 x 585.00)
+  (children 1
+    (GraphicsLayer
+      (anchor 0.00 0.00)
+      (bounds 785.00 585.00)
+      (drawsContent 1)
+      (backgroundColor #FFFFFF)
+      (transform [2.30 0.00 0.00 0.00] [0.00 2.30 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
+      (visible rect 0.87, 0.00 341.30 x 254.35)
+      (tile cache coverage 0, 0 667 x 584)
+      (tile size 512 x 512)
+      (children 1
+        (GraphicsLayer
+          (visible rect 0.00, 0.00 0.00 x 0.00)
+        )
+      )
+    )
+  )
+)
+
Property changes on: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt (0 => 132537)


--- trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt	2012-10-25 21:42:12 UTC (rev 132537)
@@ -0,0 +1,22 @@
+(GraphicsLayer
+  (bounds 2778.00 4648.00)
+  (visible rect 1840.00, 2300.00 785.00 x 585.00)
+  (children 1
+    (GraphicsLayer
+      (anchor 0.00 0.00)
+      (bounds 1208.00 2021.00)
+      (drawsContent 1)
+      (backgroundColor #FFFFFF)
+      (transform [2.30 0.00 0.00 0.00] [0.00 2.30 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
+      (visible rect 800.00, 1000.00 341.30 x 254.35)
+      (tile cache coverage 445, 667 762 x 890)
+      (tile size 512 x 512)
+      (children 1
+        (GraphicsLayer
+          (visible rect 0.00, 0.00 0.00 x 0.00)
+        )
+      )
+    )
+  )
+)
+
Property changes on: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html (0 => 132537)


--- trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html	2012-10-25 21:42:12 UTC (rev 132537)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        body {
+            width: 1200px;
+            height: 2000px;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function doTest()
+        {
+            if (window.eventSender)
+                eventSender.scalePageBy(2.3, 2.3);
+
+            window.scrollTo(800, 1000);
+
+            if (window.internals) {
+                document.getElementById('layers').innerText = internals.layerTreeAsText(document,
+                    internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
+            }
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+<pre id="layers">Layer tree goes here</p>
+</body>
+</html>
Property changes on: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom.html (0 => 132537)


--- trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom.html	2012-10-25 21:42:12 UTC (rev 132537)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function doTest()
+        {
+            if (window.eventSender)
+                eventSender.scalePageBy(2.3, 2.3);
+
+            if (window.internals) {
+                document.getElementById('layers').innerText = internals.layerTreeAsText(document,
+                    internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
+            }
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+<pre id="layers">Layer tree goes here</p>
+</body>
+</html>
Property changes on: trunk/LayoutTests/platform/mac/tiled-drawing/tiled-drawing-zoom.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (132536 => 132537)


--- trunk/Source/WebCore/ChangeLog	2012-10-25 21:36:39 UTC (rev 132536)
+++ trunk/Source/WebCore/ChangeLog	2012-10-25 21:42:12 UTC (rev 132537)
@@ -1,3 +1,22 @@
+2012-10-25  Simon Fraser  <simon.fra...@apple.com>
+
+        Report the tile coverage rect in layer coords, and add some tests for tiled backing and zooming
+        https://bugs.webkit.org/show_bug.cgi?id=100416
+
+        Reviewed by Beth Dakin.
+
+        The tileCoverageRect is computed in "tile" coordinates, which don't match
+        the visibleRect coordinates. It's more useful when testing to see the
+        tile coverage relative to the view bounds, so unapply the scale whem
+        reporting tile coverage in tests.
+
+        Tests: platform/mac/tiled-drawing/tiled-drawing-zoom-scrolled.html
+               platform/mac/tiled-drawing/tiled-drawing-zoom.html
+
+        * platform/graphics/ca/mac/TileCache.h:
+        * platform/graphics/ca/mac/TileCache.mm:
+        (WebCore::TileCache::tileCoverageRect):
+
 2012-10-25  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r132269.

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h (132536 => 132537)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2012-10-25 21:36:39 UTC (rev 132536)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2012-10-25 21:42:12 UTC (rev 132537)
@@ -90,8 +90,7 @@
     virtual IntSize tileSize() const OVERRIDE { return m_tileSize; }
     virtual void setScrollingPerformanceLoggingEnabled(bool flag) OVERRIDE { m_scrollingPerformanceLoggingEnabled = flag; }
     virtual bool scrollingPerformanceLoggingEnabled() const OVERRIDE { return m_scrollingPerformanceLoggingEnabled; }
-
-    virtual IntRect tileCoverageRect() const { return m_tileCoverageRect; }
+    virtual IntRect tileCoverageRect() const;
     
     IntRect bounds() const;
 

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (132536 => 132537)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-10-25 21:36:39 UTC (rev 132536)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-10-25 21:42:12 UTC (rev 132537)
@@ -460,6 +460,14 @@
     platformLayer->owner()->platformCALayerDidCreateTiles(dirtyRects);
 }
 
+// Return the rect in layer coords, not tile coords.
+IntRect TileCache::tileCoverageRect() const
+{
+    IntRect coverageRectInLayerCoords(m_tileCoverageRect);
+    coverageRectInLayerCoords.scale(1 / m_scale);
+    return coverageRectInLayerCoords;
+}
+
 WebTileLayer* TileCache::tileLayerAtIndex(const TileIndex& index) const
 {
     return m_tiles.get(index).get();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to