OLD | NEW |
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 blend_mode_(SkXfermode::kSrcOver_Mode), | 91 blend_mode_(SkXfermode::kSrcOver_Mode), |
92 draw_blend_mode_(SkXfermode::kSrcOver_Mode), | 92 draw_blend_mode_(SkXfermode::kSrcOver_Mode), |
93 scroll_parent_(nullptr), | 93 scroll_parent_(nullptr), |
94 layer_or_descendant_is_drawn_tracker_(0), | 94 layer_or_descendant_is_drawn_tracker_(0), |
95 sorted_for_recursion_tracker_(0), | 95 sorted_for_recursion_tracker_(0), |
96 visited_tracker_(0), | 96 visited_tracker_(0), |
97 clip_parent_(nullptr), | 97 clip_parent_(nullptr), |
98 replica_layer_(nullptr), | 98 replica_layer_(nullptr), |
99 client_(nullptr), | 99 client_(nullptr), |
100 num_unclipped_descendants_(0), | 100 num_unclipped_descendants_(0), |
101 frame_timing_requests_dirty_(false), | 101 frame_timing_requests_dirty_(false) { |
102 is_hidden_from_property_trees_(false) { | |
103 if (!settings.use_compositor_animation_timelines) { | 102 if (!settings.use_compositor_animation_timelines) { |
104 layer_animation_controller_ = LayerAnimationController::Create(layer_id_); | 103 layer_animation_controller_ = LayerAnimationController::Create(layer_id_); |
105 layer_animation_controller_->AddValueObserver(this); | 104 layer_animation_controller_->AddValueObserver(this); |
106 layer_animation_controller_->set_value_provider(this); | 105 layer_animation_controller_->set_value_provider(this); |
107 } | 106 } |
108 } | 107 } |
109 | 108 |
110 Layer::~Layer() { | 109 Layer::~Layer() { |
111 // Our parent should be holding a reference to us so there should be no | 110 // Our parent should be holding a reference to us so there should be no |
112 // way for us to be destroyed while we still have a parent. | 111 // way for us to be destroyed while we still have a parent. |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_); | 1230 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_); |
1232 DCHECK(!(TransformIsAnimating() && layer->TransformIsAnimatingOnImplOnly())); | 1231 DCHECK(!(TransformIsAnimating() && layer->TransformIsAnimatingOnImplOnly())); |
1233 layer->Set3dSortingContextId(sorting_context_id_); | 1232 layer->Set3dSortingContextId(sorting_context_id_); |
1234 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_); | 1233 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_); |
1235 | 1234 |
1236 layer->SetScrollClipLayer(scroll_clip_layer_id_); | 1235 layer->SetScrollClipLayer(scroll_clip_layer_id_); |
1237 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_); | 1236 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_); |
1238 layer->set_user_scrollable_vertical(user_scrollable_vertical_); | 1237 layer->set_user_scrollable_vertical(user_scrollable_vertical_); |
1239 layer->SetElementId(element_id_); | 1238 layer->SetElementId(element_id_); |
1240 layer->SetMutableProperties(mutable_properties_); | 1239 layer->SetMutableProperties(mutable_properties_); |
1241 layer->set_is_hidden_from_property_trees(is_hidden_from_property_trees_); | |
1242 | 1240 |
1243 LayerImpl* scroll_parent = nullptr; | 1241 LayerImpl* scroll_parent = nullptr; |
1244 if (scroll_parent_) { | 1242 if (scroll_parent_) { |
1245 scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id()); | 1243 scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id()); |
1246 DCHECK(scroll_parent); | 1244 DCHECK(scroll_parent); |
1247 } | 1245 } |
1248 | 1246 |
1249 layer->SetScrollParent(scroll_parent); | 1247 layer->SetScrollParent(scroll_parent); |
1250 if (scroll_children_) { | 1248 if (scroll_children_) { |
1251 std::set<LayerImpl*>* scroll_children = new std::set<LayerImpl*>; | 1249 std::set<LayerImpl*>* scroll_children = new std::set<LayerImpl*>; |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 this, layer_tree_host_->property_trees()->transform_tree); | 2029 this, layer_tree_host_->property_trees()->transform_tree); |
2032 } | 2030 } |
2033 | 2031 |
2034 gfx::Transform Layer::screen_space_transform() const { | 2032 gfx::Transform Layer::screen_space_transform() const { |
2035 DCHECK_NE(transform_tree_index_, -1); | 2033 DCHECK_NE(transform_tree_index_, -1); |
2036 return ScreenSpaceTransformFromPropertyTrees( | 2034 return ScreenSpaceTransformFromPropertyTrees( |
2037 this, layer_tree_host_->property_trees()->transform_tree); | 2035 this, layer_tree_host_->property_trees()->transform_tree); |
2038 } | 2036 } |
2039 | 2037 |
2040 } // namespace cc | 2038 } // namespace cc |
OLD | NEW |