diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-09-22 18:03:13 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-09-24 16:02:56 +0200 |
commit | 3df57f7e550a19cb4450ed3896aa51ddb38c2ed2 (patch) | |
tree | b421e1fbfcb214cee83953d68e20748160aa4fa4 | |
parent | d34ae1d6603354119fb1687a59dc48560e27de82 (diff) | |
download | qtwebkit-3df57f7e550a19cb4450ed3896aa51ddb38c2ed2.tar.gz |
Avoid crashing when QtQuick destroys our SG node and GL context
Keep the layers on the UI process but make sure that the backing
stores are destroyed both on the UI and Web processes.
Add a check for m_isPurging in CoordinatedGraphicsLayer::removeTile
to make sure that we don't tell the UI process to remove tiles that
it purged itself, in a similar way to what we do in
CompositingCoordinator::removeUpdateAtlas.
Also make sure that we wait for the next m_isWaitingForRenderer
after we've purged the backing stores in CoordinatedLayerTreeHost
to wait for a QtWebPageSGNode to be available like we do right after
a page's construction and avoid sending update that would be
ignored by an unactive CoordinatedGraphicsScene.
Task-number: QTBUG-40734
Change-Id: I059f1de2ce2a8d9d70ab2cd8c3252a469ebf036e
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
4 files changed, 4 insertions, 10 deletions
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp index 7e70bbb0d..d409d9a65 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp @@ -36,9 +36,7 @@ #include "TextureMapperPlatformLayer.h" #include <wtf/CurrentTime.h> #include <wtf/HashMap.h> -#ifndef NDEBUG #include <wtf/TemporaryChange.h> -#endif #include <wtf/text/CString.h> namespace WebCore { @@ -102,9 +100,7 @@ void CoordinatedGraphicsLayer::didChangeGeometry() CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(GraphicsLayerClient* client) : GraphicsLayer(client) -#ifndef NDEBUG , m_isPurging(false) -#endif , m_shouldUpdateVisibleRect(true) , m_shouldSyncLayerState(true) , m_shouldSyncChildren(true) @@ -996,6 +992,8 @@ void CoordinatedGraphicsLayer::removeTile(uint32_t tileID) { ASSERT(m_coordinator); ASSERT(m_coordinator->isFlushingLayerChanges() || m_isPurging); + if (m_isPurging) + return; m_layerState.tilesToRemove.append(tileID); } @@ -1047,9 +1045,7 @@ void CoordinatedGraphicsLayer::updateContentBuffers() void CoordinatedGraphicsLayer::purgeBackingStores() { -#ifndef NDEBUG TemporaryChange<bool> updateModeProtector(m_isPurging, true); -#endif m_mainBackingStore.clear(); m_previousBackingStore.clear(); diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h index cfbc2135d..0c7ef5daf 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h @@ -218,9 +218,7 @@ private: FloatPoint m_adjustedPosition; FloatPoint3D m_adjustedAnchorPoint; -#ifndef NDEBUG bool m_isPurging; -#endif bool m_shouldUpdateVisibleRect: 1; bool m_shouldSyncLayerState: 1; bool m_shouldSyncChildren: 1; diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp index 32c7dace4..acd382cdb 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp @@ -690,8 +690,6 @@ void CoordinatedGraphicsScene::purgeGLResources() m_rootLayer.clear(); m_rootLayerID = InvalidCoordinatedLayerID; - m_layers.clear(); - m_fixedLayers.clear(); m_textureMapper.clear(); m_backingStores.clear(); m_backingStoresWithPendingBuffers.clear(); diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp index 4d8210329..fa6f276b7 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp @@ -212,6 +212,8 @@ void CoordinatedLayerTreeHost::renderNextFrame() void CoordinatedLayerTreeHost::purgeBackingStores() { + // Wait for CoordinatedGraphicsScene::setActive(true) to be called. + m_isWaitingForRenderer = true; m_coordinator->purgeBackingStores(); } |