Title: [109112] trunk/Source/WebCore
Revision
109112
Author
kenn...@webkit.org
Date
2012-02-28 08:52:35 -0800 (Tue, 28 Feb 2012)

Log Message

Improve the visual of the tiling
https://bugs.webkit.org/show_bug.cgi?id=79648

Reviewed by Noam Rosenthal.

When we cover the view with tiles[1], we do so from the center
and out, in bigger and bigger cicles by finding the current minimum
covered distance.

This looks like painting a rect, then a cross, then a rect, ...
and can be noticed when a page blocks during tiling.

We can do this better by only covering with tiles in rects at a time.

The original code was done so that it gave preference to tiles in
vertical direction due to that being the most common scrolling
direction. This is not needed anymore as we are now using the
trajectory vector when panning, which always gives preference for
creating tiles in the panned direction.

[1] It should be noted that we always cover the visibleRect in one go,
    and that we here are talking about covering the coverRect beyond
    the visibleRect

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::tileDistance):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109111 => 109112)


--- trunk/Source/WebCore/ChangeLog	2012-02-28 16:50:41 UTC (rev 109111)
+++ trunk/Source/WebCore/ChangeLog	2012-02-28 16:52:35 UTC (rev 109112)
@@ -1,3 +1,32 @@
+2012-02-28  Kenneth Rohde Christiansen  <kenn...@webkit.org>
+
+        Improve the visual of the tiling
+        https://bugs.webkit.org/show_bug.cgi?id=79648
+
+        Reviewed by Noam Rosenthal.
+
+        When we cover the view with tiles[1], we do so from the center
+        and out, in bigger and bigger cicles by finding the current minimum
+        covered distance.
+
+        This looks like painting a rect, then a cross, then a rect, ...
+        and can be noticed when a page blocks during tiling.
+
+        We can do this better by only covering with tiles in rects at a time.
+
+        The original code was done so that it gave preference to tiles in
+        vertical direction due to that being the most common scrolling
+        direction. This is not needed anymore as we are now using the
+        trajectory vector when panning, which always gives preference for
+        creating tiles in the panned direction.
+
+        [1] It should be noted that we always cover the visibleRect in one go,
+            and that we here are talking about covering the coverRect beyond
+            the visibleRect
+
+        * platform/graphics/TiledBackingStore.cpp:
+        (WebCore::TiledBackingStore::tileDistance):
+
 2012-02-28  Yury Semikhatsky  <yu...@chromium.org>
 
         Web Inspector: preserve memory counters size after frontend reopening

Modified: trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp (109111 => 109112)


--- trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp	2012-02-28 16:50:41 UTC (rev 109111)
+++ trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp	2012-02-28 16:52:35 UTC (rev 109112)
@@ -193,13 +193,11 @@
 {
     if (viewport.intersects(tileRectForCoordinate(tileCoordinate)))
         return 0;
-    
+
     IntPoint viewCenter = viewport.location() + IntSize(viewport.width() / 2, viewport.height() / 2);
     Tile::Coordinate centerCoordinate = tileCoordinateForPoint(viewCenter);
-    
-    // Manhattan distance, biased so that vertical distances are shorter.
-    const double horizontalBias = 1.3;
-    return abs(centerCoordinate.y() - tileCoordinate.y()) + horizontalBias * abs(centerCoordinate.x() - tileCoordinate.x());
+
+    return std::max(abs(centerCoordinate.y() - tileCoordinate.y()), abs(centerCoordinate.x() - tileCoordinate.x()));
 }
 
 // Returns a ratio between 0.0f and 1.0f of the surface of contentsRect covered by rendered tiles.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to