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 #ifndef CC_TEST_FAKE_IMAGE_SERIALIZATION_PROCESSOR_H_ | 5 #ifndef CC_TEST_FAKE_IMAGE_SERIALIZATION_PROCESSOR_H_ |
6 #define CC_TEST_FAKE_IMAGE_SERIALIZATION_PROCESSOR_H_ | 6 #define CC_TEST_FAKE_IMAGE_SERIALIZATION_PROCESSOR_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "cc/proto/image_serialization_processor.h" | 11 #include "cc/blimp/client_picture_cache.h" |
10 | 12 #include "cc/blimp/engine_picture_cache.h" |
11 class SkPixelSerializer; | 13 #include "cc/blimp/image_serialization_processor.h" |
| 14 #include "cc/test/picture_cache_model.h" |
12 | 15 |
13 namespace cc { | 16 namespace cc { |
14 | 17 |
15 class FakeImageSerializationProcessor : public ImageSerializationProcessor { | 18 class FakeImageSerializationProcessor : public ImageSerializationProcessor { |
16 public: | 19 public: |
17 FakeImageSerializationProcessor(); | 20 FakeImageSerializationProcessor(); |
18 ~FakeImageSerializationProcessor(); | 21 ~FakeImageSerializationProcessor() override; |
19 | 22 |
20 // ImageSerializationProcessor implementation. | 23 // ImageSerializationProcessor implementation. |
21 SkPixelSerializer* GetPixelSerializer() override; | 24 std::unique_ptr<EnginePictureCache> CreateEnginePictureCache() override; |
22 SkPicture::InstallPixelRefProc GetPixelDeserializer() override; | 25 std::unique_ptr<ClientPictureCache> CreateClientPictureCache() override; |
23 | 26 |
24 private: | 27 private: |
| 28 // A PictureCacheModel shared between both the engine and client cache. |
| 29 std::unique_ptr<PictureCacheModel> picture_cache_model_; |
| 30 |
25 DISALLOW_COPY_AND_ASSIGN(FakeImageSerializationProcessor); | 31 DISALLOW_COPY_AND_ASSIGN(FakeImageSerializationProcessor); |
26 }; | 32 }; |
27 | 33 |
28 } // namespace cc | 34 } // namespace cc |
29 | 35 |
30 #endif // CC_TEST_FAKE_IMAGE_SERIALIZATION_PROCESSOR_H_ | 36 #endif // CC_TEST_FAKE_IMAGE_SERIALIZATION_PROCESSOR_H_ |
OLD | NEW |