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 // Layer IDs start from 1. | 81 // Layer IDs start from 1. |
82 inputs_(g_next_layer_id.GetNext() + 1), | 82 inputs_(g_next_layer_id.GetNext() + 1), |
83 num_descendants_that_draw_content_(0), | 83 num_descendants_that_draw_content_(0), |
84 transform_tree_index_(TransformTree::kInvalidNodeId), | 84 transform_tree_index_(TransformTree::kInvalidNodeId), |
85 effect_tree_index_(EffectTree::kInvalidNodeId), | 85 effect_tree_index_(EffectTree::kInvalidNodeId), |
86 clip_tree_index_(ClipTree::kInvalidNodeId), | 86 clip_tree_index_(ClipTree::kInvalidNodeId), |
87 scroll_tree_index_(ScrollTree::kInvalidNodeId), | 87 scroll_tree_index_(ScrollTree::kInvalidNodeId), |
88 property_tree_sequence_number_(-1), | 88 property_tree_sequence_number_(-1), |
89 should_flatten_transform_from_property_tree_(false), | 89 should_flatten_transform_from_property_tree_(false), |
90 draws_content_(false), | 90 draws_content_(false), |
| 91 is_hidden_(false), |
91 should_check_backface_visibility_(false), | 92 should_check_backface_visibility_(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 has_transform_node_(false), | 98 has_transform_node_(false), |
98 has_scroll_node_(false), | 99 has_scroll_node_(false), |
99 subtree_has_copy_request_(false), | 100 subtree_has_copy_request_(false), |
100 safe_opaque_background_color_(0), | 101 safe_opaque_background_color_(0), |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 return inputs_.client->TakeDebugInfo(this); | 1290 return inputs_.client->TakeDebugInfo(this); |
1290 else | 1291 else |
1291 return nullptr; | 1292 return nullptr; |
1292 } | 1293 } |
1293 | 1294 |
1294 void Layer::didUpdateMainThreadScrollingReasons() { | 1295 void Layer::didUpdateMainThreadScrollingReasons() { |
1295 if (inputs_.client) | 1296 if (inputs_.client) |
1296 inputs_.client->didUpdateMainThreadScrollingReasons(); | 1297 inputs_.client->didUpdateMainThreadScrollingReasons(); |
1297 } | 1298 } |
1298 | 1299 |
| 1300 void Layer::SetIsHidden(bool is_hidden) { |
| 1301 DCHECK(layer_tree_host_); |
| 1302 if (is_hidden == is_hidden_) |
| 1303 return; |
| 1304 is_hidden_ = is_hidden; |
| 1305 // We don't push layers that are hidden to compositor thread at commit. So, |
| 1306 // we need a full tree sync when is_hidden changes. |
| 1307 layer_tree_host_->SetNeedsFullTreeSync(); |
| 1308 } |
| 1309 |
1299 void Layer::SetSubtreePropertyChanged() { | 1310 void Layer::SetSubtreePropertyChanged() { |
1300 if (subtree_property_changed_) | 1311 if (subtree_property_changed_) |
1301 return; | 1312 return; |
1302 subtree_property_changed_ = true; | 1313 subtree_property_changed_ = true; |
1303 SetNeedsPushProperties(); | 1314 SetNeedsPushProperties(); |
1304 } | 1315 } |
1305 | 1316 |
1306 void Layer::SetMayContainVideo(bool yes) { | 1317 void Layer::SetMayContainVideo(bool yes) { |
1307 if (may_contain_video_ == yes) | 1318 if (may_contain_video_ == yes) |
1308 return; | 1319 return; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 ->subtree_has_copy_request; | 1458 ->subtree_has_copy_request; |
1448 } | 1459 } |
1449 | 1460 |
1450 gfx::Transform Layer::ScreenSpaceTransform() const { | 1461 gfx::Transform Layer::ScreenSpaceTransform() const { |
1451 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1462 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
1452 return draw_property_utils::ScreenSpaceTransform( | 1463 return draw_property_utils::ScreenSpaceTransform( |
1453 this, layer_tree_host_->property_trees()->transform_tree); | 1464 this, layer_tree_host_->property_trees()->transform_tree); |
1454 } | 1465 } |
1455 | 1466 |
1456 } // namespace cc | 1467 } // namespace cc |
OLD | NEW |