| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_ | 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_ |
| 6 #define CC_TEST_FAKE_PICTURE_LAYER_H_ | 6 #define CC_TEST_FAKE_PICTURE_LAYER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 static scoped_refptr<FakePictureLayer> CreateWithRecordingSource( | 23 static scoped_refptr<FakePictureLayer> CreateWithRecordingSource( |
| 24 ContentLayerClient* client, | 24 ContentLayerClient* client, |
| 25 std::unique_ptr<RecordingSource> source) { | 25 std::unique_ptr<RecordingSource> source) { |
| 26 return make_scoped_refptr(new FakePictureLayer(client, std::move(source))); | 26 return make_scoped_refptr(new FakePictureLayer(client, std::move(source))); |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Layer implementation. | 29 // Layer implementation. |
| 30 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 30 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 31 bool Update() override; | 31 bool Update() override; |
| 32 bool IsSuitableForGpuRasterization() const override; | 32 bool IsSuitableForGpuRasterization() const override; |
| 33 void SetTypeForProtoSerialization(proto::LayerNode* proto) const override; | |
| 34 | 33 |
| 35 int update_count() const { return update_count_; } | 34 int update_count() const { return update_count_; } |
| 36 void reset_update_count() { update_count_ = 0; } | 35 void reset_update_count() { update_count_ = 0; } |
| 37 | 36 |
| 38 void set_always_update_resources(bool always_update_resources) { | 37 void set_always_update_resources(bool always_update_resources) { |
| 39 always_update_resources_ = always_update_resources; | 38 always_update_resources_ = always_update_resources; |
| 40 } | 39 } |
| 41 | 40 |
| 42 void set_force_unsuitable_for_gpu_rasterization(bool flag) { | 41 void set_force_unsuitable_for_gpu_rasterization(bool flag) { |
| 43 force_unsuitable_for_gpu_rasterization_ = flag; | 42 force_unsuitable_for_gpu_rasterization_ = flag; |
| 44 } | 43 } |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 explicit FakePictureLayer(ContentLayerClient* client); | 46 explicit FakePictureLayer(ContentLayerClient* client); |
| 48 FakePictureLayer(ContentLayerClient* client, | 47 FakePictureLayer(ContentLayerClient* client, |
| 49 std::unique_ptr<RecordingSource> source); | 48 std::unique_ptr<RecordingSource> source); |
| 50 ~FakePictureLayer() override; | 49 ~FakePictureLayer() override; |
| 51 | 50 |
| 52 int update_count_; | 51 int update_count_; |
| 53 bool always_update_resources_; | 52 bool always_update_resources_; |
| 54 | 53 |
| 55 bool force_unsuitable_for_gpu_rasterization_; | 54 bool force_unsuitable_for_gpu_rasterization_; |
| 56 }; | 55 }; |
| 57 | 56 |
| 58 } // namespace cc | 57 } // namespace cc |
| 59 | 58 |
| 60 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_ | 59 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_ |
| OLD | NEW |