Chromium Code Reviews| Index: include/core/SkPixelSerializer.h |
| diff --git a/include/core/SkPixelSerializer.h b/include/core/SkPixelSerializer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..964871a4424f2ad4377ba8d70b84e02438de2745 |
| --- /dev/null |
| +++ b/include/core/SkPixelSerializer.h |
| @@ -0,0 +1,33 @@ |
| +/* |
| + * Copyright 2014 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef SkPixelSerializer_DEFINED |
| +#define SkPixelSerializer_DEFINED |
| + |
| +#include "SkRefCnt.h" |
| + |
| +class SkData; |
| +struct SkImageInfo; |
| + |
| +/** |
| + * Interface for serializing pixels, e.g. SkBitmaps in an SkPicture. |
| + */ |
| +class SkPixelSerializer : public SkRefCnt { |
| +public: |
|
reed1
2014/12/08 15:51:15
Can we make these methods non-virtual, and have th
scroggo
2014/12/08 18:09:31
Done.
|
| + /** |
| + * Return true if you want to serialize the encoded data, false if you want |
| + * another version serialized (e.g. the result of encodePixels). |
| + */ |
| + virtual bool useEncodedData(SkData*) = 0; |
|
reed1
2014/12/08 15:51:15
perhaps this signature should be (const void*, siz
scroggo
2014/12/08 18:09:31
Done.
|
| + |
| + /** |
| + * If you want to encode these pixels, return the encoded data as an SkData |
| + * Return null if you want to serialize the raw pixels. |
| + */ |
| + virtual SkData* encodePixels(const SkImageInfo&, void* pixels, size_t rowBytes) = 0; |
| +}; |
| +#endif // SkPixelSerializer_DEFINED |