Changeset 109112 in webkit


Ignore:
Timestamp:
Feb 28, 2012 8:52:35 AM (12 years ago)
Author:
kenneth@webkit.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109109 r109112  
     12012-02-28  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Improve the visual of the tiling
     4        https://bugs.webkit.org/show_bug.cgi?id=79648
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        When we cover the view with tiles[1], we do so from the center
     9        and out, in bigger and bigger cicles by finding the current minimum
     10        covered distance.
     11
     12        This looks like painting a rect, then a cross, then a rect, ...
     13        and can be noticed when a page blocks during tiling.
     14
     15        We can do this better by only covering with tiles in rects at a time.
     16
     17        The original code was done so that it gave preference to tiles in
     18        vertical direction due to that being the most common scrolling
     19        direction. This is not needed anymore as we are now using the
     20        trajectory vector when panning, which always gives preference for
     21        creating tiles in the panned direction.
     22
     23        [1] It should be noted that we always cover the visibleRect in one go,
     24            and that we here are talking about covering the coverRect beyond
     25            the visibleRect
     26
     27        * platform/graphics/TiledBackingStore.cpp:
     28        (WebCore::TiledBackingStore::tileDistance):
     29
    1302012-02-28  Yury Semikhatsky  <yurys@chromium.org>
    231
  • trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp

    r108501 r109112  
    194194    if (viewport.intersects(tileRectForCoordinate(tileCoordinate)))
    195195        return 0;
    196    
     196
    197197    IntPoint viewCenter = viewport.location() + IntSize(viewport.width() / 2, viewport.height() / 2);
    198198    Tile::Coordinate centerCoordinate = tileCoordinateForPoint(viewCenter);
    199    
    200     // Manhattan distance, biased so that vertical distances are shorter.
    201     const double horizontalBias = 1.3;
    202     return abs(centerCoordinate.y() - tileCoordinate.y()) + horizontalBias * abs(centerCoordinate.x() - tileCoordinate.x());
     199
     200    return std::max(abs(centerCoordinate.y() - tileCoordinate.y()), abs(centerCoordinate.x() - tileCoordinate.x()));
    203201}
    204202
Note: See TracChangeset for help on using the changeset viewer.