diff options
author | msarett <msarett@google.com> | 2016-03-10 05:44:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-10 05:44:43 -0800 |
commit | 4984c3c95f18eda44492a2126c9958e447f2cca8 (patch) | |
tree | add5bdca2495968a8acc1affd10e5cfe225ff4d0 /include/codec | |
parent | d6215cf4a5f416cf0b64a4fbba95c519f03fe467 (diff) |
Update Skia's YUV API
We should match the recently designed API in SkCodec.
https://codereview.chromium.org/1549473003/
This requires changes in Chromium as well.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002
Committed: https://skia.googlesource.com/skia/+/095d31c8a0eeb5d491febf064bc3c8a44e22b94f
Review URL: https://codereview.chromium.org/1716523002
Diffstat (limited to 'include/codec')
-rw-r--r-- | include/codec/SkCodec.h | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h index 7e7503acae..3855064f61 100644 --- a/include/codec/SkCodec.h +++ b/include/codec/SkCodec.h @@ -15,6 +15,7 @@ #include "SkSize.h" #include "SkStream.h" #include "SkTypes.h" +#include "SkYUVSizeInfo.h" class SkColorSpace; class SkData; @@ -285,28 +286,6 @@ public: */ Result getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes); - struct YUVSizeInfo { - SkISize fYSize; - SkISize fUSize; - SkISize fVSize; - - /** - * While the widths of the Y, U, and V planes are not restricted, the - * implementation requires that the width of the memory allocated for - * each plane be a multiple of DCTSIZE (which is always 8). - * - * This struct allows us to inform the client how many "widthBytes" - * that we need. Note that we use the new idea of "widthBytes" - * because this idea is distinct from "rowBytes" (used elsewhere in - * Skia). "rowBytes" allow the last row of the allocation to not - * include any extra padding, while, in this case, every single row of - * the allocation must be at least "widthBytes". - */ - size_t fYWidthBytes; - size_t fUWidthBytes; - size_t fVWidthBytes; - }; - /** * If decoding to YUV is supported, this returns true. Otherwise, this * returns false and does not modify any of the parameters. @@ -316,7 +295,7 @@ public: * @param colorSpace Output parameter. If non-NULL this is set to kJPEG, * otherwise this is ignored. */ - bool queryYUV8(YUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const { + bool queryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const { if (nullptr == sizeInfo) { return false; } @@ -334,7 +313,7 @@ public: * recommendation (but not smaller). * @param planes Memory for each of the Y, U, and V planes. */ - Result getYUV8Planes(const YUVSizeInfo& sizeInfo, void* planes[3]) { + Result getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) { if (nullptr == planes || nullptr == planes[0] || nullptr == planes[1] || nullptr == planes[2]) { return kInvalidInput; @@ -543,11 +522,11 @@ protected: SkPMColor ctable[], int* ctableCount, int* rowsDecoded) = 0; - virtual bool onQueryYUV8(YUVSizeInfo*, SkYUVColorSpace*) const { + virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const { return false; } - virtual Result onGetYUV8Planes(const YUVSizeInfo&, void*[3] /*planes*/) { + virtual Result onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) { return kUnimplemented; } |