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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 inputs_(g_next_layer_id.GetNext() + 1), | 83 inputs_(g_next_layer_id.GetNext() + 1), |
84 num_descendants_that_draw_content_(0), | 84 num_descendants_that_draw_content_(0), |
85 transform_tree_index_(TransformTree::kInvalidNodeId), | 85 transform_tree_index_(TransformTree::kInvalidNodeId), |
86 effect_tree_index_(EffectTree::kInvalidNodeId), | 86 effect_tree_index_(EffectTree::kInvalidNodeId), |
87 clip_tree_index_(ClipTree::kInvalidNodeId), | 87 clip_tree_index_(ClipTree::kInvalidNodeId), |
88 scroll_tree_index_(ScrollTree::kInvalidNodeId), | 88 scroll_tree_index_(ScrollTree::kInvalidNodeId), |
89 property_tree_sequence_number_(-1), | 89 property_tree_sequence_number_(-1), |
90 should_flatten_transform_from_property_tree_(false), | 90 should_flatten_transform_from_property_tree_(false), |
91 draws_content_(false), | 91 draws_content_(false), |
92 should_check_backface_visibility_(false), | 92 should_check_backface_visibility_(false), |
| 93 cache_render_surface_(false), |
93 force_render_surface_for_testing_(false), | 94 force_render_surface_for_testing_(false), |
94 subtree_property_changed_(false), | 95 subtree_property_changed_(false), |
95 may_contain_video_(false), | 96 may_contain_video_(false), |
96 needs_show_scrollbars_(false), | 97 needs_show_scrollbars_(false), |
97 has_transform_node_(false), | 98 has_transform_node_(false), |
98 subtree_has_copy_request_(false), | 99 subtree_has_copy_request_(false), |
99 safe_opaque_background_color_(0), | 100 safe_opaque_background_color_(0), |
100 num_unclipped_descendants_(0) {} | 101 num_unclipped_descendants_(0) {} |
101 | 102 |
102 Layer::~Layer() { | 103 Layer::~Layer() { |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 void Layer::SetTouchActionRegion(TouchActionRegion touch_action_region) { | 919 void Layer::SetTouchActionRegion(TouchActionRegion touch_action_region) { |
919 DCHECK(IsPropertyChangeAllowed()); | 920 DCHECK(IsPropertyChangeAllowed()); |
920 if (inputs_.touch_action_region == touch_action_region) | 921 if (inputs_.touch_action_region == touch_action_region) |
921 return; | 922 return; |
922 | 923 |
923 inputs_.touch_action_region = std::move(touch_action_region); | 924 inputs_.touch_action_region = std::move(touch_action_region); |
924 SetPropertyTreesNeedRebuild(); | 925 SetPropertyTreesNeedRebuild(); |
925 SetNeedsCommit(); | 926 SetNeedsCommit(); |
926 } | 927 } |
927 | 928 |
| 929 void Layer::SetCacheRenderSurface(bool cache) { |
| 930 DCHECK(IsPropertyChangeAllowed()); |
| 931 if (cache_render_surface_ == cache) |
| 932 return; |
| 933 cache_render_surface_ = cache; |
| 934 SetPropertyTreesNeedRebuild(); |
| 935 SetNeedsCommit(); |
| 936 } |
| 937 |
928 void Layer::SetForceRenderSurfaceForTesting(bool force) { | 938 void Layer::SetForceRenderSurfaceForTesting(bool force) { |
929 DCHECK(IsPropertyChangeAllowed()); | 939 DCHECK(IsPropertyChangeAllowed()); |
930 if (force_render_surface_for_testing_ == force) | 940 if (force_render_surface_for_testing_ == force) |
931 return; | 941 return; |
932 force_render_surface_for_testing_ = force; | 942 force_render_surface_for_testing_ = force; |
933 SetPropertyTreesNeedRebuild(); | 943 SetPropertyTreesNeedRebuild(); |
934 SetNeedsCommit(); | 944 SetNeedsCommit(); |
935 } | 945 } |
936 | 946 |
937 void Layer::SetDoubleSided(bool double_sided) { | 947 void Layer::SetDoubleSided(bool double_sided) { |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 ->subtree_has_copy_request; | 1454 ->subtree_has_copy_request; |
1445 } | 1455 } |
1446 | 1456 |
1447 gfx::Transform Layer::ScreenSpaceTransform() const { | 1457 gfx::Transform Layer::ScreenSpaceTransform() const { |
1448 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1458 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
1449 return draw_property_utils::ScreenSpaceTransform( | 1459 return draw_property_utils::ScreenSpaceTransform( |
1450 this, layer_tree_host_->property_trees()->transform_tree); | 1460 this, layer_tree_host_->property_trees()->transform_tree); |
1451 } | 1461 } |
1452 | 1462 |
1453 } // namespace cc | 1463 } // namespace cc |
OLD | NEW |