Title: [114705] trunk/Source/WebKit2
Revision
114705
Author
[email protected]
Date
2012-04-19 17:37:02 -0700 (Thu, 19 Apr 2012)

Log Message

[Qt] ASSERT(m_thread == currentThread()) on Mac when threaded rendering is enabled for the Qt scenegraph
https://bugs.webkit.org/show_bug.cgi?id=84278

Reviewed by Noam Rosenthal.

Delete the whole layer tree on UI side when paint node is deleted and force resync of the layers when
page becomes visible again.

* UIProcess/LayerTreeHostProxy.cpp:
(WebKit::LayerTreeHostProxy::purgeBackingStores):
* UIProcess/WebLayerTreeRenderer.cpp:
(WebKit::WebLayerTreeRenderer::WebLayerTreeRenderer):
(WebKit::WebLayerTreeRenderer::purgeGLResources):
(WebKit::WebLayerTreeRenderer::appendUpdate):
(WebKit::WebLayerTreeRenderer::setActive):
(WebKit):
* UIProcess/WebLayerTreeRenderer.h:
(WebLayerTreeRenderer):
* UIProcess/qt/QtWebPageSGNode.cpp:
(WebKit::ContentsSGNode::ContentsSGNode):
* WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
(WebCore::WebGraphicsLayer::purgeBackingStores):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (114704 => 114705)


--- trunk/Source/WebKit2/ChangeLog	2012-04-20 00:33:11 UTC (rev 114704)
+++ trunk/Source/WebKit2/ChangeLog	2012-04-20 00:37:02 UTC (rev 114705)
@@ -1,3 +1,28 @@
+2012-04-19  Viatcheslav Ostapenko  <[email protected]>
+
+        [Qt] ASSERT(m_thread == currentThread()) on Mac when threaded rendering is enabled for the Qt scenegraph
+        https://bugs.webkit.org/show_bug.cgi?id=84278
+
+        Reviewed by Noam Rosenthal.
+
+        Delete the whole layer tree on UI side when paint node is deleted and force resync of the layers when
+        page becomes visible again.
+
+        * UIProcess/LayerTreeHostProxy.cpp:
+        (WebKit::LayerTreeHostProxy::purgeBackingStores):
+        * UIProcess/WebLayerTreeRenderer.cpp:
+        (WebKit::WebLayerTreeRenderer::WebLayerTreeRenderer):
+        (WebKit::WebLayerTreeRenderer::purgeGLResources):
+        (WebKit::WebLayerTreeRenderer::appendUpdate):
+        (WebKit::WebLayerTreeRenderer::setActive):
+        (WebKit):
+        * UIProcess/WebLayerTreeRenderer.h:
+        (WebLayerTreeRenderer):
+        * UIProcess/qt/QtWebPageSGNode.cpp:
+        (WebKit::ContentsSGNode::ContentsSGNode):
+        * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+        (WebCore::WebGraphicsLayer::purgeBackingStores):
+
 2012-04-19  Vivek Galatage  <[email protected]>
 
         DevTools: assertion failure upon devtools window reopen.

Modified: trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp (114704 => 114705)


--- trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp	2012-04-20 00:33:11 UTC (rev 114704)
+++ trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp	2012-04-20 00:37:02 UTC (rev 114705)
@@ -134,6 +134,7 @@
 
 void LayerTreeHostProxy::purgeBackingStores()
 {
+    m_renderer->setActive(false);
     m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::PurgeBackingStores(), m_drawingAreaProxy->page()->pageID());
 }
 

Modified: trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp (114704 => 114705)


--- trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp	2012-04-20 00:33:11 UTC (rev 114704)
+++ trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp	2012-04-20 00:37:02 UTC (rev 114705)
@@ -86,7 +86,8 @@
 
 WebLayerTreeRenderer::WebLayerTreeRenderer(LayerTreeHostProxy* layerTreeHostProxy)
     : m_layerTreeHostProxy(layerTreeHostProxy)
-    , m_rootLayerID(0)
+    , m_rootLayerID(InvalidWebLayerID)
+    , m_isActive(false)
 {
 }
 
@@ -400,6 +401,12 @@
         layer->clearBackingStoresRecursive();
 
     m_directlyCompositedImages.clear();
+
+    m_rootLayer->removeAllChildren();
+    m_rootLayer.clear();
+    m_rootLayerID = InvalidWebLayerID;
+    m_layers.clear();
+    m_fixedLayers.clear();
     m_textureMapper.clear();
     m_backingStoresWithPendingBuffers.clear();
 
@@ -419,9 +426,24 @@
 
 void WebLayerTreeRenderer::appendUpdate(const Function<void()>& function)
 {
+    if (!m_isActive)
+        return;
+
     m_renderQueue.append(function);
 }
 
+void WebLayerTreeRenderer::setActive(bool active)
+{
+    if (m_isActive == active)
+        return;
+
+    // Have to clear render queue in both cases.
+    // If there are some updates in queue during activation then those updates are from previous instance of paint node
+    // and cannot be applied to the newly created instance.
+    m_renderQueue.clear();
+    m_isActive = active;
+}
+
 } // namespace WebKit
 
 #endif // USE(UI_SIDE_COMPOSITING)

Modified: trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h (114704 => 114705)


--- trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h	2012-04-20 00:33:11 UTC (rev 114704)
+++ trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h	2012-04-20 00:37:02 UTC (rev 114705)
@@ -71,6 +71,7 @@
     void detach();
     void appendUpdate(const Function<void()>&);
     void updateViewport();
+    void setActive(bool);
 
     void deleteLayer(WebLayerID);
     void setRootLayerID(WebLayerID);
@@ -132,6 +133,7 @@
     WebLayerID m_rootLayerID;
     WebCore::IntPoint m_renderedContentsScrollPosition;
     WebCore::IntPoint m_pendingRenderedContentsScrollPosition;
+    bool m_isActive;
 };
 
 };

Modified: trunk/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp (114704 => 114705)


--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp	2012-04-20 00:33:11 UTC (rev 114704)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp	2012-04-20 00:37:02 UTC (rev 114705)
@@ -35,6 +35,7 @@
     ContentsSGNode(PassRefPtr<WebLayerTreeRenderer> renderer)
         : m_renderer(renderer)
     {
+        layerTreeRenderer()->setActive(true);
     }
 
     virtual StateFlags changedStates()

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp (114704 => 114705)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp	2012-04-20 00:33:11 UTC (rev 114704)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp	2012-04-20 00:37:02 UTC (rev 114705)
@@ -609,6 +609,9 @@
         m_webGraphicsLayerClient->releaseImageBackingStore(m_layerInfo.imageBackingStoreID);
         m_layerInfo.imageBackingStoreID = 0;
     }
+
+    didChangeLayerState();
+    didChangeChildren();
 }
 
 void WebGraphicsLayer::setWebGraphicsLayerClient(WebKit::WebGraphicsLayerClient* client)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to