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