Title: [210094] trunk/Source/WebCore
Revision
210094
Author
[email protected]
Date
2016-12-21 19:06:05 -0800 (Wed, 21 Dec 2016)

Log Message

TileGrid creates new tiles when there are recyclable tiles about to be removed
https://bugs.webkit.org/show_bug.cgi?id=166408

Reviewed by Simon Fraser.

No new tests; existing tests cover this code, this is just a perf win,
specifically reducing the amount of layer churn during zooming.

* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
Remove all the tiles that will be removed first, then add new tiles.
Strictly ordering it this way means that tiles will be removed, go into
the LayerPool, then be pulled back out of the LayerPool to sit in the
newly-covered areas. Previously, we would sometimes make new layers
for newly-covered areas, and then remove unneeded but otherwise recyclable
tiles, which would then just go sit in the LayerPool (and often get
pruned, wastefully).

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (210093 => 210094)


--- trunk/Source/WebCore/ChangeLog	2016-12-22 01:57:24 UTC (rev 210093)
+++ trunk/Source/WebCore/ChangeLog	2016-12-22 03:06:05 UTC (rev 210094)
@@ -1,3 +1,23 @@
+2016-12-21  Tim Horton  <[email protected]>
+
+        TileGrid creates new tiles when there are recyclable tiles about to be removed
+        https://bugs.webkit.org/show_bug.cgi?id=166408
+
+        Reviewed by Simon Fraser.
+
+        No new tests; existing tests cover this code, this is just a perf win,
+        specifically reducing the amount of layer churn during zooming.
+
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::revalidateTiles):
+        Remove all the tiles that will be removed first, then add new tiles.
+        Strictly ordering it this way means that tiles will be removed, go into
+        the LayerPool, then be pulled back out of the LayerPool to sit in the
+        newly-covered areas. Previously, we would sometimes make new layers
+        for newly-covered areas, and then remove unneeded but otherwise recyclable
+        tiles, which would then just go sit in the LayerPool (and often get
+        pruned, wastefully).
+
 2016-12-21  Eric Carlson  <[email protected]>
 
         [MediaStream] Update media-stream-event-constructor test

Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (210093 => 210094)


--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp	2016-12-22 01:57:24 UTC (rev 210093)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp	2016-12-22 03:06:05 UTC (rev 210094)
@@ -406,19 +406,9 @@
             removeTilesInCohort(currCohort);
     }
 
-    // Ensure primary tile coverage tiles.
-    m_primaryTileCoverageRect = ensureTilesForRect(coverageRect, CoverageType::PrimaryTiles);
-
     if (validationPolicy & PruneSecondaryTiles) {
         removeAllSecondaryTiles();
         m_cohortList.clear();
-    } else {
-        for (auto& secondaryCoverageRect : m_secondaryTileCoverageRects) {
-            FloatRect secondaryRectInLayerCoordinates(secondaryCoverageRect);
-            secondaryRectInLayerCoordinates.scale(1 / m_scale);
-            ensureTilesForRect(secondaryRectInLayerCoordinates, CoverageType::SecondaryTiles);
-        }
-        m_secondaryTileCoverageRects.clear();
     }
 
     if (m_controller.unparentsOffscreenTiles() && (validationPolicy & UnparentAllTiles)) {
@@ -465,6 +455,19 @@
         }
     }
 
+    // Ensure primary tile coverage tiles.
+    m_primaryTileCoverageRect = ensureTilesForRect(coverageRect, CoverageType::PrimaryTiles);
+
+    // Ensure secondary tiles (requested via prepopulateRect).
+    if (!(validationPolicy & PruneSecondaryTiles)) {
+        for (auto& secondaryCoverageRect : m_secondaryTileCoverageRects) {
+            FloatRect secondaryRectInLayerCoordinates(secondaryCoverageRect);
+            secondaryRectInLayerCoordinates.scale(1 / m_scale);
+            ensureTilesForRect(secondaryRectInLayerCoordinates, CoverageType::SecondaryTiles);
+        }
+        m_secondaryTileCoverageRects.clear();
+    }
+
     m_controller.didRevalidateTiles();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to