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

Unified Diff: tests/YUVTest.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 | « tests/YUVCacheTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/YUVTest.cpp
diff --git a/tests/YUVTest.cpp b/tests/YUVTest.cpp
index e1d8961205677479e81b5d59e0eed3bd4c0f145e..b8c4e3598e1fb2c46db2784931b8c88db5c6ab7a 100644
--- a/tests/YUVTest.cpp
+++ b/tests/YUVTest.cpp
@@ -9,7 +9,6 @@
#include "Resources.h"
#include "SkStream.h"
#include "SkTemplates.h"
-#include "SkYUVSizeInfo.h"
#include "Test.h"
static SkStreamAsset* resource(const char path[]) {
@@ -32,7 +31,7 @@
}
// Test queryYUV8()
- SkYUVSizeInfo info;
+ SkCodec::YUVSizeInfo info;
bool success = codec->queryYUV8(nullptr, nullptr);
REPORTER_ASSERT(reporter, !success);
success = codec->queryYUV8(&info, nullptr);
@@ -42,36 +41,27 @@
}
REPORTER_ASSERT(reporter,
0 == memcmp((const void*) &info, (const void*) expectedSizes, 3 * sizeof(SkISize)));
- REPORTER_ASSERT(reporter, info.fWidthBytes[SkYUVSizeInfo::kY] ==
- (uint32_t) SkAlign8(info.fSizes[SkYUVSizeInfo::kY].width()));
- REPORTER_ASSERT(reporter, info.fWidthBytes[SkYUVSizeInfo::kU] ==
- (uint32_t) SkAlign8(info.fSizes[SkYUVSizeInfo::kU].width()));
- REPORTER_ASSERT(reporter, info.fWidthBytes[SkYUVSizeInfo::kV] ==
- (uint32_t) SkAlign8(info.fSizes[SkYUVSizeInfo::kV].width()));
+ REPORTER_ASSERT(reporter, info.fYWidthBytes == (uint32_t) SkAlign8(info.fYSize.width()));
+ REPORTER_ASSERT(reporter, info.fUWidthBytes == (uint32_t) SkAlign8(info.fUSize.width()));
+ REPORTER_ASSERT(reporter, info.fVWidthBytes == (uint32_t) SkAlign8(info.fVSize.width()));
SkYUVColorSpace colorSpace;
success = codec->queryYUV8(&info, &colorSpace);
REPORTER_ASSERT(reporter,
0 == memcmp((const void*) &info, (const void*) expectedSizes, 3 * sizeof(SkISize)));
- REPORTER_ASSERT(reporter, info.fWidthBytes[SkYUVSizeInfo::kY] ==
- (uint32_t) SkAlign8(info.fSizes[SkYUVSizeInfo::kY].width()));
- REPORTER_ASSERT(reporter, info.fWidthBytes[SkYUVSizeInfo::kU] ==
- (uint32_t) SkAlign8(info.fSizes[SkYUVSizeInfo::kU].width()));
- REPORTER_ASSERT(reporter, info.fWidthBytes[SkYUVSizeInfo::kV] ==
- (uint32_t) SkAlign8(info.fSizes[SkYUVSizeInfo::kV].width()));
+ REPORTER_ASSERT(reporter, info.fYWidthBytes == (uint32_t) SkAlign8(info.fYSize.width()));
+ REPORTER_ASSERT(reporter, info.fUWidthBytes == (uint32_t) SkAlign8(info.fUSize.width()));
+ REPORTER_ASSERT(reporter, info.fVWidthBytes == (uint32_t) SkAlign8(info.fVSize.width()));
REPORTER_ASSERT(reporter, kJPEG_SkYUVColorSpace == colorSpace);
// Allocate the memory for the YUV decode
- size_t totalBytes =
- info.fWidthBytes[SkYUVSizeInfo::kY] * info.fSizes[SkYUVSizeInfo::kY].height() +
- info.fWidthBytes[SkYUVSizeInfo::kU] * info.fSizes[SkYUVSizeInfo::kU].height() +
- info.fWidthBytes[SkYUVSizeInfo::kV] * info.fSizes[SkYUVSizeInfo::kV].height();
+ size_t totalBytes = info.fYWidthBytes * info.fYSize.height() +
+ info.fUWidthBytes * info.fUSize.height() +
+ info.fVWidthBytes * info.fVSize.height();
SkAutoMalloc storage(totalBytes);
void* planes[3];
planes[0] = storage.get();
- planes[1] = SkTAddOffset<void>(planes[0],
- info.fWidthBytes[SkYUVSizeInfo::kY] * info.fSizes[SkYUVSizeInfo::kY].height());
- planes[2] = SkTAddOffset<void>(planes[1],
- info.fWidthBytes[SkYUVSizeInfo::kU] * info.fSizes[SkYUVSizeInfo::kU].height());
+ planes[1] = SkTAddOffset<void>(planes[0], info.fYWidthBytes * info.fYSize.height());
+ planes[2] = SkTAddOffset<void>(planes[1], info.fUWidthBytes * info.fUSize.height());
// Test getYUV8Planes()
REPORTER_ASSERT(reporter, SkCodec::kInvalidInput ==
« no previous file with comments | « tests/YUVCacheTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698