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

Unified Diff: tests/ImageGeneratorTest.cpp

Issue 1716523002: Update Skia's YUV API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: tests/ImageGeneratorTest.cpp
diff --git a/tests/ImageGeneratorTest.cpp b/tests/ImageGeneratorTest.cpp
index 7288ecf0a93416375bdbdf640af26f4be958f3d0..6169c56113a1b8dfc66964530031500e4289040c 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);
+ YUVSizeInfo sizeInfo;
+ sizeInfo.fYSize = SkISize::Make(200, 200);
+ sizeInfo.fUSize = SkISize::Make(100, 100);
+ sizeInfo.fVSize = SkISize::Make( 50, 50);
+ sizeInfo.fYWidthBytes = 0;
+ sizeInfo.fUWidthBytes = 0;
+ sizeInfo.fVWidthBytes = 0;
void* planes[3] = { nullptr };
- size_t rowBytes[3] = { 0 };
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.fYWidthBytes = 250;
+ sizeInfo.fUWidthBytes = 250;
+ sizeInfo.fVWidthBytes = 250;
int dummy;
planes[0] = planes[1] = planes[2] = &dummy;
- rowBytes[0] = rowBytes[1] = rowBytes[2] = 250;
-
- ig.getYUV8Planes(sizes, planes, rowBytes, &colorSpace);
+ ig.getYUV8Planes(sizeInfo, planes);
// Suppressed due to https://code.google.com/p/skia/issues/detail?id=4339
if (false) {

Powered by Google App Engine
This is Rietveld 408576698