Replace use of SkYUVSizeInfo with SkYUVASizeInfo
Bug: skia:7903
Change-Id: If5acd50711ed8bd4a49efcb93db66fd3d14c8992
Reviewed-on: https://skia-review.googlesource.com/c/164681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/gm/wacky_yuv_formats.cpp b/gm/wacky_yuv_formats.cpp
index fe994d7..8d7bec5 100644
--- a/gm/wacky_yuv_formats.cpp
+++ b/gm/wacky_yuv_formats.cpp
@@ -503,13 +503,13 @@
YUVGenerator(const SkImageInfo& ii,
SkYUVColorSpace yuvColorSpace,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
- SkBitmap bitmaps[SkYUVSizeInfo::kMaxCount])
+ SkBitmap bitmaps[SkYUVASizeInfo::kMaxCount])
: SkImageGenerator(ii)
, fYUVColorSpace(yuvColorSpace) {
memcpy(fYUVAIndices, yuvaIndices, sizeof(fYUVAIndices));
SkAssertResult(SkYUVAIndex::AreValidIndices(fYUVAIndices, &fNumBitmaps));
- SkASSERT(fNumBitmaps > 0 && fNumBitmaps <= SkYUVSizeInfo::kMaxCount);
+ SkASSERT(fNumBitmaps > 0 && fNumBitmaps <= SkYUVASizeInfo::kMaxCount);
for (int i = 0; i < fNumBitmaps; ++i) {
fYUVBitmaps[i] = bitmaps[i];
@@ -568,7 +568,7 @@
return fFlattened.readPixels(info, pixels, rowBytes, 0, 0);
}
- bool onQueryYUVA8(SkYUVSizeInfo* size,
+ bool onQueryYUVA8(SkYUVASizeInfo* size,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* yuvColorSpace) const override {
@@ -581,7 +581,7 @@
size->fSizes[i].fHeight = fYUVBitmaps[i].height();
size->fWidthBytes[i] = fYUVBitmaps[i].rowBytes();
}
- for ( ; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for ( ; i < SkYUVASizeInfo::kMaxCount; ++i) {
size->fSizes[i].fWidth = 0;
size->fSizes[i].fHeight = 0;
size->fWidthBytes[i] = 0;
@@ -590,8 +590,8 @@
return true;
}
- bool onGetYUVA8Planes(const SkYUVSizeInfo&, const SkYUVAIndex[SkYUVAIndex::kIndexCount],
- void* planes[SkYUVSizeInfo::kMaxCount]) override {
+ bool onGetYUVA8Planes(const SkYUVASizeInfo&, const SkYUVAIndex[SkYUVAIndex::kIndexCount],
+ void* planes[SkYUVASizeInfo::kMaxCount]) override {
for (int i = 0; i < fNumBitmaps; ++i) {
planes[i] = fYUVBitmaps[i].getPixels();
}
@@ -602,7 +602,7 @@
SkYUVColorSpace fYUVColorSpace;
SkYUVAIndex fYUVAIndices[SkYUVAIndex::kIndexCount];
int fNumBitmaps;
- SkBitmap fYUVBitmaps[SkYUVSizeInfo::kMaxCount];
+ SkBitmap fYUVBitmaps[SkYUVASizeInfo::kMaxCount];
SkBitmap fFlattened;
};
diff --git a/gn/core.gni b/gn/core.gni
index 90b39bd..ff326b4 100644
--- a/gn/core.gni
+++ b/gn/core.gni
@@ -323,7 +323,7 @@
"$_src/core/SkXfermodeInterpretation.h",
"$_src/core/SkYUVPlanesCache.cpp",
"$_src/core/SkYUVPlanesCache.h",
- "$_src/core/SkYUVSizeInfo.cpp",
+ "$_src/core/SkYUVASizeInfo.cpp",
"$_src/image/SkImage.cpp",
@@ -417,7 +417,7 @@
"$_include/core/SkUnPreMultiply.h",
"$_include/core/SkVertices.h",
"$_include/core/SkYUVAIndex.h",
- "$_include/core/SkYUVSizeInfo.h",
+ "$_include/core/SkYUVASizeInfo.h",
"$_src/opts/SkBlitMask_opts.h",
"$_src/opts/SkBlitRow_opts.h",
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index 40d2d08..623a35f 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -20,7 +20,7 @@
#include "SkSize.h"
#include "SkStream.h"
#include "SkTypes.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
#include <vector>
@@ -357,7 +357,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(SkYUVASizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const {
if (nullptr == sizeInfo) {
return false;
}
@@ -385,7 +385,7 @@
* recommendation (but not smaller).
* @param planes Memory for each of the Y, U, and V planes.
*/
- Result getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[SkYUVSizeInfo::kMaxCount]) {
+ Result getYUV8Planes(const SkYUVASizeInfo& sizeInfo, void* planes[SkYUVASizeInfo::kMaxCount]) {
if (!planes || !planes[0] || !planes[1] || !planes[2]) {
return kInvalidInput;
}
@@ -720,12 +720,12 @@
void* pixels, size_t rowBytes, const Options&,
int* rowsDecoded) = 0;
- virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const {
+ virtual bool onQueryYUV8(SkYUVASizeInfo*, SkYUVColorSpace*) const {
return false;
}
- virtual Result onGetYUV8Planes(const SkYUVSizeInfo&,
- void*[SkYUVSizeInfo::kMaxCount] /*planes*/) {
+ virtual Result onGetYUV8Planes(const SkYUVASizeInfo&,
+ void*[SkYUVASizeInfo::kMaxCount] /*planes*/) {
return kUnimplemented;
}
diff --git a/include/core/SkDeferredDisplayListRecorder.h b/include/core/SkDeferredDisplayListRecorder.h
index 191d68a..b389281 100644
--- a/include/core/SkDeferredDisplayListRecorder.h
+++ b/include/core/SkDeferredDisplayListRecorder.h
@@ -23,7 +23,7 @@
class SkImage;
class SkSurface;
struct SkYUVAIndex;
-struct SkYUVSizeInfo;
+struct SkYUVASizeInfo;
/*
* This class is intended to be used as:
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h
index 444bddc..746a117 100644
--- a/include/core/SkImageGenerator.h
+++ b/include/core/SkImageGenerator.h
@@ -12,6 +12,7 @@
#include "SkColor.h"
#include "SkImage.h"
#include "SkImageInfo.h"
+#include "SkYUVAIndex.h"
#include "SkYUVASizeInfo.h"
class GrContext;
@@ -91,7 +92,7 @@
* @param yuvaIndices How the YUVA planes are organized/used
* @param colorSpace Output parameter.
*/
- bool queryYUVA8(SkYUVSizeInfo* sizeInfo,
+ bool queryYUVA8(SkYUVASizeInfo* sizeInfo,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* colorSpace) const;
@@ -107,7 +108,7 @@
* @param planes Memory for the Y, U, V, and A planes. Note that, depending on the
* settings in yuvaIndices, anywhere from 1..4 planes could be returned.
*/
- bool getYUVA8Planes(const SkYUVSizeInfo& sizeInfo,
+ bool getYUVA8Planes(const SkYUVASizeInfo& sizeInfo,
const SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
void* planes[]);
@@ -170,13 +171,10 @@
struct Options {};
virtual bool onGetPixels(const SkImageInfo&, void*, size_t, const Options&) { return false; }
virtual bool onIsValid(GrContext*) const { return true; }
- virtual bool onQueryYUVA8(SkYUVSizeInfo*, SkYUVAIndex[SkYUVAIndex::kIndexCount],
+ virtual bool onQueryYUVA8(SkYUVASizeInfo*, SkYUVAIndex[SkYUVAIndex::kIndexCount],
SkYUVColorSpace*) const { return false; }
- virtual bool onGetYUVA8Planes(const SkYUVSizeInfo&, const SkYUVAIndex[SkYUVAIndex::kIndexCount],
+ virtual bool onGetYUVA8Planes(const SkYUVASizeInfo&, const SkYUVAIndex[SkYUVAIndex::kIndexCount],
void*[4] /*planes*/) { return false; }
- // Deprecated methods
- virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const { return false; }
- virtual bool onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) { return false; }
#if SK_SUPPORT_GPU
enum class TexGenType {
kNone, //image generator does not implement onGenerateTexture
diff --git a/include/core/SkYUVASizeInfo.h b/include/core/SkYUVASizeInfo.h
index c6a413f..4df2574 100644
--- a/include/core/SkYUVASizeInfo.h
+++ b/include/core/SkYUVASizeInfo.h
@@ -8,8 +8,54 @@
#ifndef SkYUVASizeInfo_DEFINED
#define SkYUVASizeInfo_DEFINED
-#include "SkYUVSizeInfo.h"
+#include "SkImageInfo.h"
+#include "SkSize.h"
-using SkYUVASizeInfo = SkYUVSizeInfo;
+struct SkYUVASizeInfo {
+ static constexpr auto kMaxCount = 4;
+
+ SkISize fSizes[kMaxCount];
+
+ /**
+ * While the widths of the Y, U, V and A planes are not restricted, the
+ * implementation often requires that the width of the memory allocated
+ * for each plane be a multiple of 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 fWidthBytes[kMaxCount];
+
+ bool operator==(const SkYUVASizeInfo& that) const {
+ for (int i = 0; i < kMaxCount; ++i) {
+ SkASSERT((!fSizes[i].isEmpty() && fWidthBytes[i]) ||
+ (fSizes[i].isEmpty() && !fWidthBytes[i]));
+ if (fSizes[i] != that.fSizes[i] || fWidthBytes[i] != that.fWidthBytes[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ size_t computeTotalBytes() const {
+ size_t totalBytes = 0;
+
+ for (int i = 0; i < kMaxCount; ++i) {
+ SkASSERT((!fSizes[i].isEmpty() && fWidthBytes[i]) ||
+ (fSizes[i].isEmpty() && !fWidthBytes[i]));
+ totalBytes += fWidthBytes[i] * fSizes[i].height();
+ }
+
+ return totalBytes;
+ }
+
+ void computePlanes(void* base, void* planes[kMaxCount]) const;
+
+};
#endif // SkYUVASizeInfo_DEFINED
diff --git a/include/core/SkYUVSizeInfo.h b/include/core/SkYUVSizeInfo.h
deleted file mode 100644
index ddfb0c8..0000000
--- a/include/core/SkYUVSizeInfo.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkYUVSizeInfo_DEFINED
-#define SkYUVSizeInfo_DEFINED
-
-#include "SkImageInfo.h"
-#include "SkSize.h"
-#include "SkYUVAIndex.h"
-
-struct SkYUVSizeInfo {
- static constexpr auto kMaxCount = 4;
-
- SkISize fSizes[kMaxCount];
-
- /**
- * While the widths of the Y, U, V and A planes are not restricted, the
- * implementation often requires that the width of the memory allocated
- * for each plane be a multiple of 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 fWidthBytes[kMaxCount];
-
- bool operator==(const SkYUVSizeInfo& that) const {
- for (int i = 0; i < kMaxCount; ++i) {
- SkASSERT((!fSizes[i].isEmpty() && fWidthBytes[i]) ||
- (fSizes[i].isEmpty() && !fWidthBytes[i]));
- if (fSizes[i] != that.fSizes[i] || fWidthBytes[i] != that.fWidthBytes[i]) {
- return false;
- }
- }
-
- return true;
- }
-
- size_t computeTotalBytes() const {
- size_t totalBytes = 0;
-
- for (int i = 0; i < kMaxCount; ++i) {
- SkASSERT((!fSizes[i].isEmpty() && fWidthBytes[i]) ||
- (fSizes[i].isEmpty() && !fWidthBytes[i]));
- totalBytes += fWidthBytes[i] * fSizes[i].height();
- }
-
- return totalBytes;
- }
-
- void computePlanes(void* base, void* planes[kMaxCount]) const;
-
-};
-
-#endif // SkYUVSizeInfo_DEFINED
diff --git a/src/codec/SkCodecImageGenerator.cpp b/src/codec/SkCodecImageGenerator.cpp
index 3005ee3..b26fe71 100644
--- a/src/codec/SkCodecImageGenerator.cpp
+++ b/src/codec/SkCodecImageGenerator.cpp
@@ -59,7 +59,7 @@
return SkPixmapPriv::Orient(dst, fCodec->getOrigin(), decode);
}
-bool SkCodecImageGenerator::onQueryYUVA8(SkYUVSizeInfo* sizeInfo,
+bool SkCodecImageGenerator::onQueryYUVA8(SkYUVASizeInfo* sizeInfo,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* colorSpace) const {
// This image generator always returns 3 separate non-interleaved planes
@@ -75,7 +75,7 @@
return fCodec->queryYUV8(sizeInfo, colorSpace);
}
-bool SkCodecImageGenerator::onGetYUVA8Planes(const SkYUVSizeInfo& sizeInfo,
+bool SkCodecImageGenerator::onGetYUVA8Planes(const SkYUVASizeInfo& sizeInfo,
const SkYUVAIndex indices[SkYUVAIndex::kIndexCount],
void* planes[]) {
SkCodec::Result result = fCodec->getYUV8Planes(sizeInfo, planes);
diff --git a/src/codec/SkCodecImageGenerator.h b/src/codec/SkCodecImageGenerator.h
index 9a64b7c..de6cf93 100644
--- a/src/codec/SkCodecImageGenerator.h
+++ b/src/codec/SkCodecImageGenerator.h
@@ -26,9 +26,9 @@
const SkImageInfo& info, void* pixels, size_t rowBytes, const Options& opts) override;
bool onQueryYUVA8(
- SkYUVSizeInfo*, SkYUVAIndex[SkYUVAIndex::kIndexCount], SkYUVColorSpace*) const override;
+ SkYUVASizeInfo*, SkYUVAIndex[SkYUVAIndex::kIndexCount], SkYUVColorSpace*) const override;
- bool onGetYUVA8Planes(const SkYUVSizeInfo&, const SkYUVAIndex[SkYUVAIndex::kIndexCount],
+ bool onGetYUVA8Planes(const SkYUVASizeInfo&, const SkYUVAIndex[SkYUVAIndex::kIndexCount],
void* planes[]) override;
private:
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index f857c22..77ec70f 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -839,7 +839,7 @@
(4 == hSampY && 2 == vSampY);
}
-bool SkJpegCodec::onQueryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const {
+bool SkJpegCodec::onQueryYUV8(SkYUVASizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const {
jpeg_decompress_struct* dinfo = fDecoderMgr->dinfo();
if (!is_yuv_supported(dinfo)) {
return false;
@@ -861,9 +861,9 @@
return true;
}
-SkCodec::Result SkJpegCodec::onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo,
- void* planes[SkYUVSizeInfo::kMaxCount]) {
- SkYUVSizeInfo defaultInfo;
+SkCodec::Result SkJpegCodec::onGetYUV8Planes(const SkYUVASizeInfo& sizeInfo,
+ void* planes[SkYUVASizeInfo::kMaxCount]) {
+ SkYUVASizeInfo defaultInfo;
// This will check is_yuv_supported(), so we don't need to here.
bool supportsYUV = this->onQueryYUV8(&defaultInfo, nullptr);
@@ -962,7 +962,7 @@
// this requirement using a dummy row buffer.
// FIXME: Should SkCodec have an extra memory buffer that can be shared among
// all of the implementations that use temporary/garbage memory?
- SkAutoTMalloc<JSAMPLE> dummyRow(sizeInfo.fWidthBytes[SkYUVAIndex::kY_Index]);
+ SkAutoTMalloc<JSAMPLE> dummyRow(sizeInfo.fWidthBytes[0]);
for (int i = remainingRows; i < numYRowsPerBlock; i++) {
rowptrs[i] = dummyRow.get();
}
diff --git a/src/codec/SkJpegCodec.h b/src/codec/SkJpegCodec.h
index c102627..5617c6b 100644
--- a/src/codec/SkJpegCodec.h
+++ b/src/codec/SkJpegCodec.h
@@ -44,10 +44,10 @@
Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, const Options&,
int*) override;
- bool onQueryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const override;
+ bool onQueryYUV8(SkYUVASizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const override;
- Result onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo,
- void* planes[SkYUVSizeInfo::kMaxCount]) override;
+ Result onGetYUV8Planes(const SkYUVASizeInfo& sizeInfo,
+ void* planes[SkYUVASizeInfo::kMaxCount]) override;
SkEncodedImageFormat onGetEncodedFormat() const override {
return SkEncodedImageFormat::kJPEG;
diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp
index 4654b6c..9d5f17a 100644
--- a/src/core/SkDeferredDisplayListRecorder.cpp
+++ b/src/core/SkDeferredDisplayListRecorder.cpp
@@ -64,7 +64,7 @@
#include "SkImage_Gpu.h"
#include "SkImage_GpuYUVA.h"
#include "SkSurface_Gpu.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
SkDeferredDisplayListRecorder::SkDeferredDisplayListRecorder(const SkSurfaceCharacterization& c)
: fCharacterization(c) {
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp
index 1f16bc8..8b17911 100644
--- a/src/core/SkImageGenerator.cpp
+++ b/src/core/SkImageGenerator.cpp
@@ -30,78 +30,19 @@
return this->onGetPixels(info, pixels, rowBytes, defaultOpts);
}
-bool SkImageGenerator::queryYUVA8(SkYUVSizeInfo* sizeInfo,
+bool SkImageGenerator::queryYUVA8(SkYUVASizeInfo* sizeInfo,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* colorSpace) const {
SkASSERT(sizeInfo);
- if (!this->onQueryYUVA8(sizeInfo, yuvaIndices, colorSpace)) {
- // try the deprecated method and make a guess at the other data
- if (this->onQueryYUV8(sizeInfo, colorSpace)) {
- // take a guess at the number of planes
- int numPlanes = 3; // onQueryYUV8 only supports up to 3 channels
- for (int i = 0; i < 3; ++i) {
- if (sizeInfo->fSizes[i].isEmpty()) {
- numPlanes = i;
- break;
- }
- }
- if (!numPlanes) {
- return false;
- }
- switch (numPlanes) {
- case 1:
- // Assume 3 interleaved planes
- yuvaIndices[SkYUVAIndex::kY_Index].fIndex = 0;
- yuvaIndices[SkYUVAIndex::kY_Index].fChannel = SkColorChannel::kR;
- yuvaIndices[SkYUVAIndex::kU_Index].fIndex = 0;
- yuvaIndices[SkYUVAIndex::kU_Index].fChannel = SkColorChannel::kG;
- yuvaIndices[SkYUVAIndex::kV_Index].fIndex = 0;
- yuvaIndices[SkYUVAIndex::kV_Index].fChannel = SkColorChannel::kB;
- yuvaIndices[SkYUVAIndex::kA_Index].fIndex = -1;
- yuvaIndices[SkYUVAIndex::kA_Index].fChannel = SkColorChannel::kR;
- break;
- case 2:
- // Assume Y plane and interleaved UV plane (NV12)
- yuvaIndices[SkYUVAIndex::kY_Index].fIndex = 0;
- yuvaIndices[SkYUVAIndex::kY_Index].fChannel = SkColorChannel::kR;
- yuvaIndices[SkYUVAIndex::kU_Index].fIndex = 1;
- yuvaIndices[SkYUVAIndex::kU_Index].fChannel = SkColorChannel::kR;
- yuvaIndices[SkYUVAIndex::kV_Index].fIndex = 1;
- yuvaIndices[SkYUVAIndex::kV_Index].fChannel = SkColorChannel::kG;
- yuvaIndices[SkYUVAIndex::kA_Index].fIndex = -1;
- yuvaIndices[SkYUVAIndex::kA_Index].fChannel = SkColorChannel::kR;
- break;
- case 3:
- default:
- // Assume 3 separate non-interleaved planes
- yuvaIndices[SkYUVAIndex::kY_Index].fIndex = 0;
- yuvaIndices[SkYUVAIndex::kY_Index].fChannel = SkColorChannel::kR;
- yuvaIndices[SkYUVAIndex::kU_Index].fIndex = 1;
- yuvaIndices[SkYUVAIndex::kU_Index].fChannel = SkColorChannel::kR;
- yuvaIndices[SkYUVAIndex::kV_Index].fIndex = 2;
- yuvaIndices[SkYUVAIndex::kV_Index].fChannel = SkColorChannel::kR;
- yuvaIndices[SkYUVAIndex::kA_Index].fIndex = -1;
- yuvaIndices[SkYUVAIndex::kA_Index].fChannel = SkColorChannel::kR;
- break;
- }
- // clear fourth element in sizeInfo to ensure it's initialized
- sizeInfo->fSizes[3].fWidth = sizeInfo->fSizes[3].fHeight = sizeInfo->fWidthBytes[3] = 0;
-
- return true;
- }
-
- return false;
- }
-
- return true;
+ return this->onQueryYUVA8(sizeInfo, yuvaIndices, colorSpace);
}
-bool SkImageGenerator::getYUVA8Planes(const SkYUVSizeInfo& sizeInfo,
+bool SkImageGenerator::getYUVA8Planes(const SkYUVASizeInfo& sizeInfo,
const SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
- void* planes[SkYUVSizeInfo::kMaxCount]) {
+ void* planes[SkYUVASizeInfo::kMaxCount]) {
- for (int i = 0; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = 0; i < SkYUVASizeInfo::kMaxCount; ++i) {
SkASSERT(sizeInfo.fSizes[i].fWidth >= 0);
SkASSERT(sizeInfo.fSizes[i].fHeight >= 0);
SkASSERT(sizeInfo.fWidthBytes[i] >= (size_t) sizeInfo.fSizes[i].fWidth);
@@ -114,10 +55,7 @@
SkASSERT(planes[i]);
}
- if (!this->onGetYUVA8Planes(sizeInfo, yuvaIndices, planes)) {
- return this->onGetYUV8Planes(sizeInfo, planes);
- }
- return true;
+ return this->onGetYUVA8Planes(sizeInfo, yuvaIndices, planes);
}
#if SK_SUPPORT_GPU
diff --git a/src/core/SkYUVSizeInfo.cpp b/src/core/SkYUVASizeInfo.cpp
similarity index 65%
rename from src/core/SkYUVSizeInfo.cpp
rename to src/core/SkYUVASizeInfo.cpp
index 7ebdbb9..cf4d303 100644
--- a/src/core/SkYUVSizeInfo.cpp
+++ b/src/core/SkYUVASizeInfo.cpp
@@ -5,19 +5,19 @@
* found in the LICENSE file.
*/
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
#include "SkTemplates.h"
-void SkYUVSizeInfo::computePlanes(void* base, void* planes[SkYUVSizeInfo::kMaxCount]) const {
+void SkYUVASizeInfo::computePlanes(void* base, void* planes[SkYUVASizeInfo::kMaxCount]) const {
planes[0] = base;
int i = 1;
- for (; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (; i < SkYUVASizeInfo::kMaxCount; ++i) {
if (fSizes[i].isEmpty()) {
break;
}
planes[i] = SkTAddOffset<void>(planes[i - 1], fWidthBytes[i - 1] * fSizes[i - 1].height());
}
- for (; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (; i < SkYUVASizeInfo::kMaxCount; ++i) {
planes[i] = nullptr;
}
}
diff --git a/src/core/SkYUVPlanesCache.h b/src/core/SkYUVPlanesCache.h
index 648f194..3976800 100644
--- a/src/core/SkYUVPlanesCache.h
+++ b/src/core/SkYUVPlanesCache.h
@@ -11,7 +11,7 @@
#include "SkCachedData.h"
#include "SkImageInfo.h"
#include "SkYUVAIndex.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
class SkResourceCache;
@@ -25,7 +25,7 @@
* fColorSpace: color space that will be used for the YUV -> RGB conversion.
*/
struct Info {
- SkYUVSizeInfo fSizeInfo;
+ SkYUVASizeInfo fSizeInfo;
SkYUVAIndex fYUVAIndices[SkYUVAIndex::kIndexCount];
SkYUVColorSpace fColorSpace;
};
diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp
index c85d294..b573744 100644
--- a/src/gpu/GrYUVProvider.cpp
+++ b/src/gpu/GrYUVProvider.cpp
@@ -21,20 +21,20 @@
#include "SkYUVAIndex.h"
#include "effects/GrYUVtoRGBEffect.h"
-sk_sp<SkCachedData> GrYUVProvider::getPlanes(SkYUVSizeInfo* size,
+sk_sp<SkCachedData> GrYUVProvider::getPlanes(SkYUVASizeInfo* size,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* colorSpace,
- const void* constPlanes[SkYUVSizeInfo::kMaxCount]) {
+ const void* constPlanes[SkYUVASizeInfo::kMaxCount]) {
sk_sp<SkCachedData> data;
SkYUVPlanesCache::Info yuvInfo;
data.reset(SkYUVPlanesCache::FindAndRef(this->onGetID(), &yuvInfo));
- void* planes[SkYUVSizeInfo::kMaxCount];
+ void* planes[SkYUVASizeInfo::kMaxCount];
if (data.get()) {
planes[0] = (void*)data->data(); // we should always have at least one plane
- for (int i = 1; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = 1; i < SkYUVASizeInfo::kMaxCount; ++i) {
if (!yuvInfo.fSizeInfo.fWidthBytes[i]) {
SkASSERT(!yuvInfo.fSizeInfo.fWidthBytes[i] &&
!yuvInfo.fSizeInfo.fSizes[i].fHeight);
@@ -53,7 +53,7 @@
// Allocate the memory for YUVA
size_t totalSize(0);
- for (int i = 0; i < SkYUVSizeInfo::kMaxCount; i++) {
+ for (int i = 0; i < SkYUVASizeInfo::kMaxCount; i++) {
SkASSERT((yuvInfo.fSizeInfo.fWidthBytes[i] && yuvInfo.fSizeInfo.fSizes[i].fHeight) ||
(!yuvInfo.fSizeInfo.fWidthBytes[i] && !yuvInfo.fSizeInfo.fSizes[i].fHeight));
@@ -64,7 +64,7 @@
planes[0] = data->writable_data();
- for (int i = 1; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = 1; i < SkYUVASizeInfo::kMaxCount; ++i) {
if (!yuvInfo.fSizeInfo.fWidthBytes[i]) {
SkASSERT(!yuvInfo.fSizeInfo.fWidthBytes[i] &&
!yuvInfo.fSizeInfo.fSizes[i].fHeight);
@@ -104,10 +104,10 @@
sk_sp<GrTextureProxy> GrYUVProvider::refAsTextureProxy(GrContext* ctx, const GrSurfaceDesc& desc,
SkColorSpace* srcColorSpace,
SkColorSpace* dstColorSpace) {
- SkYUVSizeInfo yuvSizeInfo;
+ SkYUVASizeInfo yuvSizeInfo;
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount];
SkYUVColorSpace yuvColorSpace;
- const void* planes[SkYUVSizeInfo::kMaxCount];
+ const void* planes[SkYUVASizeInfo::kMaxCount];
sk_sp<SkCachedData> dataStorage = this->getPlanes(&yuvSizeInfo, yuvaIndices,
&yuvColorSpace, planes);
@@ -115,8 +115,8 @@
return nullptr;
}
- sk_sp<GrTextureProxy> yuvTextureProxies[SkYUVSizeInfo::kMaxCount];
- for (int i = 0; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ sk_sp<GrTextureProxy> yuvTextureProxies[SkYUVASizeInfo::kMaxCount];
+ for (int i = 0; i < SkYUVASizeInfo::kMaxCount; ++i) {
if (yuvSizeInfo.fSizes[i].isEmpty()) {
SkASSERT(!yuvSizeInfo.fWidthBytes[i]);
continue;
diff --git a/src/gpu/GrYUVProvider.h b/src/gpu/GrYUVProvider.h
index 505274e..e62a2ee 100644
--- a/src/gpu/GrYUVProvider.h
+++ b/src/gpu/GrYUVProvider.h
@@ -10,14 +10,14 @@
#include "GrTypes.h"
#include "SkImageInfo.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVAIndex.h"
+#include "SkYUVASizeInfo.h"
class GrContext;
struct GrSurfaceDesc;
class GrTexture;
class GrTextureProxy;
class SkCachedData;
-struct SkYUVAIndex;
/**
* There are at least 2 different ways to extract/retrieve YUV planar data...
@@ -44,8 +44,8 @@
SkColorSpace* srcColorSpace,
SkColorSpace* dstColorSpace);
- sk_sp<SkCachedData> getPlanes(SkYUVSizeInfo*, SkYUVAIndex[SkYUVAIndex::kIndexCount],
- SkYUVColorSpace*, const void* planes[SkYUVSizeInfo::kMaxCount]);
+ sk_sp<SkCachedData> getPlanes(SkYUVASizeInfo*, SkYUVAIndex[SkYUVAIndex::kIndexCount],
+ SkYUVColorSpace*, const void* planes[SkYUVASizeInfo::kMaxCount]);
private:
virtual uint32_t onGetID() const = 0;
@@ -61,7 +61,7 @@
* @param yuvaIndices How the YUVA planes are used/organized
* @param colorSpace Output parameter.
*/
- virtual bool onQueryYUVA8(SkYUVSizeInfo* sizeInfo,
+ virtual bool onQueryYUVA8(SkYUVASizeInfo* sizeInfo,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* colorSpace) const = 0;
@@ -76,7 +76,7 @@
* @param yuvaIndices How the YUVA planes are used/organized
* @param planes Memory for each of the Y, U, V, and A planes.
*/
- virtual bool onGetYUVA8Planes(const SkYUVSizeInfo& sizeInfo,
+ virtual bool onGetYUVA8Planes(const SkYUVASizeInfo& sizeInfo,
const SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
void* planes[]) = 0;
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 5825fd9..86c36e1 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -220,7 +220,7 @@
return as_IB(this)->onAsLegacyBitmap(bitmap);
}
-sk_sp<SkCachedData> SkImage_Base::getPlanes(SkYUVSizeInfo*, SkYUVAIndex[4],
+sk_sp<SkCachedData> SkImage_Base::getPlanes(SkYUVASizeInfo*, SkYUVAIndex[4],
SkYUVColorSpace*, const void*[4]) {
return nullptr;
}
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index bcec5a1..8cb796f 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -23,7 +23,7 @@
class GrSamplerState;
class SkCachedData;
-struct SkYUVSizeInfo;
+struct SkYUVASizeInfo;
enum {
kNeedNewImageUniqueID = 0
@@ -70,7 +70,7 @@
virtual sk_sp<SkImage> onMakeSubset(const SkIRect&) const = 0;
- virtual sk_sp<SkCachedData> getPlanes(SkYUVSizeInfo*, SkYUVAIndex[4],
+ virtual sk_sp<SkCachedData> getPlanes(SkYUVASizeInfo*, SkYUVAIndex[4],
SkYUVColorSpace*, const void* planes[4]);
virtual sk_sp<SkData> onRefEncoded() const { return nullptr; }
diff --git a/src/image/SkImage_GpuYUVA.cpp b/src/image/SkImage_GpuYUVA.cpp
index 1033358..ae15f4b 100644
--- a/src/image/SkImage_GpuYUVA.cpp
+++ b/src/image/SkImage_GpuYUVA.cpp
@@ -16,7 +16,7 @@
#include "GrTexture.h"
#include "SkImage_Gpu.h"
#include "SkImage_GpuYUVA.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
#include "effects/GrYUVtoRGBEffect.h"
SkImage_GpuYUVA::SkImage_GpuYUVA(sk_sp<GrContext> context, int width, int height, uint32_t uniqueID,
@@ -156,7 +156,7 @@
return nullptr;
}
}
- for (int i = numTextures; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = numTextures; i < SkYUVASizeInfo::kMaxCount; ++i) {
if (!yuvaSizes[i].isEmpty()) {
return nullptr;
}
diff --git a/src/image/SkImage_GpuYUVA.h b/src/image/SkImage_GpuYUVA.h
index ebeaf8c..2b4a5dd 100644
--- a/src/image/SkImage_GpuYUVA.h
+++ b/src/image/SkImage_GpuYUVA.h
@@ -15,7 +15,7 @@
#include "SkYUVAIndex.h"
class GrTexture;
-struct SkYUVSizeInfo;
+struct SkYUVASizeInfo;
// Wraps the 3 or 4 planes of a YUVA image for consumption by the GPU.
// Initially any direct rendering will be done by passing the individual planes to a shader.
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index b5f72e3..b7da07d 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -296,12 +296,12 @@
private:
uint32_t onGetID() const override { return fGen->uniqueID(); }
- bool onQueryYUVA8(SkYUVSizeInfo* sizeInfo,
+ bool onQueryYUVA8(SkYUVASizeInfo* sizeInfo,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* colorSpace) const override {
return fGen->queryYUVA8(sizeInfo, yuvaIndices, colorSpace);
}
- bool onGetYUVA8Planes(const SkYUVSizeInfo& sizeInfo,
+ bool onGetYUVA8Planes(const SkYUVASizeInfo& sizeInfo,
const SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
void* planes[]) override {
return fGen->getYUVA8Planes(sizeInfo, yuvaIndices, planes);
@@ -329,10 +329,10 @@
}
}
-sk_sp<SkCachedData> SkImage_Lazy::getPlanes(SkYUVSizeInfo* yuvaSizeInfo,
+sk_sp<SkCachedData> SkImage_Lazy::getPlanes(SkYUVASizeInfo* yuvaSizeInfo,
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount],
SkYUVColorSpace* yuvColorSpace,
- const void* planes[SkYUVSizeInfo::kMaxCount]) {
+ const void* planes[SkYUVASizeInfo::kMaxCount]) {
ScopedGenerator generator(fSharedGenerator);
Generator_GrYUVProvider provider(generator);
diff --git a/src/image/SkImage_Lazy.h b/src/image/SkImage_Lazy.h
index bfba3b1..dbec740 100644
--- a/src/image/SkImage_Lazy.h
+++ b/src/image/SkImage_Lazy.h
@@ -48,7 +48,7 @@
sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*,
const GrSamplerState&,
SkScalar scaleAdjust[2]) const override;
- sk_sp<SkCachedData> getPlanes(SkYUVSizeInfo*, SkYUVAIndex[4],
+ sk_sp<SkCachedData> getPlanes(SkYUVASizeInfo*, SkYUVAIndex[4],
SkYUVColorSpace*, const void* planes[4]) override;
#endif
sk_sp<SkData> onRefEncoded() const override;
diff --git a/tests/ImageGeneratorTest.cpp b/tests/ImageGeneratorTest.cpp
index 907efc0..790b422 100644
--- a/tests/ImageGeneratorTest.cpp
+++ b/tests/ImageGeneratorTest.cpp
@@ -62,7 +62,7 @@
DEF_TEST(ImageGenerator, reporter) {
MyImageGenerator ig;
- SkYUVSizeInfo sizeInfo;
+ SkYUVASizeInfo sizeInfo;
sizeInfo.fSizes[0] = SkISize::Make(200, 200);
sizeInfo.fSizes[1] = SkISize::Make(100, 100);
sizeInfo.fSizes[2] = SkISize::Make( 50, 50);
diff --git a/tests/YUVCacheTest.cpp b/tests/YUVCacheTest.cpp
index f4d9292..0908bdd 100644
--- a/tests/YUVCacheTest.cpp
+++ b/tests/YUVCacheTest.cpp
@@ -32,7 +32,7 @@
SkResourceCache cache(1024);
SkYUVPlanesCache::Info yuvInfo;
- for (int i = 0; i < SkYUVSizeInfo::kMaxCount; i++) {
+ for (int i = 0; i < SkYUVASizeInfo::kMaxCount; i++) {
yuvInfo.fSizeInfo.fSizes[i].fWidth = 20 * (i + 1);
yuvInfo.fSizeInfo.fSizes[i].fHeight = 10 * (i + 1);
yuvInfo.fSizeInfo.fWidthBytes[i] = 80 * (i + 1);
diff --git a/tests/YUVTest.cpp b/tests/YUVTest.cpp
index 50e36fd..faa9c28 100644
--- a/tests/YUVTest.cpp
+++ b/tests/YUVTest.cpp
@@ -10,7 +10,7 @@
#include "SkCodec.h"
#include "SkStream.h"
#include "SkTemplates.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
#include "Test.h"
static void codec_yuv(skiatest::Reporter* reporter,
@@ -27,7 +27,7 @@
}
// Test queryYUV8()
- SkYUVSizeInfo info;
+ SkYUVASizeInfo info;
{
bool success = codec->queryYUV8(nullptr, nullptr);
@@ -38,7 +38,7 @@
return;
}
- for (int i = 0; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = 0; i < SkYUVASizeInfo::kMaxCount; ++i) {
REPORTER_ASSERT(reporter, info.fSizes[i] == expectedSizes[i]);
REPORTER_ASSERT(reporter,
info.fWidthBytes[i] == (uint32_t) SkAlign8(info.fSizes[i].width()));
@@ -53,7 +53,7 @@
return;
}
- for (int i = 0; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = 0; i < SkYUVASizeInfo::kMaxCount; ++i) {
REPORTER_ASSERT(reporter, info.fSizes[i] == expectedSizes[i]);
REPORTER_ASSERT(reporter,
info.fWidthBytes[i] == (uint32_t) SkAlign8(info.fSizes[i].width()));
@@ -65,7 +65,7 @@
size_t totalBytes = info.computeTotalBytes();
SkAutoMalloc storage(totalBytes);
- void* planes[SkYUVSizeInfo::kMaxCount];
+ void* planes[SkYUVASizeInfo::kMaxCount];
info.computePlanes(storage.get(), planes);
diff --git a/tools/DDLPromiseImageHelper.cpp b/tools/DDLPromiseImageHelper.cpp
index ab21057..53fcd1c 100644
--- a/tools/DDLPromiseImageHelper.cpp
+++ b/tools/DDLPromiseImageHelper.cpp
@@ -14,7 +14,7 @@
#include "SkDeferredDisplayListRecorder.h"
#include "SkImage_Base.h"
#include "SkYUVAIndex.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
DDLPromiseImageHelper::PromiseImageCallbackContext::~PromiseImageCallbackContext() {
GrGpu* gpu = fContext->contextPriv().getGpu();
@@ -142,9 +142,9 @@
sk_sp<SkImage> image;
if (curImage.isYUV()) {
- GrBackendFormat backendFormats[SkYUVSizeInfo::kMaxCount];
- void* contexts[SkYUVSizeInfo::kMaxCount] = { nullptr, nullptr, nullptr, nullptr };
- SkISize sizes[SkYUVSizeInfo::kMaxCount];
+ GrBackendFormat backendFormats[SkYUVASizeInfo::kMaxCount];
+ void* contexts[SkYUVASizeInfo::kMaxCount] = { nullptr, nullptr, nullptr, nullptr };
+ SkISize sizes[SkYUVASizeInfo::kMaxCount];
// TODO: store this value somewhere?
int textureCount;
SkAssertResult(SkYUVAIndex::AreValidIndices(curImage.yuvaIndices(), &textureCount));
@@ -155,7 +155,7 @@
contexts[i] = curImage.refCallbackContext(i).release();
sizes[i].set(curImage.yuvPixmap(i).width(), curImage.yuvPixmap(i).height());
}
- for (int i = textureCount; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = textureCount; i < SkYUVASizeInfo::kMaxCount; ++i) {
sizes[i] = SkISize::MakeEmpty();
}
@@ -219,17 +219,17 @@
image->uniqueID(),
overallII);
- SkYUVSizeInfo yuvaSizeInfo;
+ SkYUVASizeInfo yuvaSizeInfo;
SkYUVAIndex yuvaIndices[SkYUVAIndex::kIndexCount];
SkYUVColorSpace yuvColorSpace;
- const void* planes[SkYUVSizeInfo::kMaxCount];
+ const void* planes[SkYUVASizeInfo::kMaxCount];
sk_sp<SkCachedData> yuvData = ib->getPlanes(&yuvaSizeInfo, yuvaIndices, &yuvColorSpace, planes);
if (yuvData) {
newImageInfo.setYUVData(std::move(yuvData), yuvaIndices, yuvColorSpace);
// determine colortypes from index data
// for testing we only ever use A8 or RGBA8888
- SkColorType colorTypes[SkYUVSizeInfo::kMaxCount] = {
+ SkColorType colorTypes[SkYUVASizeInfo::kMaxCount] = {
kUnknown_SkColorType, kUnknown_SkColorType,
kUnknown_SkColorType, kUnknown_SkColorType
};
@@ -246,7 +246,7 @@
}
}
- for (int i = 0; i < SkYUVSizeInfo::kMaxCount; ++i) {
+ for (int i = 0; i < SkYUVASizeInfo::kMaxCount; ++i) {
if (yuvaSizeInfo.fSizes[i].isEmpty()) {
SkASSERT(!yuvaSizeInfo.fWidthBytes[i] && kUnknown_SkColorType == colorTypes[i]);
continue;
diff --git a/tools/DDLPromiseImageHelper.h b/tools/DDLPromiseImageHelper.h
index 763fe05..583f3fd 100644
--- a/tools/DDLPromiseImageHelper.h
+++ b/tools/DDLPromiseImageHelper.h
@@ -14,7 +14,7 @@
#include "GrBackendSurface.h"
#include "SkCachedData.h"
#include "SkYUVAIndex.h"
-#include "SkYUVSizeInfo.h"
+#include "SkYUVASizeInfo.h"
class GrContext;
class SkDeferredDisplayListRecorder;
@@ -124,7 +124,7 @@
}
const SkPixmap& yuvPixmap(int index) const {
SkASSERT(this->isYUV());
- SkASSERT(index >= 0 && index < SkYUVSizeInfo::kMaxCount);
+ SkASSERT(index >= 0 && index < SkYUVASizeInfo::kMaxCount);
return fYUVPlanes[index];
}
const SkBitmap& normalBitmap() const {
@@ -133,22 +133,22 @@
}
void setCallbackContext(int index, sk_sp<PromiseImageCallbackContext> callbackContext) {
- SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVSizeInfo::kMaxCount : 1));
+ SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVASizeInfo::kMaxCount : 1));
fCallbackContexts[index] = callbackContext;
}
PromiseImageCallbackContext* callbackContext(int index) {
- SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVSizeInfo::kMaxCount : 1));
+ SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVASizeInfo::kMaxCount : 1));
return fCallbackContexts[index].get();
}
sk_sp<PromiseImageCallbackContext> refCallbackContext(int index) const {
- SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVSizeInfo::kMaxCount : 1));
+ SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVASizeInfo::kMaxCount : 1));
return fCallbackContexts[index];
}
const GrCaps* caps() const { return fCallbackContexts[0]->caps(); }
const GrBackendTexture& backendTexture(int index) const {
- SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVSizeInfo::kMaxCount : 1));
+ SkASSERT(index >= 0 && index < (this->isYUV() ? SkYUVASizeInfo::kMaxCount : 1));
return fCallbackContexts[index]->backendTexture();
}
@@ -163,7 +163,7 @@
}
void addYUVPlane(int index, const SkImageInfo& ii, const void* plane, size_t widthBytes) {
SkASSERT(this->isYUV());
- SkASSERT(index >= 0 && index < SkYUVSizeInfo::kMaxCount);
+ SkASSERT(index >= 0 && index < SkYUVASizeInfo::kMaxCount);
fYUVPlanes[index].reset(ii, plane, widthBytes);
}
@@ -180,10 +180,10 @@
sk_sp<SkCachedData> fYUVData; // when !null, this is a YUV image
SkYUVColorSpace fYUVColorSpace = kJPEG_SkYUVColorSpace;
SkYUVAIndex fYUVAIndices[SkYUVAIndex::kIndexCount];
- SkPixmap fYUVPlanes[SkYUVSizeInfo::kMaxCount];
+ SkPixmap fYUVPlanes[SkYUVASizeInfo::kMaxCount];
- // Up to SkYUVSizeInfo::kMaxCount for a YUVA image. Only one for a normal image.
- sk_sp<PromiseImageCallbackContext> fCallbackContexts[SkYUVSizeInfo::kMaxCount];
+ // Up to SkYUVASizeInfo::kMaxCount for a YUVA image. Only one for a normal image.
+ sk_sp<PromiseImageCallbackContext> fCallbackContexts[SkYUVASizeInfo::kMaxCount];
};
// This stack-based context allows each thread to re-inflate the image indices into