| 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 14 matching lines...) Expand all Loading... |
| 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( | 34 void PushPropertiesCountingLayer::ToLayerPropertiesProto( |
| 35 proto::LayerUpdate* layer_update, | 35 proto::LayerProperties* proto) { |
| 36 bool inputs_only) { | 36 Layer::ToLayerPropertiesProto(proto); |
| 37 Layer::ToLayerPropertiesProto(layer_update, inputs_only); | |
| 38 AddPushPropertiesCount(); | 37 AddPushPropertiesCount(); |
| 39 } | 38 } |
| 40 | 39 |
| 41 void PushPropertiesCountingLayer::SetTypeForProtoSerialization( | 40 void PushPropertiesCountingLayer::SetTypeForProtoSerialization( |
| 42 proto::LayerNode* proto) const { | 41 proto::LayerNode* proto) const { |
| 43 proto->set_type(proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER); | 42 proto->set_type(proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER); |
| 44 } | 43 } |
| 45 | 44 |
| 46 void PushPropertiesCountingLayer::MakePushProperties() { | 45 void PushPropertiesCountingLayer::MakePushProperties() { |
| 47 SetContentsOpaque(!contents_opaque()); | 46 SetContentsOpaque(!contents_opaque()); |
| 48 } | 47 } |
| 49 | 48 |
| 50 void PushPropertiesCountingLayer::AddPushPropertiesCount() { | 49 void PushPropertiesCountingLayer::AddPushPropertiesCount() { |
| 51 push_properties_count_++; | 50 push_properties_count_++; |
| 52 if (persist_needs_push_properties_) { | 51 if (persist_needs_push_properties_) { |
| 53 GetLayerTree()->AddLayerShouldPushProperties(this); | 52 GetLayerTree()->AddLayerShouldPushProperties(this); |
| 54 } | 53 } |
| 55 } | 54 } |
| 56 | 55 |
| 57 } // namespace cc | 56 } // namespace cc |
| OLD | NEW |