Commit c34a712b authored by timothy_horton@apple.com's avatar timothy_horton@apple.com
Browse files

revalidateTiles and ensureTilesForRect can share a lot of code

https://bugs.webkit.org/show_bug.cgi?id=119282

Missed the review comments, whoops.

* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::prepopulateRect):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::ensureTilesForRect):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 98ebb807
2013-08-21 Tim Horton <timothy_horton@apple.com>
revalidateTiles and ensureTilesForRect can share a lot of code
https://bugs.webkit.org/show_bug.cgi?id=119282
Missed the review comments, whoops.
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::prepopulateRect):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::ensureTilesForRect):
2013-08-21 Andreas Kling <akling@apple.com>
 
<https://webkit.org/b/120115> SVG elements always have custom style resolve callbacks.
......@@ -146,8 +146,10 @@ private:
typedef unsigned TileValidationPolicyFlags;
void revalidateTiles(TileValidationPolicyFlags foregroundValidationPolicy = 0, TileValidationPolicyFlags backgroundValidationPolicy = 0);
enum class NewTileType { PrimaryTiles, SecondaryTiles };
IntRect ensureTilesForRect(const FloatRect&, NewTileType);
enum class CoverageType { PrimaryTiles, SecondaryTiles };
// Returns the bounds of the covered tiles.
IntRect ensureTilesForRect(const FloatRect&, CoverageType);
void updateTileCoverageMap();
void removeAllTiles();
......
......@@ -357,7 +357,7 @@ void TileController::prepopulateRect(const FloatRect& rect)
if (m_primaryTileCoverageRect.contains(rectInTileCoords))
return;
ensureTilesForRect(rect, NewTileType::SecondaryTiles);
ensureTilesForRect(rect, CoverageType::SecondaryTiles);
if (m_tiledScrollingIndicatorLayer)
updateTileCoverageMap();
......@@ -673,7 +673,7 @@ void TileController::revalidateTiles(TileValidationPolicyFlags foregroundValidat
}
// Ensure primary tile coverage tiles.
m_primaryTileCoverageRect = ensureTilesForRect(tileCoverageRect, NewTileType::PrimaryTiles);
m_primaryTileCoverageRect = ensureTilesForRect(tileCoverageRect, CoverageType::PrimaryTiles);
if (validationPolicy & PruneSecondaryTiles) {
removeAllSecondaryTiles();
......@@ -768,7 +768,7 @@ void TileController::cohortRemovalTimerFired(Timer<TileController>*)
updateTileCoverageMap();
}
IntRect TileController::ensureTilesForRect(const FloatRect& rect, NewTileType newTileType)
IntRect TileController::ensureTilesForRect(const FloatRect& rect, CoverageType newTileType)
{
if (m_unparentsOffscreenTiles && !m_isInWindow)
return IntRect();
......@@ -813,7 +813,7 @@ IntRect TileController::ensureTilesForRect(const FloatRect& rect, NewTileType ne
[tileInfo.layer.get() setFrame:tileRect];
}
if (newTileType == NewTileType::SecondaryTiles && !tileRect.intersects(m_primaryTileCoverageRect)) {
if (newTileType == CoverageType::SecondaryTiles && !tileRect.intersects(m_primaryTileCoverageRect)) {
tileInfo.cohort = currCohort;
++tilesInCohort;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment