Title: [135616] trunk/Source/WebKit2
- Revision
- 135616
- Author
- [email protected]
- Date
- 2012-11-23 08:37:40 -0800 (Fri, 23 Nov 2012)
Log Message
REGRESSION(r135486): ASSERT(isMainThread()) hit in LayerTreeRenderer::setActive(bool)
https://bugs.webkit.org/show_bug.cgi?id=103077
Patch by Huang Dongsung <[email protected]> on 2012-11-23
Reviewed by Noam Rosenthal.
Currently, the painting thread uses purgeGLResources() and setActive().
QQuickWebPage::updatePaintNode() indirectly calls both methods after
locking the main thread.
This patch changes two points.
1. Remove ASSERT(isMainThread()) in methods that the painting thread can
call.
2. Make purgeGLResources() and setActive() call methods of
LayerTreeCoordinatorProxy via dispatchOnMainThread().
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::LayerTreeRenderer):
(WebKit::LayerTreeRenderer::renderNextFrame):
(WebKit::LayerTreeRenderer::purgeGLResources):
(WebKit):
(WebKit::LayerTreeRenderer::purgeBackingStores):
(WebKit::LayerTreeRenderer::setActive):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (135615 => 135616)
--- trunk/Source/WebKit2/ChangeLog 2012-11-23 16:27:30 UTC (rev 135615)
+++ trunk/Source/WebKit2/ChangeLog 2012-11-23 16:37:40 UTC (rev 135616)
@@ -1,3 +1,30 @@
+2012-11-23 Huang Dongsung <[email protected]>
+
+ REGRESSION(r135486): ASSERT(isMainThread()) hit in LayerTreeRenderer::setActive(bool)
+ https://bugs.webkit.org/show_bug.cgi?id=103077
+
+ Reviewed by Noam Rosenthal.
+
+ Currently, the painting thread uses purgeGLResources() and setActive().
+ QQuickWebPage::updatePaintNode() indirectly calls both methods after
+ locking the main thread.
+
+ This patch changes two points.
+ 1. Remove ASSERT(isMainThread()) in methods that the painting thread can
+ call.
+ 2. Make purgeGLResources() and setActive() call methods of
+ LayerTreeCoordinatorProxy via dispatchOnMainThread().
+
+ * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+ (WebKit::LayerTreeRenderer::LayerTreeRenderer):
+ (WebKit::LayerTreeRenderer::renderNextFrame):
+ (WebKit::LayerTreeRenderer::purgeGLResources):
+ (WebKit):
+ (WebKit::LayerTreeRenderer::purgeBackingStores):
+ (WebKit::LayerTreeRenderer::setActive):
+ * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
+ (LayerTreeRenderer):
+
2012-11-23 Christophe Dumez <[email protected]>
[EFL][WK2][AC] EwkViewImpl::transformToScreen() does not retrieve the Ecore_X_Window properly
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (135615 => 135616)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp 2012-11-23 16:27:30 UTC (rev 135615)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp 2012-11-23 16:37:40 UTC (rev 135616)
@@ -68,8 +68,8 @@
LayerTreeRenderer::LayerTreeRenderer(LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy)
: m_layerTreeCoordinatorProxy(layerTreeCoordinatorProxy)
+ , m_isActive(false)
, m_rootLayerID(InvalidWebLayerID)
- , m_isActive(false)
, m_animationsLocked(false)
#if ENABLE(REQUEST_ANIMATION_FRAME)
, m_animationFrameRequested(false)
@@ -550,7 +550,6 @@
void LayerTreeRenderer::renderNextFrame()
{
- ASSERT(isMainThread());
if (m_layerTreeCoordinatorProxy)
m_layerTreeCoordinatorProxy->renderNextFrame();
}
@@ -593,7 +592,6 @@
void LayerTreeRenderer::purgeGLResources()
{
- ASSERT(isMainThread());
TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
if (layer)
@@ -613,6 +611,11 @@
m_backingStoresWithPendingBuffers.clear();
setActive(false);
+ dispatchOnMainThread(bind(&LayerTreeRenderer::purgeBackingStores, this));
+}
+
+void LayerTreeRenderer::purgeBackingStores()
+{
if (m_layerTreeCoordinatorProxy)
m_layerTreeCoordinatorProxy->purgeBackingStores();
}
@@ -659,7 +662,6 @@
void LayerTreeRenderer::setActive(bool active)
{
- ASSERT(isMainThread());
if (m_isActive == active)
return;
@@ -669,7 +671,7 @@
m_renderQueue.clear();
m_isActive = active;
if (m_isActive)
- renderNextFrame();
+ dispatchOnMainThread(bind(&LayerTreeRenderer::renderNextFrame, this));
}
void LayerTreeRenderer::setBackgroundColor(const WebCore::Color& color)
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h (135615 => 135616)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h 2012-11-23 16:27:30 UTC (rev 135615)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h 2012-11-23 16:37:40 UTC (rev 135616)
@@ -67,7 +67,6 @@
};
explicit LayerTreeRenderer(LayerTreeCoordinatorProxy*);
virtual ~LayerTreeRenderer();
- void purgeGLResources();
void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&, WebCore::TextureMapper::PaintFlags = 0);
void paintToGraphicsContext(BackingStore::PlatformGraphicsContext);
void setContentsSize(const WebCore::FloatSize&);
@@ -81,6 +80,10 @@
void detach();
void appendUpdate(const Function<void()>&);
+
+ // The painting thread must lock the main thread to use below two methods, because two methods access members that the main thread manages. See m_layerTreeCoordinatorProxy.
+ // Currently, QQuickWebPage::updatePaintNode() locks the main thread before calling both methods.
+ void purgeGLResources();
void setActive(bool);
void deleteLayer(WebLayerID);
@@ -111,7 +114,6 @@
#if ENABLE(REQUEST_ANIMATION_FRAME)
void requestAnimationFrame();
- void animationFrameReady();
#endif
private:
@@ -121,22 +123,27 @@
WebCore::GraphicsLayer* rootLayer() { return m_rootLayer.get(); }
void syncRemoteContent();
+ void adjustPositionForFixedLayers();
// Reimplementations from WebCore::GraphicsLayerClient.
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double) { }
virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) { }
virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect&) OVERRIDE { }
+ void dispatchOnMainThread(const Function<void()>&);
void updateViewport();
- void dispatchOnMainThread(const Function<void()>&);
- void adjustPositionForFixedLayers();
+#if ENABLE(REQUEST_ANIMATION_FRAME)
+ void animationFrameReady();
+#endif
+ void renderNextFrame();
+ void purgeBackingStores();
+
void assignImageBackingToLayer(WebCore::GraphicsLayer*, CoordinatedImageBackingID);
void removeReleasedImageBackingsIfNeeded();
void ensureRootLayer();
void ensureLayer(WebLayerID);
void commitTileOperations();
- void renderNextFrame();
PassRefPtr<CoordinatedBackingStore> getBackingStore(WebCore::GraphicsLayer*);
void removeBackingStoreIfNeeded(WebCore::GraphicsLayer*);
@@ -163,7 +170,10 @@
SurfaceBackingStoreMap m_surfaceBackingStores;
#endif
+ // Below two members are accessed by only the main thread. The painting thread must lock the main thread to access both members.
LayerTreeCoordinatorProxy* m_layerTreeCoordinatorProxy;
+ bool m_isActive;
+
OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
LayerMap m_layers;
@@ -171,7 +181,6 @@
WebLayerID m_rootLayerID;
WebCore::IntPoint m_renderedContentsScrollPosition;
WebCore::IntPoint m_pendingRenderedContentsScrollPosition;
- bool m_isActive;
bool m_animationsLocked;
#if ENABLE(REQUEST_ANIMATION_FRAME)
bool m_animationFrameRequested;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes