- Revision
- 188324
- Author
- [email protected]
- Date
- 2015-08-11 21:58:37 -0700 (Tue, 11 Aug 2015)
Log Message
[iOS WK2] ASSERT(!m_properties.backingStore || owner()) sometimes on zooming
https://bugs.webkit.org/show_bug.cgi?id=147854
Reviewed by Tim Horton.
When destroying a TileGrid, the container layer remains alive by virtue of being
in the layer tree, and it and its tiles get visited during layer tree transaction
building but we assert because we've cleared the owner on the tile layers.
The real bug is that TileController doesn't tell GraphicsLayerCA when the custom
sublayers change. Make this possible via a new PlatformCALayerClient function,
and make TileController use this when rearranging its tile grids.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerCustomSublayersChanged):
(WebCore::GraphicsLayerCA::updateContentsScale): No need to explicitly set
the ChildrenChanged flag now.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerCustomSublayersChanged):
(WebCore::PlatformCALayerClient::platformCALayerLayerDidDisplay):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setNeedsDisplay):
(WebCore::TileController::setContentsScale):
(WebCore::TileController::setZoomedOutContentsScale):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::clearZoomedOutTileGrid):
(WebCore::TileController::tileGridsChanged):
(WebCore::TileController::tileRevalidationTimerFired):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.h: Default param.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (188323 => 188324)
--- trunk/Source/WebCore/ChangeLog 2015-08-12 04:20:24 UTC (rev 188323)
+++ trunk/Source/WebCore/ChangeLog 2015-08-12 04:58:37 UTC (rev 188324)
@@ -1,3 +1,37 @@
+2015-08-11 Simon Fraser <[email protected]>
+
+ [iOS WK2] ASSERT(!m_properties.backingStore || owner()) sometimes on zooming
+ https://bugs.webkit.org/show_bug.cgi?id=147854
+
+ Reviewed by Tim Horton.
+
+ When destroying a TileGrid, the container layer remains alive by virtue of being
+ in the layer tree, and it and its tiles get visited during layer tree transaction
+ building but we assert because we've cleared the owner on the tile layers.
+
+ The real bug is that TileController doesn't tell GraphicsLayerCA when the custom
+ sublayers change. Make this possible via a new PlatformCALayerClient function,
+ and make TileController use this when rearranging its tile grids.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::platformCALayerCustomSublayersChanged):
+ (WebCore::GraphicsLayerCA::updateContentsScale): No need to explicitly set
+ the ChildrenChanged flag now.
+ * platform/graphics/ca/GraphicsLayerCA.h:
+ * platform/graphics/ca/PlatformCALayerClient.h:
+ (WebCore::PlatformCALayerClient::platformCALayerCustomSublayersChanged):
+ (WebCore::PlatformCALayerClient::platformCALayerLayerDidDisplay):
+ * platform/graphics/ca/TileController.cpp:
+ (WebCore::TileController::setNeedsDisplay):
+ (WebCore::TileController::setContentsScale):
+ (WebCore::TileController::setZoomedOutContentsScale):
+ (WebCore::TileController::revalidateTiles):
+ (WebCore::TileController::clearZoomedOutTileGrid):
+ (WebCore::TileController::tileGridsChanged):
+ (WebCore::TileController::tileRevalidationTimerFired):
+ * platform/graphics/ca/TileController.h:
+ * platform/graphics/ca/TileGrid.h: Default param.
+
2015-08-11 Zalan Bujtas <[email protected]>
Disconnect LayoutStateDisabler logic and RenderView pointer.
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (188323 => 188324)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2015-08-12 04:20:24 UTC (rev 188323)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2015-08-12 04:58:37 UTC (rev 188324)
@@ -1404,6 +1404,11 @@
client().didCommitChangesForLayer(this);
}
+void GraphicsLayerCA::platformCALayerCustomSublayersChanged(PlatformCALayer*)
+{
+ noteLayerPropertyChanged(ChildrenChanged, m_isCommittingChanges ? DontScheduleFlush : ScheduleFlush);
+}
+
bool GraphicsLayerCA::platformCALayerShowRepaintCounter(PlatformCALayer* platformLayer) const
{
// The repaint counters are painted into the TileController tiles (which have no corresponding platform layer),
@@ -3200,9 +3205,6 @@
m_contentsLayer->setContentsScale(contentsScale);
if (tiledBacking()) {
- // Scale change may swap in a different set of tiles changing the custom child layers.
- if (isPageTiledBackingLayer())
- m_uncommittedChanges |= ChildrenChanged;
// Tiled backing repaints automatically on scale change.
return;
}
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (188323 => 188324)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2015-08-12 04:20:24 UTC (rev 188323)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2015-08-12 04:58:37 UTC (rev 188324)
@@ -181,6 +181,7 @@
// PlatformCALayerClient overrides
virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*) override { }
virtual bool platformCALayerRespondsToLayoutChanges() const override { return false; }
+ WEBCORE_EXPORT void platformCALayerCustomSublayersChanged(PlatformCALayer*) override;
WEBCORE_EXPORT void platformCALayerAnimationStarted(const String& animationKey, CFTimeInterval beginTime) override;
WEBCORE_EXPORT void platformCALayerAnimationEnded(const String& animationKey) override;
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h (188323 => 188324)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2015-08-12 04:20:24 UTC (rev 188323)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2015-08-12 04:58:37 UTC (rev 188324)
@@ -39,6 +39,8 @@
virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*) { }
virtual bool platformCALayerRespondsToLayoutChanges() const { return false; }
+ virtual void platformCALayerCustomSublayersChanged(PlatformCALayer*) { }
+
virtual void platformCALayerAnimationStarted(const String& /*animationKey*/, CFTimeInterval) { }
virtual void platformCALayerAnimationEnded(const String& /*animationKey*/) { }
virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesTopDown; }
@@ -49,7 +51,7 @@
virtual bool platformCALayerContentsOpaque() const = 0;
virtual bool platformCALayerDrawsContent() const = 0;
- virtual void platformCALayerLayerDidDisplay(PlatformCALayer*) { }
+ virtual void platformCALayerLayerDidDisplay(PlatformCALayer*) { }
virtual void platformCALayerSetNeedsToRevalidateTiles() { }
virtual float platformCALayerDeviceScaleFactor() const = 0;
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (188323 => 188324)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2015-08-12 04:20:24 UTC (rev 188323)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2015-08-12 04:58:37 UTC (rev 188324)
@@ -93,7 +93,7 @@
void TileController::setNeedsDisplay()
{
tileGrid().setNeedsDisplay();
- m_zoomedOutTileGrid = nullptr;
+ clearZoomedOutTileGrid();
}
void TileController::setNeedsDisplayInRect(const IntRect& rect)
@@ -125,7 +125,8 @@
if (m_zoomedOutTileGrid && m_zoomedOutTileGrid->scale() == scale) {
m_tileGrid = WTF::move(m_zoomedOutTileGrid);
m_tileGrid->setIsZoomedOutTileGrid(false);
- m_tileGrid->revalidateTiles(0);
+ m_tileGrid->revalidateTiles();
+ tileGridsChanged();
return;
}
@@ -133,6 +134,7 @@
m_zoomedOutTileGrid = WTF::move(m_tileGrid);
m_zoomedOutTileGrid->setIsZoomedOutTileGrid(true);
m_tileGrid = std::make_unique<TileGrid>(*this);
+ tileGridsChanged();
}
tileGrid().setScale(scale);
@@ -161,7 +163,7 @@
m_zoomedOutContentsScale = scale;
if (m_zoomedOutTileGrid && m_zoomedOutTileGrid->scale() != m_zoomedOutContentsScale)
- m_zoomedOutTileGrid = nullptr;
+ clearZoomedOutTileGrid();
}
void TileController::setAcceleratesDrawing(bool acceleratesDrawing)
@@ -261,7 +263,7 @@
void TileController::revalidateTiles()
{
ASSERT(owningGraphicsLayer()->isCommittingChanges());
- tileGrid().revalidateTiles(0);
+ tileGrid().revalidateTiles();
}
void TileController::forceRepaint()
@@ -426,6 +428,17 @@
return owningGraphicsLayer()->platformCALayerShouldTemporarilyRetainTileCohorts(m_tileCacheLayer);
}
+void TileController::clearZoomedOutTileGrid()
+{
+ m_zoomedOutTileGrid = nullptr;
+ tileGridsChanged();
+}
+
+void TileController::tileGridsChanged()
+{
+ return owningGraphicsLayer()->platformCALayerCustomSublayersChanged(m_tileCacheLayer);
+}
+
void TileController::tileRevalidationTimerFired()
{
if (!owningGraphicsLayer())
@@ -436,7 +449,7 @@
return;
}
// If we are not visible get rid of the zoomed-out tiles.
- m_zoomedOutTileGrid = nullptr;
+ clearZoomedOutTileGrid();
TileGrid::TileValidationPolicy validationPolicy = (shouldAggressivelyRetainTiles() ? 0 : TileGrid::PruneSecondaryTiles) | TileGrid::UnparentAllTiles;
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (188323 => 188324)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.h 2015-08-12 04:20:24 UTC (rev 188323)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h 2015-08-12 04:58:37 UTC (rev 188324)
@@ -158,6 +158,9 @@
virtual void setZoomedOutContentsScale(float) override;
virtual float zoomedOutContentsScale() const override;
+ void clearZoomedOutTileGrid();
+ void tileGridsChanged();
+
void tileRevalidationTimerFired();
void setNeedsRevalidateTiles();
Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.h (188323 => 188324)
--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.h 2015-08-12 04:20:24 UTC (rev 188323)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.h 2015-08-12 04:58:37 UTC (rev 188324)
@@ -71,7 +71,7 @@
UnparentAllTiles = 1 << 1
};
typedef unsigned TileValidationPolicy;
- void revalidateTiles(TileValidationPolicy);
+ void revalidateTiles(TileValidationPolicy = 0);
bool tilesWouldChangeForCoverageRect(const FloatRect&) const;