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

Unified Diff: src/images/SkImageDecoder_libpng.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: src/images/SkImageDecoder_libpng.cpp
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp
index 245654dbfd3dbcb3c735b1f8ccdb44fe26433a8a..76ecbecea2ddac27b64bd52ec5bfe488322bc283 100644
--- a/src/images/SkImageDecoder_libpng.cpp
+++ b/src/images/SkImageDecoder_libpng.cpp
@@ -78,8 +78,8 @@ public:
SkPNGImageDecoder() {
fImageIndex = NULL;
}
- Format getFormat() const SK_OVERRIDE {
- return kPNG_Format;
+ SkEncodedFormat getFormat() const SK_OVERRIDE {
+ return kPNG_SkEncodedFormat;
}
virtual ~SkPNGImageDecoder() {
@@ -1273,15 +1273,15 @@ SkImageDecoder* sk_libpng_dfactory(SkStreamRewindable* stream) {
return NULL;
}
-static SkImageDecoder::Format get_format_png(SkStreamRewindable* stream) {
+static SkEncodedFormat get_format_png(SkStreamRewindable* stream) {
if (is_png(stream)) {
- return SkImageDecoder::kPNG_Format;
+ return kPNG_SkEncodedFormat;
}
- return SkImageDecoder::kUnknown_Format;
+ return kUnknown_SkEncodedFormat;
}
-SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) {
- return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL;
+SkImageEncoder* sk_libpng_efactory(SkEncodedFormat t) {
+ return (kPNG_SkEncodedFormat == t) ? SkNEW(SkPNGImageEncoder) : NULL;
}
static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory);

Powered by Google App Engine
This is Rietveld 408576698