Title: [89803] trunk/Source
Revision
89803
Author
[email protected]
Date
2011-06-27 01:10:54 -0700 (Mon, 27 Jun 2011)

Log Message

2011-06-27  Huang Dongsung  <[email protected]>

        Reviewed by Kenneth Rohde Christiansen.

        TiledBackingStore endlessly creates and destroys tiles due to an off-by-one
        error.
        https://bugs.webkit.org/show_bug.cgi?id=62422

        REGRESSION(r77286): Remove bottomRight().
        REGRESSION(r77312): Change the logic to get the bottom right point.
        REGRESSION(r77928): Cause off-by-one error in TiledBackingStore.
        REGRESSION(r78783): Cause off-by-one error in TiledDrawingAreaProxy.
        REGRESSION(r78785): Cause off-by-one error in TiledDrawingAreaProxy.

        If the viewport width equals the contents width, especially in the mobile
        device, TiledBackingStore endlessly creates and deletes the rightmost
        column and bottom row of tiles.
        In the detail, dropTilesOutsideRect() in TiledBackingStore::createTiles()
        deletes tiles and setTile(coordinate, Tile::create(this, coordinate)) creates
        tiles infinitely.
        Modified TiledDrawingAreaProxy also.

        * platform/graphics/TiledBackingStore.cpp:
        (WebCore::innerBottomRight):
        (WebCore::TiledBackingStore::invalidate):
        (WebCore::TiledBackingStore::paint):
        (WebCore::TiledBackingStore::createTiles):
2011-06-27  Huang Dongsung  <[email protected]>

        Reviewed by Kenneth Rohde Christiansen.

        TiledBackingStore endlessly creates and destroys tiles due to an off-by-one
        error.
        https://bugs.webkit.org/show_bug.cgi?id=62422

        REGRESSION(r77286): Remove bottomRight().
        REGRESSION(r77312): Change the logic to get the bottom right point.
        REGRESSION(r77928): Cause off-by-one error in TiledBackingStore.
        REGRESSION(r78783): Cause off-by-one error in TiledDrawingAreaProxy.
        REGRESSION(r78785): Cause off-by-one error in TiledDrawingAreaProxy.

        If the viewport width equals the contents width, especially in the mobile
        device, TiledBackingStore endlessly creates and deletes the rightmost
        column and bottom row of tiles.
        In the detail, dropTilesOutsideRect() in TiledBackingStore::createTiles()
        deletes tiles and setTile(coordinate, Tile::create(this, coordinate)) creates
        tiles infinitely.
        Modified TiledDrawingAreaProxy also.

        * UIProcess/TiledDrawingAreaProxy.cpp:
        (WebKit::innerBottomRight):
        (WebKit::TiledDrawingAreaProxy::invalidate):
        (WebKit::TiledDrawingAreaProxy::paint):
        (WebKit::TiledDrawingAreaProxy::createTiles):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89802 => 89803)


--- trunk/Source/WebCore/ChangeLog	2011-06-27 08:07:18 UTC (rev 89802)
+++ trunk/Source/WebCore/ChangeLog	2011-06-27 08:10:54 UTC (rev 89803)
@@ -1,3 +1,31 @@
+2011-06-27  Huang Dongsung  <[email protected]>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        TiledBackingStore endlessly creates and destroys tiles due to an off-by-one
+        error.
+        https://bugs.webkit.org/show_bug.cgi?id=62422
+
+        REGRESSION(r77286): Remove bottomRight().
+        REGRESSION(r77312): Change the logic to get the bottom right point.
+        REGRESSION(r77928): Cause off-by-one error in TiledBackingStore.
+        REGRESSION(r78783): Cause off-by-one error in TiledDrawingAreaProxy.
+        REGRESSION(r78785): Cause off-by-one error in TiledDrawingAreaProxy.
+
+        If the viewport width equals the contents width, especially in the mobile
+        device, TiledBackingStore endlessly creates and deletes the rightmost
+        column and bottom row of tiles.
+        In the detail, dropTilesOutsideRect() in TiledBackingStore::createTiles()
+        deletes tiles and setTile(coordinate, Tile::create(this, coordinate)) creates
+        tiles infinitely.
+        Modified TiledDrawingAreaProxy also.
+
+        * platform/graphics/TiledBackingStore.cpp:
+        (WebCore::innerBottomRight):
+        (WebCore::TiledBackingStore::invalidate):
+        (WebCore::TiledBackingStore::paint):
+        (WebCore::TiledBackingStore::createTiles):
+
 2011-06-26  Adam Barth  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp (89802 => 89803)


--- trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp	2011-06-27 08:07:18 UTC (rev 89802)
+++ trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp	2011-06-27 08:10:54 UTC (rev 89803)
@@ -30,6 +30,13 @@
 static const int defaultTileWidth = 512;
 static const int defaultTileHeight = 512;
 
+static IntPoint innerBottomRight(const IntRect& rect)
+{
+    // Actually, the rect does not contain rect.maxX(). Refer to IntRect::contain.
+    return IntPoint(rect.maxX() - 1, rect.maxY() - 1);
+}
+
+
 TiledBackingStore::TiledBackingStore(TiledBackingStoreClient* client)
     : m_client(client)
     , m_tileBufferUpdateTimer(new TileTimer(this, &TiledBackingStore::tileBufferUpdateTimerFired))
@@ -74,7 +81,7 @@
     IntRect dirtyRect(mapFromContents(contentsDirtyRect));
     
     Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
-    Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY()));
+    Tile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(dirtyRect));
     
     for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
         for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
@@ -133,7 +140,7 @@
     IntRect dirtyRect = mapFromContents(rect);
     
     Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
-    Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY()));
+    Tile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(dirtyRect));
 
     for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
         for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
@@ -230,7 +237,7 @@
     Vector<Tile::Coordinate> tilesToCreate;
     unsigned requiredTileCount = 0;
     Tile::Coordinate topLeft = tileCoordinateForPoint(coverRect.location());
-    Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(coverRect.maxX(), coverRect.maxY()));
+    Tile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(coverRect));
     for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
         for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
             Tile::Coordinate currentCoordinate(xCoordinate, yCoordinate);

Modified: trunk/Source/WebKit2/ChangeLog (89802 => 89803)


--- trunk/Source/WebKit2/ChangeLog	2011-06-27 08:07:18 UTC (rev 89802)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-27 08:10:54 UTC (rev 89803)
@@ -1,3 +1,31 @@
+2011-06-27  Huang Dongsung  <[email protected]>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        TiledBackingStore endlessly creates and destroys tiles due to an off-by-one
+        error.
+        https://bugs.webkit.org/show_bug.cgi?id=62422
+
+        REGRESSION(r77286): Remove bottomRight().
+        REGRESSION(r77312): Change the logic to get the bottom right point.
+        REGRESSION(r77928): Cause off-by-one error in TiledBackingStore.
+        REGRESSION(r78783): Cause off-by-one error in TiledDrawingAreaProxy.
+        REGRESSION(r78785): Cause off-by-one error in TiledDrawingAreaProxy.
+
+        If the viewport width equals the contents width, especially in the mobile
+        device, TiledBackingStore endlessly creates and deletes the rightmost
+        column and bottom row of tiles.
+        In the detail, dropTilesOutsideRect() in TiledBackingStore::createTiles()
+        deletes tiles and setTile(coordinate, Tile::create(this, coordinate)) creates
+        tiles infinitely.
+        Modified TiledDrawingAreaProxy also.
+
+        * UIProcess/TiledDrawingAreaProxy.cpp:
+        (WebKit::innerBottomRight):
+        (WebKit::TiledDrawingAreaProxy::invalidate):
+        (WebKit::TiledDrawingAreaProxy::paint):
+        (WebKit::TiledDrawingAreaProxy::createTiles):
+
 2011-06-26  Mark Rowe  <[email protected]>
 
         Reviewed by Dan Bernstein.

Modified: trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp (89802 => 89803)


--- trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp	2011-06-27 08:07:18 UTC (rev 89802)
+++ trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp	2011-06-27 08:10:54 UTC (rev 89803)
@@ -42,6 +42,12 @@
 static const int defaultTileWidth = 1024;
 static const int defaultTileHeight = 1024;
 
+static IntPoint innerBottomRight(const IntRect& rect)
+{
+    // Actually, the rect does not contain rect.maxX(). Refer to IntRect::contain.
+    return IntPoint(rect.maxX() - 1, rect.maxY() - 1);
+}
+
 PassOwnPtr<TiledDrawingAreaProxy> TiledDrawingAreaProxy::create(PlatformWebView* webView, WebPageProxy* webPageProxy)
 {
     return adoptPtr(new TiledDrawingAreaProxy(webView, webPageProxy));
@@ -179,7 +185,7 @@
     IntRect dirtyRect(mapFromContents(contentsDirtyRect));
 
     TiledDrawingAreaTile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
-    TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY()));
+    TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(dirtyRect));
 
     IntRect coverRect = calculateCoverRect(m_previousVisibleRect);
 
@@ -277,7 +283,7 @@
     IntRect dirtyRect = mapFromContents(rect);
 
     TiledDrawingAreaTile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
-    TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY()));
+    TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(dirtyRect));
 
     for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
         for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
@@ -374,7 +380,7 @@
     unsigned requiredTileCount = 0;
     bool hasVisibleCheckers = false;
     TiledDrawingAreaTile::Coordinate topLeft = tileCoordinateForPoint(visibleRect.location());
-    TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(visibleRect.maxX(), visibleRect.maxY()));
+    TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(visibleRect));
     for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
         for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
             TiledDrawingAreaTile::Coordinate currentCoordinate(xCoordinate, yCoordinate);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to