Chromium Code Reviews| Index: include/core/SkImageGenerator.h |
| diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h |
| index 157bfdb0010646cc7e82d70466a2d4bbf9fd2d62..5dd1e81156b03a8b278ec4408f33ae20b5e1f1d8 100644 |
| --- a/include/core/SkImageGenerator.h |
| +++ b/include/core/SkImageGenerator.h |
| @@ -116,12 +116,28 @@ public: |
| bool getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes); |
| #endif |
| + struct YUV8Planes { |
| + // do we want/need per-buffer rowbytes? or just assume tight? |
| + SkImageInfo fInfo; |
|
sugoi1
2014/07/08 14:42:02
The SkImageInfo member is required so that onGetYU
|
| + uint8_t* fPixels; |
|
sugoi1
2014/07/08 14:42:02
The current implementation in Blink makes it very
|
| + }; |
| + /** |
| + * If planes is NULL, this imagegenerator should output the sizes and return true |
| + * if it can efficiently return YUV planar data. If it cannot, it should return false. |
| + * |
| + * If planes is not NULL, then it should copy the associated Y,U,V data into those planes |
| + * of memory supplied by the caller. It should validate that the sizes match what it expected. |
| + * If the sizes do not match, it should return false. |
| + */ |
| + bool getYUV8Planes(SkISize* sizes, const YUV8Planes* planes = NULL); |
|
Stephen White
2014/07/08 15:00:19
Does "planes" have to be a default parameter? It m
reed1
2014/07/08 15:08:52
What about
struct Plane8 {
uint8_t* fPixels;
|
| + |
| protected: |
| virtual SkData* onRefEncodedData(); |
| virtual bool onGetInfo(SkImageInfo* info); |
| virtual bool onGetPixels(const SkImageInfo& info, |
| void* pixels, size_t rowBytes, |
| SkPMColor ctable[], int* ctableCount); |
| + virtual bool onGetYUV8Planes(SkISize*, const YUV8Planes*); |
| }; |
| #endif // SkImageGenerator_DEFINED |