Skip to content

Commit

Permalink
Merged PR 64: CCLayerTree: Add extended fields to inspect the copied …
Browse files Browse the repository at this point in the history
…parts of the layer tree for the impl thread

- Adds an extended field to retrieve the LayerTreeHostImpl (layer tree host equivalent for the impl thread) from a LayerTreeHost.
 - Adds an extended field to retrieve the sync tree (either the active or pending LayerTreeImpl) from a LayerTreeHostImpl.
 - Adds an extended field to retrieve the LayerImpl (layer equivalent for the impl thread) from a Layer.
  • Loading branch information
sanketj committed Mar 1, 2019
1 parent 3144713 commit 65fdd16
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion extensions/target-specific/chromium/cclayertree/cclayertree.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ Loader.OnLoad(function() {
return TreeInspector.GetActions("cclayertree", "CCLayerTree", layer);
});

DbgObject.AddExtendedField(Chromium.RendererProcessType("cc::LayerTreeHost"), "layer_tree_host_impl_", Chromium.RendererProcessType("cc::LayerTreeHostImpl"), UserEditableFunctions.Create((layerTreeHost) => {
return layerTreeHost.f("proxy_").F("Object").vcast().f("proxy_impl_").F("Object").f("host_impl_").F("Object");
}));

DbgObject.AddExtendedField(Chromium.RendererProcessType("cc::LayerTreeHostImpl"), "sync_tree_", Chromium.RendererProcessType("cc::LayerTreeImpl"), UserEditableFunctions.Create((layerTreeHostImpl) => {
return layerTreeHostImpl.f("settings_").f("commit_to_active_tree").val()
.then((commitToActiveTree) => commitToActiveTree ? layerTreeHostImpl.f("active_tree_").F("Object") : layerTreeHostImpl.f("pending_tree_").F("Object"));
}));

DbgObject.AddExtendedField(Chromium.RendererProcessType("cc::Layer"), "layer_impl_", Chromium.RendererProcessType("cc::LayerImpl"), UserEditableFunctions.Create((layer) => {
return layer.f("layer_tree_host_").F("layer_tree_host_impl_").F("sync_tree_").f("layers_").F("Object").array("Elements").filter((layerImpl) => {
return Promise.all([layer.desc("layer_id_"), layerImpl.F("Object").f("layer_id_").val()])
.thenAll((layerId, layerImplId) => layerId == layerImplId);
})
.then((layerImpl) => {
console.assert(layerImpl.length <= 1);
return (layerImpl.length == 1) ? layerImpl[0].F("Object").vcast() : DbgObject.NULL;
});
}));

DbgObject.AddTypeDescription(
Chromium.RendererProcessType("cc::Layer"),
"bounds",
Expand All @@ -65,7 +85,7 @@ Loader.OnLoad(function() {

DbgObject.AddTypeDescription(
Chromium.RendererProcessType("cc::Layer"),
"layer_id",
"layer_id_",
false,
UserEditableFunctions.Create((layer) => layer.f("inputs_").f("layer_id").val())
);
Expand Down

0 comments on commit 65fdd16

Please sign in to comment.