| Index: include/codec/SkCodec.h
|
| diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
|
| index 13c7d006c8df7c0dd4f40731865bc87e649bb3fb..78295eb1fc5a393216bf6e856071ab0da41cf4f6 100644
|
| --- a/include/codec/SkCodec.h
|
| +++ b/include/codec/SkCodec.h
|
| @@ -16,7 +16,6 @@
|
| #include "SkSize.h"
|
| #include "SkStream.h"
|
| #include "SkTypes.h"
|
| -#include "SkYUVSizeInfo.h"
|
|
|
| class SkData;
|
| class SkPngChunkReader;
|
| @@ -286,6 +285,28 @@
|
| */
|
| 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.
|
| @@ -295,7 +316,7 @@
|
| * @param colorSpace Output parameter. If non-NULL this is set to kJPEG,
|
| * otherwise this is ignored.
|
| */
|
| - bool queryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const {
|
| + bool queryYUV8(YUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const {
|
| if (nullptr == sizeInfo) {
|
| return false;
|
| }
|
| @@ -313,7 +334,7 @@
|
| * recommendation (but not smaller).
|
| * @param planes Memory for each of the Y, U, and V planes.
|
| */
|
| - Result getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) {
|
| + Result getYUV8Planes(const YUVSizeInfo& sizeInfo, void* planes[3]) {
|
| if (nullptr == planes || nullptr == planes[0] || nullptr == planes[1] ||
|
| nullptr == planes[2]) {
|
| return kInvalidInput;
|
| @@ -522,11 +543,11 @@
|
| SkPMColor ctable[], int* ctableCount,
|
| int* rowsDecoded) = 0;
|
|
|
| - virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const {
|
| + virtual bool onQueryYUV8(YUVSizeInfo*, SkYUVColorSpace*) const {
|
| return false;
|
| }
|
|
|
| - virtual Result onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) {
|
| + virtual Result onGetYUV8Planes(const YUVSizeInfo&, void*[3] /*planes*/) {
|
| return kUnimplemented;
|
| }
|
|
|
|
|