Title: [148102] trunk/Source/WebCore
- Revision
- 148102
- Author
- [email protected]
- Date
- 2013-04-10 09:32:51 -0700 (Wed, 10 Apr 2013)
Log Message
TileController doesn't remove tiles when the view is resized, leading to stale content
https://bugs.webkit.org/show_bug.cgi?id=114323
<rdar://problem/13520671>
Reviewed by Simon Fraser.
Ensure that tiles are removed if the view shrinks, so that they are not displayed
with stale content if the view later grows again (they will not be repainted by WebCore
while out-of-view).
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::revalidateTiles):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (148101 => 148102)
--- trunk/Source/WebCore/ChangeLog 2013-04-10 16:28:34 UTC (rev 148101)
+++ trunk/Source/WebCore/ChangeLog 2013-04-10 16:32:51 UTC (rev 148102)
@@ -1,3 +1,19 @@
+2013-04-10 Tim Horton <[email protected]>
+
+ TileController doesn't remove tiles when the view is resized, leading to stale content
+ https://bugs.webkit.org/show_bug.cgi?id=114323
+ <rdar://problem/13520671>
+
+ Reviewed by Simon Fraser.
+
+ Ensure that tiles are removed if the view shrinks, so that they are not displayed
+ with stale content if the view later grows again (they will not be repainted by WebCore
+ while out-of-view).
+
+ * platform/graphics/ca/mac/TileController.h:
+ * platform/graphics/ca/mac/TileController.mm:
+ (WebCore::TileController::revalidateTiles):
+
2013-04-10 Jessie Berlin <[email protected]>
Update the localizable strings file.
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h (148101 => 148102)
--- trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h 2013-04-10 16:28:34 UTC (rev 148101)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h 2013-04-10 16:32:51 UTC (rev 148102)
@@ -175,6 +175,7 @@
FloatRect m_visibleRect;
FloatRect m_visibleRectAtLastRevalidate;
FloatRect m_exposedRect; // The exposed area of containing platform views.
+ IntRect m_boundsAtLastRevalidate;
typedef HashMap<TileIndex, TileInfo> TileMap;
TileMap m_tiles;
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm (148101 => 148102)
--- trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm 2013-04-10 16:28:34 UTC (rev 148101)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm 2013-04-10 16:32:51 UTC (rev 148102)
@@ -611,11 +611,12 @@
return;
FloatRect visibleRect = m_visibleRect;
+ IntRect bounds = this->bounds();
if (m_clipsToExposedRect)
visibleRect.intersect(m_exposedRect);
- if (visibleRect.isEmpty() || bounds().isEmpty())
+ if (visibleRect.isEmpty() || bounds.isEmpty())
return;
TileValidationPolicyFlags validationPolicy = m_isInWindow ? foregroundValidationPolicy : backgroundValidationPolicy;
@@ -717,11 +718,37 @@
for (TileMap::iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it)
[it->value.layer.get() removeFromSuperlayer];
}
-
+
+ if (m_boundsAtLastRevalidate != bounds) {
+ FloatRect scaledBounds(bounds);
+ scaledBounds.scale(m_scale);
+ IntRect boundsInTileCoords(enclosingIntRect(scaledBounds));
+
+ TileIndex topLeftForBounds;
+ TileIndex bottomRightForBounds;
+ getTileIndexRangeForRect(boundsInTileCoords, topLeftForBounds, bottomRightForBounds);
+
+ Vector<TileIndex> tilesToRemove;
+ for (TileMap::iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) {
+ const TileIndex& index = it->key;
+ if (index.y() < topLeftForBounds.y()
+ || index.y() > bottomRightForBounds.y()
+ || index.x() < topLeftForBounds.x()
+ || index.x() > bottomRightForBounds.x())
+ queueTileForRemoval(index, it->value, tilesToRemove);
+ }
+
+ for (size_t i = 0, size = tilesToRemove.size(); i < size; ++i) {
+ TileInfo tileInfo = m_tiles.take(tilesToRemove[i]);
+ LayerPool::sharedPool()->addLayer(tileInfo.layer);
+ }
+ }
+
if (m_tiledScrollingIndicatorLayer)
updateTileCoverageMap();
m_visibleRectAtLastRevalidate = visibleRect;
+ m_boundsAtLastRevalidate = bounds;
if (dirtyRects.isEmpty())
return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes