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

Unified Diff: tests/ImageTest.cpp

Issue 1305453007: SkImage method for detecting lazy decoding (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review comments Created 5 years, 4 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/CachedDecodingPixelRefTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageTest.cpp
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index f5e1abc0a4ad34a61eaf12e1982c4d4a75a80531..1c173da81ab847407827913463cac5369226b504 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -229,10 +229,11 @@ DEF_TEST(image_newfrombitmap, reporter) {
void (*fMakeProc)(SkBitmap*);
bool fExpectPeekSuccess;
bool fExpectSharedID;
+ bool fExpectLazy;
} rec[] = {
- { make_bitmap_lazy, false, true },
- { make_bitmap_mutable, true, false },
- { make_bitmap_immutable, true, true },
+ { make_bitmap_lazy, false, true, true },
+ { make_bitmap_mutable, true, false, false },
+ { make_bitmap_immutable, true, true, false },
};
for (size_t i = 0; i < SK_ARRAY_COUNT(rec); ++i) {
@@ -247,6 +248,9 @@ DEF_TEST(image_newfrombitmap, reporter) {
const bool peekSuccess = image->peekPixels(&pmap);
REPORTER_ASSERT(reporter, peekSuccess == rec[i].fExpectPeekSuccess);
+
+ const bool lazy = image->isLazyGenerated();
+ REPORTER_ASSERT(reporter, lazy == rec[i].fExpectLazy);
}
}
« no previous file with comments | « tests/CachedDecodingPixelRefTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698