Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: include/codec/SkCodec.h

Issue 1716523002: Update Skia's YUV API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Tweak the API to use arrays and named indices Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkImageGenerator.h » ('j') | include/core/SkYUVSizeInfo.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkCodec.h
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index c3a5873d7f9fb77e03027f684d573061bc9c3dd2..214f9d661ce5dd67e8372c3559b7d96ccb0287df 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 SkData;
class SkPngChunkReader;
@@ -277,28 +278,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.
@@ -308,7 +287,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;
}
@@ -326,7 +305,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;
@@ -531,11 +510,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*[SkYUVSizeInfo::kPlaneCount]) {
return kUnimplemented;
}
« no previous file with comments | « no previous file | include/core/SkImageGenerator.h » ('j') | include/core/SkYUVSizeInfo.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698