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

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

Issue 2957373002: cc: Don't touch layer state during painting. (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | no next file » | 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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 DCHECK(IsPropertyChangeAllowed()); 934 DCHECK(IsPropertyChangeAllowed());
935 if (id == inputs_.sorting_context_id) 935 if (id == inputs_.sorting_context_id)
936 return; 936 return;
937 inputs_.sorting_context_id = id; 937 inputs_.sorting_context_id = id;
938 SetNeedsCommit(); 938 SetNeedsCommit();
939 SetPropertyTreesNeedRebuild(); 939 SetPropertyTreesNeedRebuild();
940 SetSubtreePropertyChanged(); 940 SetSubtreePropertyChanged();
941 } 941 }
942 942
943 void Layer::SetTransformTreeIndex(int index) { 943 void Layer::SetTransformTreeIndex(int index) {
944 DCHECK(IsPropertyChangeAllowed()); 944 CHECK(IsPropertyChangeAllowed());
945 if (transform_tree_index_ == index) 945 if (transform_tree_index_ == index)
946 return; 946 return;
947 transform_tree_index_ = index; 947 transform_tree_index_ = index;
948 SetNeedsPushProperties(); 948 SetNeedsPushProperties();
949 } 949 }
950 950
951 int Layer::transform_tree_index() const { 951 int Layer::transform_tree_index() const {
952 if (!layer_tree_host_ || 952 if (!layer_tree_host_ ||
953 layer_tree_host_->property_trees()->sequence_number != 953 layer_tree_host_->property_trees()->sequence_number !=
954 property_tree_sequence_number_) { 954 property_tree_sequence_number_) {
955 return TransformTree::kInvalidNodeId; 955 return TransformTree::kInvalidNodeId;
956 } 956 }
957 return transform_tree_index_; 957 return transform_tree_index_;
958 } 958 }
959 959
960 void Layer::SetClipTreeIndex(int index) { 960 void Layer::SetClipTreeIndex(int index) {
961 DCHECK(IsPropertyChangeAllowed()); 961 CHECK(IsPropertyChangeAllowed());
962 if (clip_tree_index_ == index) 962 if (clip_tree_index_ == index)
963 return; 963 return;
964 clip_tree_index_ = index; 964 clip_tree_index_ = index;
965 SetNeedsPushProperties(); 965 SetNeedsPushProperties();
966 } 966 }
967 967
968 int Layer::clip_tree_index() const { 968 int Layer::clip_tree_index() const {
969 if (!layer_tree_host_ || 969 if (!layer_tree_host_ ||
970 layer_tree_host_->property_trees()->sequence_number != 970 layer_tree_host_->property_trees()->sequence_number !=
971 property_tree_sequence_number_) { 971 property_tree_sequence_number_) {
972 return ClipTree::kInvalidNodeId; 972 return ClipTree::kInvalidNodeId;
973 } 973 }
974 return clip_tree_index_; 974 return clip_tree_index_;
975 } 975 }
976 976
977 void Layer::SetEffectTreeIndex(int index) { 977 void Layer::SetEffectTreeIndex(int index) {
978 DCHECK(IsPropertyChangeAllowed()); 978 CHECK(IsPropertyChangeAllowed());
979 if (effect_tree_index_ == index) 979 if (effect_tree_index_ == index)
980 return; 980 return;
981 effect_tree_index_ = index; 981 effect_tree_index_ = index;
982 SetNeedsPushProperties(); 982 SetNeedsPushProperties();
983 } 983 }
984 984
985 int Layer::effect_tree_index() const { 985 int Layer::effect_tree_index() const {
986 if (!layer_tree_host_ || 986 if (!layer_tree_host_ ||
987 layer_tree_host_->property_trees()->sequence_number != 987 layer_tree_host_->property_trees()->sequence_number !=
988 property_tree_sequence_number_) { 988 property_tree_sequence_number_) {
989 return EffectTree::kInvalidNodeId; 989 return EffectTree::kInvalidNodeId;
990 } 990 }
991 return effect_tree_index_; 991 return effect_tree_index_;
992 } 992 }
993 993
994 void Layer::SetScrollTreeIndex(int index) { 994 void Layer::SetScrollTreeIndex(int index) {
995 DCHECK(IsPropertyChangeAllowed()); 995 CHECK(IsPropertyChangeAllowed());
996 if (scroll_tree_index_ == index) 996 if (scroll_tree_index_ == index)
997 return; 997 return;
998 scroll_tree_index_ = index; 998 scroll_tree_index_ = index;
999 SetNeedsPushProperties(); 999 SetNeedsPushProperties();
1000 } 1000 }
1001 1001
1002 int Layer::scroll_tree_index() const { 1002 int Layer::scroll_tree_index() const {
1003 if (!layer_tree_host_ || 1003 if (!layer_tree_host_ ||
1004 layer_tree_host_->property_trees()->sequence_number != 1004 layer_tree_host_->property_trees()->sequence_number !=
1005 property_tree_sequence_number_) { 1005 property_tree_sequence_number_) {
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 ->subtree_has_copy_request; 1447 ->subtree_has_copy_request;
1448 } 1448 }
1449 1449
1450 gfx::Transform Layer::ScreenSpaceTransform() const { 1450 gfx::Transform Layer::ScreenSpaceTransform() const {
1451 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); 1451 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId);
1452 return draw_property_utils::ScreenSpaceTransform( 1452 return draw_property_utils::ScreenSpaceTransform(
1453 this, layer_tree_host_->property_trees()->transform_tree); 1453 this, layer_tree_host_->property_trees()->transform_tree);
1454 } 1454 }
1455 1455
1456 } // namespace cc 1456 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698