Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1147)

Unified Diff: Source/core/inspector/InspectorLayerTreeAgent.cpp

Issue 684373003: Fixing crashes in layout tests when virtual-viewport is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorLayerTreeAgent.cpp
diff --git a/Source/core/inspector/InspectorLayerTreeAgent.cpp b/Source/core/inspector/InspectorLayerTreeAgent.cpp
index d6feff82b7e083ca9f16c59069e242b2f13a70f1..acdea584135b631a58662e8c9cf400672f280fee 100644
--- a/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -34,7 +34,9 @@
#include "core/inspector/InspectorLayerTreeAgent.h"
#include "core/dom/Document.h"
+#include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/inspector/IdentifiersFactory.h"
#include "core/inspector/InspectorNodeIds.h"
#include "core/inspector/InspectorState.h"
@@ -221,7 +223,7 @@ PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > InspectorLayerTre
LayerIdToNodeIdMap layerIdToNodeIdMap;
RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > layers = TypeBuilder::Array<TypeBuilder::LayerTree::Layer>::create();
buildLayerIdToNodeIdMap(compositor->rootRenderLayer(), layerIdToNodeIdMap);
- gatherGraphicsLayers(compositor->rootGraphicsLayer(), layerIdToNodeIdMap, layers);
+ gatherGraphicsLayers(rootGraphicsLayer(), layerIdToNodeIdMap, layers);
return layers.release();
}
@@ -268,6 +270,14 @@ RenderLayerCompositor* InspectorLayerTreeAgent::renderLayerCompositor()
return compositor;
}
+GraphicsLayer* InspectorLayerTreeAgent::rootGraphicsLayer()
+{
+ if (m_page->settings().pinchVirtualViewportEnabled())
+ return m_page->frameHost().pinchViewport().rootGraphicsLayer();
+
+ return renderLayerCompositor()->rootGraphicsLayer();
+}
+
static GraphicsLayer* findLayerById(GraphicsLayer* root, int layerId)
{
if (root->platformLayer()->id() == layerId)
@@ -297,7 +307,7 @@ GraphicsLayer* InspectorLayerTreeAgent::layerById(ErrorString* errorString, cons
return 0;
}
- GraphicsLayer* result = findLayerById(compositor->rootGraphicsLayer(), id);
+ GraphicsLayer* result = findLayerById(rootGraphicsLayer(), id);
if (!result)
*errorString = "No layer matching given id found";
return result;
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698