Index: tests/ImageGeneratorTest.cpp |
diff --git a/tests/ImageGeneratorTest.cpp b/tests/ImageGeneratorTest.cpp |
index 3d750b2c7327cc909ba78fa5911d7c711a4c4ed5..7288ecf0a93416375bdbdf640af26f4be958f3d0 100644 |
--- a/tests/ImageGeneratorTest.cpp |
+++ b/tests/ImageGeneratorTest.cpp |
@@ -46,25 +46,27 @@ |
DEF_TEST(ImageGenerator, reporter) { |
MyImageGenerator ig; |
- SkYUVSizeInfo sizeInfo; |
- sizeInfo.fSizes[SkYUVSizeInfo::kY] = SkISize::Make(200, 200); |
- sizeInfo.fSizes[SkYUVSizeInfo::kU] = SkISize::Make(100, 100); |
- sizeInfo.fSizes[SkYUVSizeInfo::kV] = SkISize::Make( 50, 50); |
- sizeInfo.fWidthBytes[SkYUVSizeInfo::kY] = 0; |
- sizeInfo.fWidthBytes[SkYUVSizeInfo::kU] = 0; |
- sizeInfo.fWidthBytes[SkYUVSizeInfo::kV] = 0; |
- void* planes[3] = { nullptr }; |
+ SkISize sizes[3]; |
+ sizes[0] = SkISize::Make(200, 200); |
+ sizes[1] = SkISize::Make(100, 100); |
+ sizes[2] = SkISize::Make( 50, 50); |
+ void* planes[3] = { nullptr }; |
+ size_t rowBytes[3] = { 0 }; |
SkYUVColorSpace colorSpace; |
// Check that the YUV decoding API does not cause any crashes |
- ig.queryYUV8(&sizeInfo, nullptr); |
- ig.queryYUV8(&sizeInfo, &colorSpace); |
- sizeInfo.fWidthBytes[SkYUVSizeInfo::kY] = 250; |
- sizeInfo.fWidthBytes[SkYUVSizeInfo::kU] = 250; |
- sizeInfo.fWidthBytes[SkYUVSizeInfo::kV] = 250; |
+ ig.getYUV8Planes(sizes, nullptr, nullptr, &colorSpace); |
+ ig.getYUV8Planes(sizes, nullptr, nullptr, nullptr); |
+ ig.getYUV8Planes(sizes, planes, nullptr, nullptr); |
+ ig.getYUV8Planes(sizes, nullptr, rowBytes, nullptr); |
+ ig.getYUV8Planes(sizes, planes, rowBytes, nullptr); |
+ ig.getYUV8Planes(sizes, planes, rowBytes, &colorSpace); |
+ |
int dummy; |
- planes[SkYUVSizeInfo::kY] = planes[SkYUVSizeInfo::kU] = planes[SkYUVSizeInfo::kV] = &dummy; |
- ig.getYUV8Planes(sizeInfo, planes); |
+ planes[0] = planes[1] = planes[2] = &dummy; |
+ rowBytes[0] = rowBytes[1] = rowBytes[2] = 250; |
+ |
+ ig.getYUV8Planes(sizes, planes, rowBytes, &colorSpace); |
// Suppressed due to https://code.google.com/p/skia/issues/detail?id=4339 |
if (false) { |