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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 should_flatten_transform_from_property_tree_(false), | 87 should_flatten_transform_from_property_tree_(false), |
88 draws_content_(false), | 88 draws_content_(false), |
89 use_local_transform_for_backface_visibility_(false), | 89 use_local_transform_for_backface_visibility_(false), |
90 should_check_backface_visibility_(false), | 90 should_check_backface_visibility_(false), |
91 force_render_surface_for_testing_(false), | 91 force_render_surface_for_testing_(false), |
92 subtree_property_changed_(false), | 92 subtree_property_changed_(false), |
93 may_contain_video_(false), | 93 may_contain_video_(false), |
94 is_scroll_clip_layer_(false), | 94 is_scroll_clip_layer_(false), |
95 needs_show_scrollbars_(false), | 95 needs_show_scrollbars_(false), |
96 safe_opaque_background_color_(0), | 96 safe_opaque_background_color_(0), |
97 draw_blend_mode_(SkBlendMode::kSrcOver), | |
98 num_unclipped_descendants_(0) {} | 97 num_unclipped_descendants_(0) {} |
99 | 98 |
100 Layer::~Layer() { | 99 Layer::~Layer() { |
101 // Our parent should be holding a reference to us so there should be no | 100 // Our parent should be holding a reference to us so there should be no |
102 // way for us to be destroyed while we still have a parent. | 101 // way for us to be destroyed while we still have a parent. |
103 DCHECK(!parent()); | 102 DCHECK(!parent()); |
104 // Similarly we shouldn't have a layer tree host since it also keeps a | 103 // Similarly we shouldn't have a layer tree host since it also keeps a |
105 // reference to us. | 104 // reference to us. |
106 DCHECK(!layer_tree_host()); | 105 DCHECK(!layer_tree_host()); |
107 | 106 |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 layer->set_may_contain_video(may_contain_video_); | 1155 layer->set_may_contain_video(may_contain_video_); |
1157 layer->SetMasksToBounds(inputs_.masks_to_bounds); | 1156 layer->SetMasksToBounds(inputs_.masks_to_bounds); |
1158 layer->set_main_thread_scrolling_reasons( | 1157 layer->set_main_thread_scrolling_reasons( |
1159 inputs_.main_thread_scrolling_reasons); | 1158 inputs_.main_thread_scrolling_reasons); |
1160 layer->SetNonFastScrollableRegion(inputs_.non_fast_scrollable_region); | 1159 layer->SetNonFastScrollableRegion(inputs_.non_fast_scrollable_region); |
1161 layer->SetTouchEventHandlerRegion(inputs_.touch_event_handler_region); | 1160 layer->SetTouchEventHandlerRegion(inputs_.touch_event_handler_region); |
1162 layer->SetContentsOpaque(inputs_.contents_opaque); | 1161 layer->SetContentsOpaque(inputs_.contents_opaque); |
1163 layer->SetPosition(inputs_.position); | 1162 layer->SetPosition(inputs_.position); |
1164 layer->set_should_flatten_transform_from_property_tree( | 1163 layer->set_should_flatten_transform_from_property_tree( |
1165 should_flatten_transform_from_property_tree_); | 1164 should_flatten_transform_from_property_tree_); |
1166 layer->set_draw_blend_mode(draw_blend_mode_); | |
1167 layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility); | 1165 layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility); |
1168 layer->SetUseLocalTransformForBackfaceVisibility( | 1166 layer->SetUseLocalTransformForBackfaceVisibility( |
1169 use_local_transform_for_backface_visibility_); | 1167 use_local_transform_for_backface_visibility_); |
1170 layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_); | 1168 layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_); |
1171 | 1169 |
1172 layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id); | 1170 layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id); |
1173 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal); | 1171 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal); |
1174 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical); | 1172 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical); |
1175 layer->SetElementId(inputs_.element_id); | 1173 layer->SetElementId(inputs_.element_id); |
1176 layer->SetMutableProperties(inputs_.mutable_properties); | 1174 layer->SetMutableProperties(inputs_.mutable_properties); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 ->num_copy_requests_in_subtree; | 1443 ->num_copy_requests_in_subtree; |
1446 } | 1444 } |
1447 | 1445 |
1448 gfx::Transform Layer::screen_space_transform() const { | 1446 gfx::Transform Layer::screen_space_transform() const { |
1449 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1447 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
1450 return draw_property_utils::ScreenSpaceTransform( | 1448 return draw_property_utils::ScreenSpaceTransform( |
1451 this, layer_tree_host_->property_trees()->transform_tree); | 1449 this, layer_tree_host_->property_trees()->transform_tree); |
1452 } | 1450 } |
1453 | 1451 |
1454 } // namespace cc | 1452 } // namespace cc |
OLD | NEW |