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

Unified Diff: tests/ImageGeneratorTest.cpp

Issue 1775493002: Revert of Update Skia's YUV API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 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) {
« 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