Skip to content

Commit

Permalink
[BlinkGenPropertyTrees] Do not emit UpdateLayers::BuildPropertyTrees
Browse files Browse the repository at this point in the history
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/1176357
Reviewed-by: enne <[email protected]>
Commit-Queue: Philip Rogers <[email protected]>
Cr-Commit-Position: refs/heads/master@{#583448}
  • Loading branch information
progers authored and Commit Bot committed Aug 15, 2018
1 parent 4d20736 commit b0177cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
39 changes: 18 additions & 21 deletions cc/trees/layer_tree_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -738,30 +738,28 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
gfx::Transform identity_transform;
LayerList update_layer_list;

{
base::AutoReset<bool> update_property_trees(&in_update_property_trees_,
true);
// The non-layer-list mode is used when blink provides cc with a layer tree
// and cc needs to compute property trees from that.
// 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(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
"LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees");
PropertyTrees* property_trees = &property_trees_;
if (!IsUsingLayerLists()) {
// In SPv2 the property trees should have been built by the
// client already.
PropertyTreeBuilder::BuildPropertyTrees(
root_layer, page_scale_layer, inner_viewport_scroll_layer(),
outer_viewport_scroll_layer(), overscroll_elasticity_layer(),
elastic_overscroll_, page_scale_factor_, device_scale_factor_,
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());
PropertyTreeBuilder::BuildPropertyTrees(
root_layer, page_scale_layer, inner_viewport_scroll_layer(),
outer_viewport_scroll_layer(), overscroll_elasticity_layer(),
elastic_overscroll_, page_scale_factor_, device_scale_factor_,
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 {
TRACE_EVENT_INSTANT1("cc",
"LayerTreeHost::UpdateLayers_ReceivedPropertyTrees",
TRACE_EVENT_SCOPE_THREAD, "property_trees",
property_trees->AsTracedValue());
property_trees_.AsTracedValue());
}

#if DCHECK_IS_ON()
Expand All @@ -779,8 +777,8 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
}
#endif

draw_property_utils::UpdatePropertyTrees(this, property_trees);
draw_property_utils::FindLayersThatNeedUpdates(this, property_trees,
draw_property_utils::UpdatePropertyTrees(this, &property_trees_);
draw_property_utils::FindLayersThatNeedUpdates(this, &property_trees_,
&update_layer_list);

// Dump property trees useful for debugging --blink-gen-property-trees
Expand All @@ -789,7 +787,7 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
VLOG(3) << "CC Property Trees:";
std::string out;
base::JSONWriter::WriteWithOptions(
*property_trees->AsTracedValue()->ToBaseValue(),
*property_trees_.AsTracedValue()->ToBaseValue(),
base::JSONWriter::OPTIONS_PRETTY_PRINT, &out);
std::stringstream ss(out);
while (!ss.eof()) {
Expand All @@ -798,7 +796,6 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
VLOG(3) << line;
}
}
}

bool painted_content_has_slow_paths = false;
bool painted_content_has_non_aa_paint = false;
Expand Down
2 changes: 0 additions & 2 deletions cc/trees/layer_tree_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
void UnregisterLayer(Layer* layer);
Layer* LayerById(int id) const;

bool in_update_property_trees() const { return in_update_property_trees_; }
bool PaintContent(const LayerList& update_layer_list,
bool* content_has_slow_paths,
bool* content_has_non_aa_paint);
Expand Down Expand Up @@ -701,7 +700,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_;

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
// use this bool to decide whether we need to compute subtree has copy request
Expand Down

0 comments on commit b0177cb

Please sign in to comment.