Title: [169097] trunk/Source/WebCore
Revision
169097
Author
[email protected]
Date
2014-05-19 19:31:19 -0700 (Mon, 19 May 2014)

Log Message

Scrolling pages with large TiledBacking content layers creates way too many tiles
https://bugs.webkit.org/show_bug.cgi?id=133101

Reviewed by Tim Horton.

Fix the GraphicsLayerCA::adjustTiledLayerVisibleRect() logic to avoid making giant rects if the old
and new visible rects don't overlap.

* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
* platform/graphics/ca/mac/TileController.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169096 => 169097)


--- trunk/Source/WebCore/ChangeLog	2014-05-20 02:31:17 UTC (rev 169096)
+++ trunk/Source/WebCore/ChangeLog	2014-05-20 02:31:19 UTC (rev 169097)
@@ -1,5 +1,20 @@
 2014-05-19  Simon Fraser  <[email protected]>
 
+        Scrolling pages with large TiledBacking content layers creates way too many tiles
+        https://bugs.webkit.org/show_bug.cgi?id=133101
+
+        Reviewed by Tim Horton.
+
+        Fix the GraphicsLayerCA::adjustTiledLayerVisibleRect() logic to avoid making giant rects if the old
+        and new visible rects don't overlap.
+
+        * platform/graphics/TiledBacking.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
+        * platform/graphics/ca/mac/TileController.h:
+
+2014-05-19  Simon Fraser  <[email protected]>
+
         Correctly maintain the "isInWindow" state for all TiledBackings
         https://bugs.webkit.org/show_bug.cgi?id=133095
 

Modified: trunk/Source/WebCore/platform/graphics/TiledBacking.h (169096 => 169097)


--- trunk/Source/WebCore/platform/graphics/TiledBacking.h	2014-05-20 02:31:17 UTC (rev 169096)
+++ trunk/Source/WebCore/platform/graphics/TiledBacking.h	2014-05-20 02:31:19 UTC (rev 169097)
@@ -96,6 +96,7 @@
 
     // Includes margins.
     virtual IntRect bounds() const = 0;
+    virtual IntRect boundsWithoutMargin() const = 0;
 
     // Exposed for testing
     virtual IntRect tileCoverageRect() const = 0;

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


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2014-05-20 02:31:17 UTC (rev 169096)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2014-05-20 02:31:19 UTC (rev 169097)
@@ -1858,8 +1858,8 @@
 {
     // If the old visible rect is empty, we have no information about how the visible area is changing
     // (maybe the layer was just created), so don't attempt to expand. Also don't attempt to expand
-    // if the size changed.
-    if (oldVisibleRect.isEmpty() || newSize != oldSize)
+    // if the size changed or the rects don't overlap.
+    if (oldVisibleRect.isEmpty() || newSize != oldSize || !newVisibleRect.intersects(oldVisibleRect))
         return newVisibleRect;
 
     const float paddingMultiplier = 2;
@@ -1911,6 +1911,7 @@
             expandedRect.setHeight(existingTileBackingRect.maxY() - expandedRect.y());
     }
     
+    expandedRect.intersect(tiledBacking->boundsWithoutMargin());
     return expandedRect;
 }
 

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h (169096 => 169097)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h	2014-05-20 02:31:17 UTC (rev 169096)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h	2014-05-20 02:31:19 UTC (rev 169097)
@@ -96,6 +96,7 @@
 
     virtual IntSize tileSize() const override { return m_tileSize; }
     virtual IntRect bounds() const override;
+    virtual IntRect boundsWithoutMargin() const override;
     virtual bool hasMargins() const override;
     virtual bool hasHorizontalMargins() const override;
     virtual bool hasVerticalMargins() const override;
@@ -107,8 +108,6 @@
     virtual bool unparentsOffscreenTiles() const override { return m_unparentsOffscreenTiles; }
     virtual bool scrollingPerformanceLoggingEnabled() const override { return m_scrollingPerformanceLoggingEnabled; }
 
-    IntRect boundsWithoutMargin() const;
-
     FloatRect computeTileCoverageRect(const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect) const;
 
     IntRect boundsAtLastRevalidate() const { return m_boundsAtLastRevalidate; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to