| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 inputs_(g_next_layer_id.GetNext() + 1), | 81 inputs_(g_next_layer_id.GetNext() + 1), |
| 82 num_descendants_that_draw_content_(0), | 82 num_descendants_that_draw_content_(0), |
| 83 transform_tree_index_(TransformTree::kInvalidNodeId), | 83 transform_tree_index_(TransformTree::kInvalidNodeId), |
| 84 effect_tree_index_(EffectTree::kInvalidNodeId), | 84 effect_tree_index_(EffectTree::kInvalidNodeId), |
| 85 clip_tree_index_(ClipTree::kInvalidNodeId), | 85 clip_tree_index_(ClipTree::kInvalidNodeId), |
| 86 scroll_tree_index_(ScrollTree::kInvalidNodeId), | 86 scroll_tree_index_(ScrollTree::kInvalidNodeId), |
| 87 property_tree_sequence_number_(-1), | 87 property_tree_sequence_number_(-1), |
| 88 should_flatten_transform_from_property_tree_(false), | 88 should_flatten_transform_from_property_tree_(false), |
| 89 draws_content_(false), | 89 draws_content_(false), |
| 90 should_check_backface_visibility_(false), | 90 should_check_backface_visibility_(false), |
| 91 cache_render_surface_(false), |
| 91 force_render_surface_for_testing_(false), | 92 force_render_surface_for_testing_(false), |
| 92 subtree_property_changed_(false), | 93 subtree_property_changed_(false), |
| 93 may_contain_video_(false), | 94 may_contain_video_(false), |
| 94 needs_show_scrollbars_(false), | 95 needs_show_scrollbars_(false), |
| 95 has_transform_node_(false), | 96 has_transform_node_(false), |
| 96 subtree_has_copy_request_(false), | 97 subtree_has_copy_request_(false), |
| 97 safe_opaque_background_color_(0), | 98 safe_opaque_background_color_(0), |
| 98 num_unclipped_descendants_(0) {} | 99 num_unclipped_descendants_(0) {} |
| 99 | 100 |
| 100 Layer::~Layer() { | 101 Layer::~Layer() { |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 void Layer::SetTouchActionRegion(TouchActionRegion touch_action_region) { | 897 void Layer::SetTouchActionRegion(TouchActionRegion touch_action_region) { |
| 897 DCHECK(IsPropertyChangeAllowed()); | 898 DCHECK(IsPropertyChangeAllowed()); |
| 898 if (inputs_.touch_action_region == touch_action_region) | 899 if (inputs_.touch_action_region == touch_action_region) |
| 899 return; | 900 return; |
| 900 | 901 |
| 901 inputs_.touch_action_region = std::move(touch_action_region); | 902 inputs_.touch_action_region = std::move(touch_action_region); |
| 902 SetPropertyTreesNeedRebuild(); | 903 SetPropertyTreesNeedRebuild(); |
| 903 SetNeedsCommit(); | 904 SetNeedsCommit(); |
| 904 } | 905 } |
| 905 | 906 |
| 907 void Layer::SetCacheRenderSurface(bool cache) { |
| 908 DCHECK(IsPropertyChangeAllowed()); |
| 909 if (cache_render_surface_ == cache) |
| 910 return; |
| 911 cache_render_surface_ = cache; |
| 912 SetPropertyTreesNeedRebuild(); |
| 913 SetNeedsCommit(); |
| 914 } |
| 915 |
| 906 void Layer::SetForceRenderSurfaceForTesting(bool force) { | 916 void Layer::SetForceRenderSurfaceForTesting(bool force) { |
| 907 DCHECK(IsPropertyChangeAllowed()); | 917 DCHECK(IsPropertyChangeAllowed()); |
| 908 if (force_render_surface_for_testing_ == force) | 918 if (force_render_surface_for_testing_ == force) |
| 909 return; | 919 return; |
| 910 force_render_surface_for_testing_ = force; | 920 force_render_surface_for_testing_ = force; |
| 911 SetPropertyTreesNeedRebuild(); | 921 SetPropertyTreesNeedRebuild(); |
| 912 SetNeedsCommit(); | 922 SetNeedsCommit(); |
| 913 } | 923 } |
| 914 | 924 |
| 915 void Layer::SetDoubleSided(bool double_sided) { | 925 void Layer::SetDoubleSided(bool double_sided) { |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 ->subtree_has_copy_request; | 1436 ->subtree_has_copy_request; |
| 1427 } | 1437 } |
| 1428 | 1438 |
| 1429 gfx::Transform Layer::ScreenSpaceTransform() const { | 1439 gfx::Transform Layer::ScreenSpaceTransform() const { |
| 1430 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1440 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
| 1431 return draw_property_utils::ScreenSpaceTransform( | 1441 return draw_property_utils::ScreenSpaceTransform( |
| 1432 this, layer_tree_host_->property_trees()->transform_tree); | 1442 this, layer_tree_host_->property_trees()->transform_tree); |
| 1433 } | 1443 } |
| 1434 | 1444 |
| 1435 } // namespace cc | 1445 } // namespace cc |
| OLD | NEW |