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