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

Unified Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 1018953003: Add SkEncodedFormat, used by SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use a common enum for SkImageEncoder and SkImageDecoder and SkCodec Created 5 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
Index: tests/CachedDecodingPixelRefTest.cpp
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index d6edda75cb2c09efc7db2d56d5b1e64a84b62096..2443d1d990102630c3c7329afe72e6b0adeea048 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -10,6 +10,7 @@
#include "SkCanvas.h"
#include "SkData.h"
#include "SkDiscardableMemoryPool.h"
+#include "SkEncodedFormat.h"
#include "SkImageDecoder.h"
#include "SkImageGeneratorPriv.h"
#include "SkResourceCache.h"
@@ -39,7 +40,7 @@ static void make_test_image(SkBitmap* bm) {
* encode this bitmap into some data via SkImageEncoder
*/
static SkData* create_data_from_bitmap(const SkBitmap& bm,
- SkImageEncoder::Type type) {
+ SkEncodedFormat type) {
SkDynamicMemoryWStream stream;
if (SkImageEncoder::EncodeStream(&stream, bm, type, 100)) {
return stream.copyToData();
@@ -100,13 +101,13 @@ static void test_three_encodings(skiatest::Reporter* reporter,
if (original.empty() || original.isNull()) {
return;
}
- static const SkImageEncoder::Type types[] = {
- SkImageEncoder::kPNG_Type,
- SkImageEncoder::kJPEG_Type,
- SkImageEncoder::kWEBP_Type
+ static const SkEncodedFormat types[] = {
+ kJPEG_SkEncodedFormat,
+ kPNG_SkEncodedFormat,
+ kWEBP_SkEncodedFormat,
};
for (size_t i = 0; i < SK_ARRAY_COUNT(types); i++) {
- SkImageEncoder::Type type = types[i];
+ SkEncodedFormat type = types[i];
SkAutoDataUnref encoded(create_data_from_bitmap(original, type));
REPORTER_ASSERT(reporter, encoded.get() != NULL);
if (NULL == encoded.get()) {
@@ -135,7 +136,7 @@ static void test_three_encodings(skiatest::Reporter* reporter,
continue;
}
}
- bool comparePixels = (SkImageEncoder::kPNG_Type == type);
+ bool comparePixels = (kPNG_SkEncodedFormat == type);
compare_bitmaps(reporter, original, lazy, comparePixels);
}
}

Powered by Google App Engine
This is Rietveld 408576698