| 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_PROTO_IMAGE_SERIALIZATION_PROCESSOR_H_ | 5 #ifndef CC_PROTO_IMAGE_SERIALIZATION_PROCESSOR_H_ |
| 6 #define CC_PROTO_IMAGE_SERIALIZATION_PROCESSOR_H_ | 6 #define CC_PROTO_IMAGE_SERIALIZATION_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" |
| 9 #include "cc/proto/picture_cache.h" |
| 8 #include "third_party/skia/include/core/SkPicture.h" | 10 #include "third_party/skia/include/core/SkPicture.h" |
| 9 | 11 |
| 10 class SkPixelSerializer; | 12 class SkPixelSerializer; |
| 11 | 13 |
| 12 namespace cc { | 14 namespace cc { |
| 13 | 15 |
| 14 // ImageSerializationProcessor provides functionality to serialize and | 16 // ImageSerializationProcessor provides functionality to serialize, |
| 15 // deserialize Skia images. | 17 // deserialize and cache Skia images. |
| 16 class ImageSerializationProcessor { | 18 class ImageSerializationProcessor { |
| 17 public: | 19 public: |
| 18 // The serializer returned from this function can be used to pass in to | 20 virtual std::unique_ptr<EnginePictureCache> CreateEnginePictureCache() = 0; |
| 19 // SkPicture::serialize(...) for serializing the SkPicture to a stream. | 21 virtual std::unique_ptr<ClientPictureCache> CreateClientPictureCache() = 0; |
| 20 virtual SkPixelSerializer* GetPixelSerializer() = 0; | |
| 21 | |
| 22 // Returns a function pointer valid to use for deserializing images when using | |
| 23 // SkPicture::CreateFromStream to create an SkPicture from a stream. | |
| 24 virtual SkPicture::InstallPixelRefProc GetPixelDeserializer() = 0; | |
| 25 }; | 22 }; |
| 26 | 23 |
| 27 } // namespace cc | 24 } // namespace cc |
| 28 | 25 |
| 29 #endif // CC_PROTO_IMAGE_SERIALIZATION_PROCESSOR_H_ | 26 #endif // CC_PROTO_IMAGE_SERIALIZATION_PROCESSOR_H_ |
| OLD | NEW |