Commit b0177cb0 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

[BlinkGenPropertyTrees] Do not emit UpdateLayers::BuildPropertyTrees

This patch removes UpdateLayers::BuildPropertyTrees trace events when in
layer lists mode which is used by blink gen property trees and slimming
paint v2. This patch also cleans up LayerTreeHost::DoUpdateLayers by
removing the unused in_update_property_trees_ variable.

Bug: 836886

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux-blink-gen-property-trees;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I35e6bd7c59b0384d8c2c62a1d3bdb1eed152353b
Reviewed-on: https://chromium-review.googlesource.com/1176357Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583448}
parent 4d20736e
...@@ -738,30 +738,28 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { ...@@ -738,30 +738,28 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
gfx::Transform identity_transform; gfx::Transform identity_transform;
LayerList update_layer_list; LayerList update_layer_list;
{ // The non-layer-list mode is used when blink provides cc with a layer tree
base::AutoReset<bool> update_property_trees(&in_update_property_trees_, // and cc needs to compute property trees from that.
true); // In layer lists mode, blink sends cc property trees directly so they do not
// need to be built here. Layer lists mode is used by BlinkGenPropertyTrees
// and SlimmingPaintV2.
if (!IsUsingLayerLists()) {
TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::BuildPropertyTrees"); TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::BuildPropertyTrees");
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
"LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees"); "LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees");
PropertyTrees* property_trees = &property_trees_; PropertyTreeBuilder::BuildPropertyTrees(
if (!IsUsingLayerLists()) { root_layer, page_scale_layer, inner_viewport_scroll_layer(),
// In SPv2 the property trees should have been built by the outer_viewport_scroll_layer(), overscroll_elasticity_layer(),
// client already. elastic_overscroll_, page_scale_factor_, device_scale_factor_,
PropertyTreeBuilder::BuildPropertyTrees( gfx::Rect(device_viewport_size_), identity_transform, &property_trees_);
root_layer, page_scale_layer, inner_viewport_scroll_layer(), TRACE_EVENT_INSTANT1("cc", "LayerTreeHost::UpdateLayers_BuiltPropertyTrees",
outer_viewport_scroll_layer(), overscroll_elasticity_layer(), TRACE_EVENT_SCOPE_THREAD, "property_trees",
elastic_overscroll_, page_scale_factor_, device_scale_factor_, property_trees_.AsTracedValue());
gfx::Rect(device_viewport_size_), identity_transform, property_trees);
TRACE_EVENT_INSTANT1("cc",
"LayerTreeHost::UpdateLayers_BuiltPropertyTrees",
TRACE_EVENT_SCOPE_THREAD, "property_trees",
property_trees->AsTracedValue());
} else { } else {
TRACE_EVENT_INSTANT1("cc", TRACE_EVENT_INSTANT1("cc",
"LayerTreeHost::UpdateLayers_ReceivedPropertyTrees", "LayerTreeHost::UpdateLayers_ReceivedPropertyTrees",
TRACE_EVENT_SCOPE_THREAD, "property_trees", TRACE_EVENT_SCOPE_THREAD, "property_trees",
property_trees->AsTracedValue()); property_trees_.AsTracedValue());
} }
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
...@@ -779,8 +777,8 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { ...@@ -779,8 +777,8 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
} }
#endif #endif
draw_property_utils::UpdatePropertyTrees(this, property_trees); draw_property_utils::UpdatePropertyTrees(this, &property_trees_);
draw_property_utils::FindLayersThatNeedUpdates(this, property_trees, draw_property_utils::FindLayersThatNeedUpdates(this, &property_trees_,
&update_layer_list); &update_layer_list);
// Dump property trees useful for debugging --blink-gen-property-trees // Dump property trees useful for debugging --blink-gen-property-trees
...@@ -789,7 +787,7 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { ...@@ -789,7 +787,7 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
VLOG(3) << "CC Property Trees:"; VLOG(3) << "CC Property Trees:";
std::string out; std::string out;
base::JSONWriter::WriteWithOptions( base::JSONWriter::WriteWithOptions(
*property_trees->AsTracedValue()->ToBaseValue(), *property_trees_.AsTracedValue()->ToBaseValue(),
base::JSONWriter::OPTIONS_PRETTY_PRINT, &out); base::JSONWriter::OPTIONS_PRETTY_PRINT, &out);
std::stringstream ss(out); std::stringstream ss(out);
while (!ss.eof()) { while (!ss.eof()) {
...@@ -798,7 +796,6 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { ...@@ -798,7 +796,6 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
VLOG(3) << line; VLOG(3) << line;
} }
} }
}
bool painted_content_has_slow_paths = false; bool painted_content_has_slow_paths = false;
bool painted_content_has_non_aa_paint = false; bool painted_content_has_non_aa_paint = false;
......
...@@ -382,7 +382,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient { ...@@ -382,7 +382,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
void UnregisterLayer(Layer* layer); void UnregisterLayer(Layer* layer);
Layer* LayerById(int id) const; Layer* LayerById(int id) const;
bool in_update_property_trees() const { return in_update_property_trees_; }
bool PaintContent(const LayerList& update_layer_list, bool PaintContent(const LayerList& update_layer_list,
bool* content_has_slow_paths, bool* content_has_slow_paths,
bool* content_has_non_aa_paint); bool* content_has_non_aa_paint);
...@@ -701,7 +700,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient { ...@@ -701,7 +700,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_; std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_;
bool in_paint_layer_contents_ = false; bool in_paint_layer_contents_ = false;
bool in_update_property_trees_ = false;
// This is true if atleast one layer in the layer tree has a copy request. We // This is true if atleast one layer in the layer tree has a copy request. We
// use this bool to decide whether we need to compute subtree has copy request // use this bool to decide whether we need to compute subtree has copy request
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment