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> |
11 | 11 |
12 #include "base/atomic_sequence_num.h" | 12 #include "base/atomic_sequence_num.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
18 #include "cc/base/simple_enclosed_region.h" | 18 #include "cc/base/simple_enclosed_region.h" |
19 #include "cc/input/main_thread_scrolling_reason.h" | 19 #include "cc/input/main_thread_scrolling_reason.h" |
| 20 #include "cc/layers/heads_up_display_layer.h" |
20 #include "cc/layers/layer_client.h" | 21 #include "cc/layers/layer_client.h" |
21 #include "cc/layers/layer_impl.h" | 22 #include "cc/layers/layer_impl.h" |
22 #include "cc/layers/scrollbar_layer_interface.h" | 23 #include "cc/layers/scrollbar_layer_interface.h" |
23 #include "cc/output/copy_output_request.h" | 24 #include "cc/output/copy_output_request.h" |
24 #include "cc/output/copy_output_result.h" | 25 #include "cc/output/copy_output_result.h" |
25 #include "cc/tiles/frame_viewer_instrumentation.h" | 26 #include "cc/tiles/frame_viewer_instrumentation.h" |
26 #include "cc/trees/draw_property_utils.h" | 27 #include "cc/trees/draw_property_utils.h" |
27 #include "cc/trees/effect_node.h" | 28 #include "cc/trees/effect_node.h" |
28 #include "cc/trees/layer_tree_host.h" | 29 #include "cc/trees/layer_tree_host.h" |
29 #include "cc/trees/layer_tree_impl.h" | 30 #include "cc/trees/layer_tree_impl.h" |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 return; | 1298 return; |
1298 may_contain_video_ = yes; | 1299 may_contain_video_ = yes; |
1299 SetNeedsPushProperties(); | 1300 SetNeedsPushProperties(); |
1300 } | 1301 } |
1301 | 1302 |
1302 void Layer::SetScrollbarsHiddenFromImplSide(bool hidden) { | 1303 void Layer::SetScrollbarsHiddenFromImplSide(bool hidden) { |
1303 if (inputs_.client) | 1304 if (inputs_.client) |
1304 inputs_.client->didChangeScrollbarsHidden(hidden); | 1305 inputs_.client->didChangeScrollbarsHidden(hidden); |
1305 } | 1306 } |
1306 | 1307 |
| 1308 void Layer::copyPropertyTreeStateTo(HeadsUpDisplayLayer* hud_layer) const { |
| 1309 // When not using layer lists the hud layer's properties should be built by |
| 1310 // PropertyTreeBuilder. |
| 1311 DCHECK(layer_tree_host_->GetSettings().use_layer_lists); |
| 1312 |
| 1313 hud_layer->SetTransformTreeIndex(transform_tree_index_); |
| 1314 hud_layer->SetEffectTreeIndex(effect_tree_index_); |
| 1315 hud_layer->SetClipTreeIndex(clip_tree_index_); |
| 1316 hud_layer->SetScrollTreeIndex(scroll_tree_index_); |
| 1317 hud_layer->set_property_tree_sequence_number(property_tree_sequence_number_); |
| 1318 } |
| 1319 |
1307 bool Layer::FilterIsAnimating() const { | 1320 bool Layer::FilterIsAnimating() const { |
1308 return GetMutatorHost()->IsAnimatingFilterProperty( | 1321 return GetMutatorHost()->IsAnimatingFilterProperty( |
1309 element_id(), GetElementTypeForAnimation()); | 1322 element_id(), GetElementTypeForAnimation()); |
1310 } | 1323 } |
1311 | 1324 |
1312 bool Layer::TransformIsAnimating() const { | 1325 bool Layer::TransformIsAnimating() const { |
1313 return GetMutatorHost()->IsAnimatingTransformProperty( | 1326 return GetMutatorHost()->IsAnimatingTransformProperty( |
1314 element_id(), GetElementTypeForAnimation()); | 1327 element_id(), GetElementTypeForAnimation()); |
1315 } | 1328 } |
1316 | 1329 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 ->num_copy_requests_in_subtree; | 1525 ->num_copy_requests_in_subtree; |
1513 } | 1526 } |
1514 | 1527 |
1515 gfx::Transform Layer::screen_space_transform() const { | 1528 gfx::Transform Layer::screen_space_transform() const { |
1516 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1529 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
1517 return draw_property_utils::ScreenSpaceTransform( | 1530 return draw_property_utils::ScreenSpaceTransform( |
1518 this, layer_tree_host_->property_trees()->transform_tree); | 1531 this, layer_tree_host_->property_trees()->transform_tree); |
1519 } | 1532 } |
1520 | 1533 |
1521 } // namespace cc | 1534 } // namespace cc |
OLD | NEW |