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

Unified Diff: tests/ImageIsOpaqueTest.cpp

Issue 2196743002: Add SkColorSpace::Equals() API (Closed) Base URL: https://skia.googlesource.com/skia.git@cscleanup
Patch Set: Created 4 years, 5 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/core/SkColorSpace.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageIsOpaqueTest.cpp
diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp
index 0660885a54529cdc2d7ed99993846794f9cd0761..1f585273b9205947d6b558634b6f0273e127fa18 100644
--- a/tests/ImageIsOpaqueTest.cpp
+++ b/tests/ImageIsOpaqueTest.cpp
@@ -6,6 +6,7 @@
*/
#include "SkTypes.h"
+#include "Resources.h"
#include "Test.h"
#if SK_SUPPORT_GPU
@@ -18,7 +19,7 @@
static void test_flatten(skiatest::Reporter* reporter, const SkImageInfo& info) {
// just need a safe amount of storage, but ensure that it is 4-byte aligned.
- int32_t storage[(sizeof(SkImageInfo)*2) / sizeof(int32_t)];
+ int32_t storage[2000];
msarett 2016/07/29 15:31:27 Is this going to annoy Google3?
mtklein 2016/07/29 15:32:12 Probably. This is a test... just malloc it.
msarett 2016/07/29 15:37:15 SGTM. Done.
SkBinaryWriteBuffer wb(storage, sizeof(storage));
info.flatten(wb);
SkASSERT(wb.bytesWritten() < sizeof(storage));
@@ -35,10 +36,24 @@ static void test_flatten(skiatest::Reporter* reporter, const SkImageInfo& info)
}
DEF_TEST(ImageInfo_flattening, reporter) {
+ sk_sp<SkData> data =
+ SkData::MakeFromFileName(GetResourcePath("icc_profiles/HP_ZR30w.icc").c_str());
+ sk_sp<SkColorSpace> space0 = SkColorSpace::NewICC(data->data(), data->size());
+ data = SkData::MakeFromFileName( GetResourcePath("icc_profiles/HP_Z32x.icc").c_str());
+ sk_sp<SkColorSpace> space1 = SkColorSpace::NewICC(data->data(), data->size());
+ data = SkData::MakeFromFileName(GetResourcePath("icc_profiles/upperLeft.icc").c_str());
+ sk_sp<SkColorSpace> space2 = SkColorSpace::NewICC(data->data(), data->size());
+ data = SkData::MakeFromFileName(GetResourcePath("icc_profiles/upperRight.icc").c_str());
+ sk_sp<SkColorSpace> space3 = SkColorSpace::NewICC(data->data(), data->size());
+
sk_sp<SkColorSpace> spaces[] = {
nullptr,
SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named),
SkColorSpace::NewNamed(SkColorSpace::kAdobeRGB_Named),
+ space0,
+ space1,
+ space2,
+ space3,
};
for (int ct = 0; ct <= kLastEnum_SkColorType; ++ct) {
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698