- Revision
- 111762
- Author
- ander...@apple.com
- Date
- 2012-03-22 14:14:49 -0700 (Thu, 22 Mar 2012)
Log Message
ASSERT(!needsLayout) in RenderView.cpp when visiting http://www.panic.com/blog/
https://bugs.webkit.org/show_bug.cgi?id=81953
<rdar://problem/11086998>
Reviewed by Sam Weinig.
Source/WebCore:
If a page ends up creating CATiledLayers, CA transactions can be committed outside of the normal
CA run loop observer, so we can't call setNeedsDisplay on tile cache layers directly because then
we'll end up calling into painting code before all the layers have been flushed.
Fix this by adding a list of dirty rects to platformCALayerDidCreateTiles and change GraphicsLayerCA to
mark them as dirty. This ensures that any CA transaction commits won't cause newly added layers to be painted.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerDidCreateTiles):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerDidCreateTiles):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* platform/graphics/ca/PlatformCALayerClient.h:
(PlatformCALayerClient):
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::setScale):
(WebCore::TileCache::revalidateTiles):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDidCreateTiles):
Source/WebKit/win:
Update for changes to WebCore.
* FullscreenVideoController.cpp:
(FullscreenVideoController::LayerClient::platformCALayerDidCreateTiles):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (111761 => 111762)
--- trunk/Source/WebCore/ChangeLog 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebCore/ChangeLog 2012-03-22 21:14:49 UTC (rev 111762)
@@ -1,3 +1,32 @@
+2012-03-22 Anders Carlsson <ander...@apple.com>
+
+ ASSERT(!needsLayout) in RenderView.cpp when visiting http://www.panic.com/blog/
+ https://bugs.webkit.org/show_bug.cgi?id=81953
+ <rdar://problem/11086998>
+
+ Reviewed by Sam Weinig.
+
+ If a page ends up creating CATiledLayers, CA transactions can be committed outside of the normal
+ CA run loop observer, so we can't call setNeedsDisplay on tile cache layers directly because then
+ we'll end up calling into painting code before all the layers have been flushed.
+
+ Fix this by adding a list of dirty rects to platformCALayerDidCreateTiles and change GraphicsLayerCA to
+ mark them as dirty. This ensures that any CA transaction commits won't cause newly added layers to be painted.
+
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::LayerClient::platformCALayerDidCreateTiles):
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::platformCALayerDidCreateTiles):
+ * platform/graphics/ca/GraphicsLayerCA.h:
+ (GraphicsLayerCA):
+ * platform/graphics/ca/PlatformCALayerClient.h:
+ (PlatformCALayerClient):
+ * platform/graphics/ca/mac/TileCache.mm:
+ (WebCore::TileCache::setScale):
+ (WebCore::TileCache::revalidateTiles):
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDidCreateTiles):
+
2012-03-19 Robert Hogan <rob...@webkit.org>
Text should overflow when list item height set to 0
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (111761 => 111762)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2012-03-22 21:14:49 UTC (rev 111762)
@@ -160,7 +160,7 @@
virtual bool platformCALayerContentsOpaque() const { return false; }
virtual bool platformCALayerDrawsContent() const { return false; }
virtual void platformCALayerLayerDidDisplay(PlatformLayer*) { }
- virtual void platformCALayerDidCreateTiles() { }
+ virtual void platformCALayerDidCreateTiles(const Vector<FloatRect>&) { }
virtual float platformCALayerDeviceScaleFactor() { return 1; }
AVFWrapper* m_parent;
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (111761 => 111762)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2012-03-22 21:14:49 UTC (rev 111762)
@@ -963,10 +963,13 @@
paintGraphicsLayerContents(context, clip);
}
-void GraphicsLayerCA::platformCALayerDidCreateTiles()
+void GraphicsLayerCA::platformCALayerDidCreateTiles(const Vector<FloatRect>& dirtyRects)
{
ASSERT(m_layer->layerType() == PlatformCALayer::LayerTypeTileCacheLayer);
+ for (size_t i = 0; i < dirtyRects.size(); ++i)
+ setNeedsDisplayInRect(dirtyRects[i]);
+
// Ensure that the layout is up to date before any individual tiles are painted by telling the client
// that it needs to sync its layer state, which will end up scheduling the layer flusher.
client()->notifySyncRequired(this);
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (111761 => 111762)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2012-03-22 21:14:49 UTC (rev 111762)
@@ -157,7 +157,7 @@
virtual bool platformCALayerContentsOpaque() const { return contentsOpaque(); }
virtual bool platformCALayerDrawsContent() const { return drawsContent(); }
virtual void platformCALayerLayerDidDisplay(PlatformLayer* layer) { return layerDidDisplay(layer); }
- virtual void platformCALayerDidCreateTiles() OVERRIDE;
+ virtual void platformCALayerDidCreateTiles(const Vector<FloatRect>& dirtyRects) OVERRIDE;
virtual float platformCALayerDeviceScaleFactor() OVERRIDE;
void updateOpacityOnLayer();
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h (111761 => 111762)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2012-03-22 21:14:49 UTC (rev 111762)
@@ -59,7 +59,7 @@
virtual bool platformCALayerDrawsContent() const = 0;
virtual void platformCALayerLayerDidDisplay(PlatformLayer*) = 0;
- virtual void platformCALayerDidCreateTiles() = 0;
+ virtual void platformCALayerDidCreateTiles(const Vector<FloatRect>& dirtyRects) = 0;
virtual float platformCALayerDeviceScaleFactor() = 0;
protected:
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (111761 => 111762)
--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2012-03-22 21:14:49 UTC (rev 111762)
@@ -182,6 +182,8 @@
return;
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ Vector<FloatRect> dirtyRects;
+
m_deviceScaleFactor = deviceScaleFactor;
m_scale = scale;
[m_tileContainerLayer.get() setTransform:CATransform3DMakeScale(1 / m_scale, 1 / m_scale, 1)];
@@ -190,10 +192,15 @@
for (TileMap::const_iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) {
[it->second.get() setContentsScale:deviceScaleFactor];
- [it->second.get() setNeedsDisplay];
+
+ IntRect tileRect = rectForTileIndex(it->first);
+ FloatRect scaledTileRect = tileRect;
+
+ scaledTileRect.scale(1 / m_scale);
+ dirtyRects.append(scaledTileRect);
}
- platformLayer->owner()->platformCALayerDidCreateTiles();
+ platformLayer->owner()->platformCALayerDidCreateTiles(dirtyRects);
#endif
}
@@ -350,7 +357,7 @@
TileIndex bottomRight;
getTileIndexRangeForRect(tileCoverageRect, topLeft, bottomRight);
- bool didCreateOrResizeTiles = false;
+ Vector<FloatRect> dirtyRects;
for (int y = topLeft.y(); y <= bottomRight.y(); ++y) {
for (int x = topLeft.x(); x <= bottomRight.x(); ++x) {
@@ -358,22 +365,19 @@
IntRect tileRect = rectForTileIndex(tileIndex);
RetainPtr<WebTileLayer>& tileLayer = m_tiles.add(tileIndex, 0).first->second;
- if (tileLayer) {
+ if (!tileLayer) {
+ tileLayer = createTileLayer(tileRect);
+ [m_tileContainerLayer.get() addSublayer:tileLayer.get()];
+ } else {
// We already have a layer for this tile. Ensure that its size is correct.
- if (!CGSizeEqualToSize([tileLayer.get() frame].size, tileRect.size())) {
- [tileLayer.get() setFrame:tileRect];
- [tileLayer.get() setNeedsDisplay];
- didCreateOrResizeTiles = true;
- }
- continue;
+ if (CGSizeEqualToSize([tileLayer.get() frame].size, tileRect.size()))
+ continue;
+ [tileLayer.get() setFrame:tileRect];
}
- didCreateOrResizeTiles = true;
-
- tileLayer = createTileLayer(tileRect);
-
- [tileLayer.get() setNeedsDisplay];
- [m_tileContainerLayer.get() addSublayer:tileLayer.get()];
+ FloatRect scaledTileRect = tileRect;
+ scaledTileRect.scale(1 / m_scale);
+ dirtyRects.append(scaledTileRect);
}
}
@@ -384,10 +388,7 @@
m_tileCoverageRect.unite(rectForTileIndex(tileIndex));
}
- if (!didCreateOrResizeTiles)
- return;
-
- platformLayer->owner()->platformCALayerDidCreateTiles();
+ platformLayer->owner()->platformCALayerDidCreateTiles(dirtyRects);
}
WebTileLayer* TileCache::tileLayerAtIndex(const TileIndex& index) const
Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp (111761 => 111762)
--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp 2012-03-22 21:14:49 UTC (rev 111762)
@@ -107,7 +107,7 @@
virtual bool platformCALayerContentsOpaque() const { return false; }
virtual bool platformCALayerDrawsContent() const { return false; }
virtual void platformCALayerLayerDidDisplay(PlatformLayer*) { }
- virtual void platformCALayerDidCreateTiles() { }
+ virtual void platformCALayerDidCreateTiles(const Vector<FloatRect>&) { }
virtual float platformCALayerDeviceScaleFactor() { return 1; }
MediaPlayerPrivateQuickTimeVisualContext* m_parent;
Modified: trunk/Source/WebKit/win/ChangeLog (111761 => 111762)
--- trunk/Source/WebKit/win/ChangeLog 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebKit/win/ChangeLog 2012-03-22 21:14:49 UTC (rev 111762)
@@ -1,3 +1,16 @@
+2012-03-22 Anders Carlsson <ander...@apple.com>
+
+ ASSERT(!needsLayout) in RenderView.cpp when visiting http://www.panic.com/blog/
+ https://bugs.webkit.org/show_bug.cgi?id=81953
+ <rdar://problem/11086998>
+
+ Reviewed by Sam Weinig.
+
+ Update for changes to WebCore.
+
+ * FullscreenVideoController.cpp:
+ (FullscreenVideoController::LayerClient::platformCALayerDidCreateTiles):
+
2012-03-20 Steve Falkenburg <sfal...@apple.com>
Move WTF-related Windows project files out of _javascript_Core
Modified: trunk/Source/WebKit/win/FullscreenVideoController.cpp (111761 => 111762)
--- trunk/Source/WebKit/win/FullscreenVideoController.cpp 2012-03-22 21:10:52 UTC (rev 111761)
+++ trunk/Source/WebKit/win/FullscreenVideoController.cpp 2012-03-22 21:14:49 UTC (rev 111762)
@@ -195,7 +195,7 @@
virtual bool platformCALayerContentsOpaque() const { return false; }
virtual bool platformCALayerDrawsContent() const { return false; }
virtual void platformCALayerLayerDidDisplay(PlatformLayer*) { }
- virtual void platformCALayerDidCreateTiles() { }
+ virtual void platformCALayerDidCreateTiles(const Vector<FloatRect>&) { }
virtual float platformCALayerDeviceScaleFactor() { return 1; }
FullscreenVideoController* m_parent;