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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 scroll_clip_layer_id_(INVALID_ID), | 51 scroll_clip_layer_id_(INVALID_ID), |
52 num_descendants_that_draw_content_(0), | 52 num_descendants_that_draw_content_(0), |
53 transform_tree_index_(-1), | 53 transform_tree_index_(-1), |
54 opacity_tree_index_(-1), | 54 opacity_tree_index_(-1), |
55 clip_tree_index_(-1), | 55 clip_tree_index_(-1), |
56 property_tree_sequence_number_(-1), | 56 property_tree_sequence_number_(-1), |
57 num_layer_or_descendants_with_copy_request_(0), | 57 num_layer_or_descendants_with_copy_request_(0), |
58 num_layer_or_descendants_with_input_handler_(0), | 58 num_layer_or_descendants_with_input_handler_(0), |
59 num_children_with_scroll_parent_(0), | 59 num_children_with_scroll_parent_(0), |
60 should_flatten_transform_from_property_tree_(false), | 60 should_flatten_transform_from_property_tree_(false), |
| 61 is_clipped_(false), |
61 should_scroll_on_main_thread_(false), | 62 should_scroll_on_main_thread_(false), |
62 have_wheel_event_handlers_(false), | 63 have_wheel_event_handlers_(false), |
63 have_scroll_event_handlers_(false), | 64 have_scroll_event_handlers_(false), |
64 user_scrollable_horizontal_(true), | 65 user_scrollable_horizontal_(true), |
65 user_scrollable_vertical_(true), | 66 user_scrollable_vertical_(true), |
66 is_root_for_isolated_group_(false), | 67 is_root_for_isolated_group_(false), |
67 is_container_for_fixed_position_layers_(false), | 68 is_container_for_fixed_position_layers_(false), |
68 is_drawable_(false), | 69 is_drawable_(false), |
69 draws_content_(false), | 70 draws_content_(false), |
70 hide_layer_and_subtree_(false), | 71 hide_layer_and_subtree_(false), |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); | 1209 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); |
1209 layer->SetBlendMode(blend_mode_); | 1210 layer->SetBlendMode(blend_mode_); |
1210 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); | 1211 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); |
1211 layer->SetPosition(position_); | 1212 layer->SetPosition(position_); |
1212 layer->SetIsContainerForFixedPositionLayers( | 1213 layer->SetIsContainerForFixedPositionLayers( |
1213 IsContainerForFixedPositionLayers()); | 1214 IsContainerForFixedPositionLayers()); |
1214 layer->SetPositionConstraint(position_constraint_); | 1215 layer->SetPositionConstraint(position_constraint_); |
1215 layer->SetShouldFlattenTransform(should_flatten_transform_); | 1216 layer->SetShouldFlattenTransform(should_flatten_transform_); |
1216 layer->set_should_flatten_transform_from_property_tree( | 1217 layer->set_should_flatten_transform_from_property_tree( |
1217 should_flatten_transform_from_property_tree_); | 1218 should_flatten_transform_from_property_tree_); |
| 1219 layer->set_is_clipped(is_clipped_); |
1218 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); | 1220 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); |
1219 if (!layer->TransformIsAnimatingOnImplOnly() && !TransformIsAnimating()) | 1221 if (!layer->TransformIsAnimatingOnImplOnly() && !TransformIsAnimating()) |
1220 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_); | 1222 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_); |
1221 DCHECK(!(TransformIsAnimating() && layer->TransformIsAnimatingOnImplOnly())); | 1223 DCHECK(!(TransformIsAnimating() && layer->TransformIsAnimatingOnImplOnly())); |
1222 layer->Set3dSortingContextId(sorting_context_id_); | 1224 layer->Set3dSortingContextId(sorting_context_id_); |
1223 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_); | 1225 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_); |
1224 | 1226 |
1225 layer->SetScrollClipLayer(scroll_clip_layer_id_); | 1227 layer->SetScrollClipLayer(scroll_clip_layer_id_); |
1226 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_); | 1228 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_); |
1227 layer->set_user_scrollable_vertical(user_scrollable_vertical_); | 1229 layer->set_user_scrollable_vertical(user_scrollable_vertical_); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 return nullptr; | 1411 return nullptr; |
1410 } | 1412 } |
1411 | 1413 |
1412 void Layer::SetHasRenderSurface(bool has_render_surface) { | 1414 void Layer::SetHasRenderSurface(bool has_render_surface) { |
1413 if (has_render_surface_ == has_render_surface) | 1415 if (has_render_surface_ == has_render_surface) |
1414 return; | 1416 return; |
1415 has_render_surface_ = has_render_surface; | 1417 has_render_surface_ = has_render_surface; |
1416 // We do not need SetNeedsCommit here, since this is only ever called | 1418 // We do not need SetNeedsCommit here, since this is only ever called |
1417 // during a commit, from CalculateDrawProperties. | 1419 // during a commit, from CalculateDrawProperties. |
1418 SetNeedsPushProperties(); | 1420 SetNeedsPushProperties(); |
| 1421 layer_tree_host_->property_trees()->needs_rebuild = true; |
1419 } | 1422 } |
1420 | 1423 |
1421 void Layer::CreateRenderSurface() { | 1424 void Layer::CreateRenderSurface() { |
1422 DCHECK(!render_surface_); | 1425 DCHECK(!render_surface_); |
1423 render_surface_ = make_scoped_ptr(new RenderSurface(this)); | 1426 render_surface_ = make_scoped_ptr(new RenderSurface(this)); |
1424 } | 1427 } |
1425 | 1428 |
1426 void Layer::ClearRenderSurface() { | 1429 void Layer::ClearRenderSurface() { |
1427 render_surface_ = nullptr; | 1430 render_surface_ = nullptr; |
1428 } | 1431 } |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 ? layer_tree_host()->meta_information_sequence_number() | 1662 ? layer_tree_host()->meta_information_sequence_number() |
1660 : 0; | 1663 : 0; |
1661 } | 1664 } |
1662 | 1665 |
1663 bool Layer::sorted_for_recursion() { | 1666 bool Layer::sorted_for_recursion() { |
1664 return sorted_for_recursion_tracker_ == | 1667 return sorted_for_recursion_tracker_ == |
1665 layer_tree_host()->meta_information_sequence_number(); | 1668 layer_tree_host()->meta_information_sequence_number(); |
1666 } | 1669 } |
1667 | 1670 |
1668 } // namespace cc | 1671 } // namespace cc |
OLD | NEW |