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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 1855013002: cc : Stop calculating visible rects on main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 925
926 gfx::Transform identity_transform; 926 gfx::Transform identity_transform;
927 LayerList update_layer_list; 927 LayerList update_layer_list;
928 928
929 { 929 {
930 TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::BuildPropertyTrees"); 930 TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::BuildPropertyTrees");
931 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"), 931 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
932 "LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees"); 932 "LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees");
933 LayerTreeHostCommon::PreCalculateMetaInformation(root_layer); 933 LayerTreeHostCommon::PreCalculateMetaInformation(root_layer);
934 bool can_render_to_separate_surface = true; 934 bool can_render_to_separate_surface = true;
935 draw_property_utils::BuildPropertyTreesAndComputeVisibleRects( 935 PropertyTreeBuilder::BuildPropertyTrees(
936 root_layer, page_scale_layer, inner_viewport_scroll_layer_.get(), 936 root_layer, page_scale_layer, inner_viewport_scroll_layer_.get(),
937 outer_viewport_scroll_layer_.get(), overscroll_elasticity_layer_.get(), 937 outer_viewport_scroll_layer_.get(), overscroll_elasticity_layer_.get(),
938 elastic_overscroll_, page_scale_factor_, device_scale_factor_, 938 elastic_overscroll_, page_scale_factor_, device_scale_factor_,
939 gfx::Rect(device_viewport_size_), identity_transform, 939 gfx::Rect(device_viewport_size_), identity_transform, &property_trees_);
940 can_render_to_separate_surface, &property_trees_, &update_layer_list); 940 draw_property_utils::UpdateRenderSurfaces(root_layer, &property_trees_);
941 draw_property_utils::UpdatePropertyTrees(&property_trees_,
942 can_render_to_separate_surface);
943 draw_property_utils::FindLayersThatNeedUpdates(
944 root_layer, property_trees_.transform_tree, property_trees_.effect_tree,
945 &update_layer_list);
941 } 946 }
942 947
943 for (const auto& layer : update_layer_list) 948 for (const auto& layer : update_layer_list)
944 layer->SavePaintProperties(); 949 layer->SavePaintProperties();
945 950
946 base::AutoReset<bool> painting(&in_paint_layer_contents_, true); 951 base::AutoReset<bool> painting(&in_paint_layer_contents_, true);
947 bool did_paint_content = false; 952 bool did_paint_content = false;
948 for (const auto& layer : update_layer_list) { 953 for (const auto& layer : update_layer_list) {
949 did_paint_content |= layer->Update(); 954 did_paint_content |= layer->Update();
950 content_is_suitable_for_gpu_rasterization_ &= 955 content_is_suitable_for_gpu_rasterization_ &=
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 int seq_num = property_trees_.sequence_number; 1574 int seq_num = property_trees_.sequence_number;
1570 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { 1575 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) {
1571 layer->set_property_tree_sequence_number(seq_num); 1576 layer->set_property_tree_sequence_number(seq_num);
1572 }); 1577 });
1573 1578
1574 surface_id_namespace_ = proto.surface_id_namespace(); 1579 surface_id_namespace_ = proto.surface_id_namespace();
1575 next_surface_sequence_ = proto.next_surface_sequence(); 1580 next_surface_sequence_ = proto.next_surface_sequence();
1576 } 1581 }
1577 1582
1578 } // namespace cc 1583 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698