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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 should_flatten_transform(true), | 52 should_flatten_transform(true), |
53 sorting_context_id(0), | 53 sorting_context_id(0), |
54 use_parent_backface_visibility(false), | 54 use_parent_backface_visibility(false), |
55 background_color(0), | 55 background_color(0), |
56 scroll_clip_layer_id(INVALID_ID), | 56 scroll_clip_layer_id(INVALID_ID), |
57 user_scrollable_horizontal(true), | 57 user_scrollable_horizontal(true), |
58 user_scrollable_vertical(true), | 58 user_scrollable_vertical(true), |
59 main_thread_scrolling_reasons( | 59 main_thread_scrolling_reasons( |
60 MainThreadScrollingReason::kNotScrollingOnMain), | 60 MainThreadScrollingReason::kNotScrollingOnMain), |
61 is_container_for_fixed_position_layers(false), | 61 is_container_for_fixed_position_layers(false), |
| 62 element_id(kInvalidElementId), |
62 mutable_properties(MutableProperty::kNone), | 63 mutable_properties(MutableProperty::kNone), |
63 scroll_parent(nullptr), | 64 scroll_parent(nullptr), |
64 clip_parent(nullptr), | 65 clip_parent(nullptr), |
65 has_will_change_transform_hint(false), | 66 has_will_change_transform_hint(false), |
66 hide_layer_and_subtree(false), | 67 hide_layer_and_subtree(false), |
67 client(nullptr) {} | 68 client(nullptr) {} |
68 | 69 |
69 Layer::Inputs::~Inputs() {} | 70 Layer::Inputs::~Inputs() {} |
70 | 71 |
71 scoped_refptr<Layer> Layer::Create() { | 72 scoped_refptr<Layer> Layer::Create() { |
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 | 1421 |
1421 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1422 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1422 benchmark->RunOnLayer(this); | 1423 benchmark->RunOnLayer(this); |
1423 } | 1424 } |
1424 | 1425 |
1425 void Layer::SetElementId(ElementId id) { | 1426 void Layer::SetElementId(ElementId id) { |
1426 DCHECK(IsPropertyChangeAllowed()); | 1427 DCHECK(IsPropertyChangeAllowed()); |
1427 if (inputs_.element_id == id) | 1428 if (inputs_.element_id == id) |
1428 return; | 1429 return; |
1429 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), | 1430 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), |
1430 "Layer::SetElementId", "element", id.AsValue().release()); | 1431 "Layer::SetElementId", "element", id); |
1431 if (inputs_.element_id && layer_tree_host()) { | 1432 if (inputs_.element_id && layer_tree_host()) { |
1432 layer_tree_host_->UnregisterElement(inputs_.element_id, | 1433 layer_tree_host_->UnregisterElement(inputs_.element_id, |
1433 ElementListType::ACTIVE, this); | 1434 ElementListType::ACTIVE, this); |
1434 } | 1435 } |
1435 | 1436 |
1436 inputs_.element_id = id; | 1437 inputs_.element_id = id; |
1437 | 1438 |
1438 if (inputs_.element_id && layer_tree_host()) { | 1439 if (inputs_.element_id && layer_tree_host()) { |
1439 layer_tree_host_->RegisterElement(inputs_.element_id, | 1440 layer_tree_host_->RegisterElement(inputs_.element_id, |
1440 ElementListType::ACTIVE, this); | 1441 ElementListType::ACTIVE, this); |
(...skipping 18 matching lines...) Expand all Loading... |
1459 ->subtree_has_copy_request; | 1460 ->subtree_has_copy_request; |
1460 } | 1461 } |
1461 | 1462 |
1462 gfx::Transform Layer::ScreenSpaceTransform() const { | 1463 gfx::Transform Layer::ScreenSpaceTransform() const { |
1463 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1464 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
1464 return draw_property_utils::ScreenSpaceTransform( | 1465 return draw_property_utils::ScreenSpaceTransform( |
1465 this, layer_tree_host_->property_trees()->transform_tree); | 1466 this, layer_tree_host_->property_trees()->transform_tree); |
1466 } | 1467 } |
1467 | 1468 |
1468 } // namespace cc | 1469 } // namespace cc |
OLD | NEW |