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

Unified Diff: tests/ImageGeneratorTest.cpp

Issue 1716523002: Update Skia's YUV API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 9 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 | « src/lazy/SkDiscardablePixelRef.h ('k') | tests/YUVCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.h ('k') | tests/YUVCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698