| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_H_ |
| 6 #define CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "cc/layers/layer.h" |
| 13 #include "cc/proto/layer.pb.h" |
| 14 |
| 15 namespace cc { |
| 16 |
| 17 class LayerImpl; |
| 18 class LayerTreeImpl; |
| 19 |
| 20 class PushPropertiesCountingLayer : public Layer { |
| 21 public: |
| 22 static scoped_refptr<PushPropertiesCountingLayer> Create(); |
| 23 |
| 24 // Layer implementation. |
| 25 void PushPropertiesTo(LayerImpl* layer) override; |
| 26 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 27 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update, |
| 28 bool inputs_only) override; |
| 29 void SetTypeForProtoSerialization(proto::LayerNode* proto) const override; |
| 30 |
| 31 // Something to make this layer push properties, but no other layer. |
| 32 void MakePushProperties(); |
| 33 |
| 34 void SetDrawsContent(bool draws_content); |
| 35 |
| 36 size_t push_properties_count() const { return push_properties_count_; } |
| 37 void reset_push_properties_count() { push_properties_count_ = 0; } |
| 38 |
| 39 void set_persist_needs_push_properties(bool persist) { |
| 40 persist_needs_push_properties_ = persist; |
| 41 } |
| 42 |
| 43 private: |
| 44 PushPropertiesCountingLayer(); |
| 45 ~PushPropertiesCountingLayer() override; |
| 46 |
| 47 void AddPushPropertiesCount(); |
| 48 |
| 49 size_t push_properties_count_; |
| 50 bool persist_needs_push_properties_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(PushPropertiesCountingLayer); |
| 53 }; |
| 54 |
| 55 } // namespace cc |
| 56 |
| 57 #endif // CC_TEST_PUSH_PROPERTIES_COUNTING_LAYER_H_ |
| OLD | NEW |