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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 use_local_transform_for_backface_visibility_(false), | 90 use_local_transform_for_backface_visibility_(false), |
91 should_check_backface_visibility_(false), | 91 should_check_backface_visibility_(false), |
| 92 cache_render_surface_(false), |
92 force_render_surface_for_testing_(false), | 93 force_render_surface_for_testing_(false), |
93 subtree_property_changed_(false), | 94 subtree_property_changed_(false), |
94 may_contain_video_(false), | 95 may_contain_video_(false), |
95 is_scroll_clip_layer_(false), | 96 is_scroll_clip_layer_(false), |
96 needs_show_scrollbars_(false), | 97 needs_show_scrollbars_(false), |
97 subtree_has_copy_request_(false), | 98 subtree_has_copy_request_(false), |
98 safe_opaque_background_color_(0), | 99 safe_opaque_background_color_(0), |
99 num_unclipped_descendants_(0) {} | 100 num_unclipped_descendants_(0) {} |
100 | 101 |
101 Layer::~Layer() { | 102 Layer::~Layer() { |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 void Layer::SetTouchEventHandlerRegion(const Region& region) { | 888 void Layer::SetTouchEventHandlerRegion(const Region& region) { |
888 DCHECK(IsPropertyChangeAllowed()); | 889 DCHECK(IsPropertyChangeAllowed()); |
889 if (inputs_.touch_event_handler_region == region) | 890 if (inputs_.touch_event_handler_region == region) |
890 return; | 891 return; |
891 | 892 |
892 inputs_.touch_event_handler_region = region; | 893 inputs_.touch_event_handler_region = region; |
893 SetPropertyTreesNeedRebuild(); | 894 SetPropertyTreesNeedRebuild(); |
894 SetNeedsCommit(); | 895 SetNeedsCommit(); |
895 } | 896 } |
896 | 897 |
| 898 void Layer::SetCacheRenderSurface(bool cache) { |
| 899 DCHECK(IsPropertyChangeAllowed()); |
| 900 if (cache_render_surface_ == cache) |
| 901 return; |
| 902 cache_render_surface_ = cache; |
| 903 SetPropertyTreesNeedRebuild(); |
| 904 SetNeedsCommit(); |
| 905 } |
| 906 |
897 void Layer::SetForceRenderSurfaceForTesting(bool force) { | 907 void Layer::SetForceRenderSurfaceForTesting(bool force) { |
898 DCHECK(IsPropertyChangeAllowed()); | 908 DCHECK(IsPropertyChangeAllowed()); |
899 if (force_render_surface_for_testing_ == force) | 909 if (force_render_surface_for_testing_ == force) |
900 return; | 910 return; |
901 force_render_surface_for_testing_ = force; | 911 force_render_surface_for_testing_ = force; |
902 SetPropertyTreesNeedRebuild(); | 912 SetPropertyTreesNeedRebuild(); |
903 SetNeedsCommit(); | 913 SetNeedsCommit(); |
904 } | 914 } |
905 | 915 |
906 void Layer::SetDoubleSided(bool double_sided) { | 916 void Layer::SetDoubleSided(bool double_sided) { |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 ->subtree_has_copy_request; | 1463 ->subtree_has_copy_request; |
1454 } | 1464 } |
1455 | 1465 |
1456 gfx::Transform Layer::ScreenSpaceTransform() const { | 1466 gfx::Transform Layer::ScreenSpaceTransform() const { |
1457 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1467 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
1458 return draw_property_utils::ScreenSpaceTransform( | 1468 return draw_property_utils::ScreenSpaceTransform( |
1459 this, layer_tree_host_->property_trees()->transform_tree); | 1469 this, layer_tree_host_->property_trees()->transform_tree); |
1460 } | 1470 } |
1461 | 1471 |
1462 } // namespace cc | 1472 } // namespace cc |
OLD | NEW |