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

Side by Side Diff: cc/layers/layer.cc

Issue 2225973003: cc: Remove usage of ComputeVisibleRects on main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and fix perf regressions Created 4 years, 4 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/layers/layer.h ('k') | cc/trees/draw_property_utils.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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layers/layer.h" 5 #include "cc/layers/layer.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 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 978
979 int Layer::effect_tree_index() const { 979 int Layer::effect_tree_index() const {
980 if (!layer_tree_host_ || 980 if (!layer_tree_host_ ||
981 layer_tree_host_->property_trees()->sequence_number != 981 layer_tree_host_->property_trees()->sequence_number !=
982 property_tree_sequence_number_) { 982 property_tree_sequence_number_) {
983 return EffectTree::kInvalidNodeId; 983 return EffectTree::kInvalidNodeId;
984 } 984 }
985 return effect_tree_index_; 985 return effect_tree_index_;
986 } 986 }
987 987
988 int Layer::render_target_effect_tree_index() const {
989 EffectNode* effect_node =
990 layer_tree_host_->property_trees()->effect_tree.Node(effect_tree_index_);
991 if (effect_node->has_render_surface)
992 return effect_node->id;
993 else
994 return effect_node->target_id;
995 }
996
997 void Layer::SetScrollTreeIndex(int index) { 988 void Layer::SetScrollTreeIndex(int index) {
998 DCHECK(IsPropertyChangeAllowed()); 989 DCHECK(IsPropertyChangeAllowed());
999 if (scroll_tree_index_ == index) 990 if (scroll_tree_index_ == index)
1000 return; 991 return;
1001 scroll_tree_index_ = index; 992 scroll_tree_index_ = index;
1002 SetNeedsPushProperties(); 993 SetNeedsPushProperties();
1003 } 994 }
1004 995
1005 int Layer::scroll_tree_index() const { 996 int Layer::scroll_tree_index() const {
1006 if (!layer_tree_host_ || 997 if (!layer_tree_host_ ||
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); 1882 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId);
1892 return draw_property_utils::ScreenSpaceTransform( 1883 return draw_property_utils::ScreenSpaceTransform(
1893 this, layer_tree_host_->property_trees()->transform_tree); 1884 this, layer_tree_host_->property_trees()->transform_tree);
1894 } 1885 }
1895 1886
1896 LayerTree* Layer::GetLayerTree() const { 1887 LayerTree* Layer::GetLayerTree() const {
1897 return layer_tree_; 1888 return layer_tree_;
1898 } 1889 }
1899 1890
1900 } // namespace cc 1891 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.h ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698