OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/push_properties_counting_layer.h" | 5 #include "cc/test/push_properties_counting_layer.h" |
6 | 6 |
7 #include "cc/test/push_properties_counting_layer_impl.h" | 7 #include "cc/test/push_properties_counting_layer_impl.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 void PushPropertiesCountingLayer::PushPropertiesTo(LayerImpl* layer) { | 24 void PushPropertiesCountingLayer::PushPropertiesTo(LayerImpl* layer) { |
25 Layer::PushPropertiesTo(layer); | 25 Layer::PushPropertiesTo(layer); |
26 AddPushPropertiesCount(); | 26 AddPushPropertiesCount(); |
27 } | 27 } |
28 | 28 |
29 std::unique_ptr<LayerImpl> PushPropertiesCountingLayer::CreateLayerImpl( | 29 std::unique_ptr<LayerImpl> PushPropertiesCountingLayer::CreateLayerImpl( |
30 LayerTreeImpl* tree_impl) { | 30 LayerTreeImpl* tree_impl) { |
31 return PushPropertiesCountingLayerImpl::Create(tree_impl, Layer::id()); | 31 return PushPropertiesCountingLayerImpl::Create(tree_impl, Layer::id()); |
32 } | 32 } |
33 | 33 |
34 void PushPropertiesCountingLayer::ToLayerPropertiesProto( | |
35 proto::LayerProperties* proto) { | |
36 Layer::ToLayerPropertiesProto(proto); | |
37 AddPushPropertiesCount(); | |
38 } | |
39 | |
40 void PushPropertiesCountingLayer::SetTypeForProtoSerialization( | |
41 proto::LayerNode* proto) const { | |
42 proto->set_type(proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER); | |
43 } | |
44 | |
45 void PushPropertiesCountingLayer::MakePushProperties() { | 34 void PushPropertiesCountingLayer::MakePushProperties() { |
46 SetContentsOpaque(!contents_opaque()); | 35 SetContentsOpaque(!contents_opaque()); |
47 } | 36 } |
48 | 37 |
49 void PushPropertiesCountingLayer::AddPushPropertiesCount() { | 38 void PushPropertiesCountingLayer::AddPushPropertiesCount() { |
50 push_properties_count_++; | 39 push_properties_count_++; |
51 if (persist_needs_push_properties_) { | 40 if (persist_needs_push_properties_) { |
52 GetLayerTree()->AddLayerShouldPushProperties(this); | 41 GetLayerTree()->AddLayerShouldPushProperties(this); |
53 } | 42 } |
54 } | 43 } |
55 | 44 |
56 } // namespace cc | 45 } // namespace cc |
OLD | NEW |