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

Unified Diff: src/animator/SkSnapshot.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/animator/SkSnapshot.cpp
diff --git a/src/animator/SkSnapshot.cpp b/src/animator/SkSnapshot.cpp
index b61d602047a67811d15c0d62a987d750bee13e45..2d186227e3ee0a2660cd0c0bb6ca9e09c7a9594d 100644
--- a/src/animator/SkSnapshot.cpp
+++ b/src/animator/SkSnapshot.cpp
@@ -9,6 +9,7 @@
#include "SkTypes.h"
+#include "SkEncodedFormat.h"
#include "SkSnapshot.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
@@ -30,7 +31,7 @@ DEFINE_GET_MEMBER(SkSnapshot);
SkSnapshot::SkSnapshot()
{
quality = 100 * SK_Scalar1;
- type = (SkImageEncoder::Type) -1;
+ type = (SkEncodedFormat) -1;
sequence = false;
fSeqVal = 0;
}
@@ -40,7 +41,7 @@ SkSnapshot::SkSnapshot()
bool SkSnapshot::draw(SkAnimateMaker& maker) {
SkASSERT(type >= 0);
SkASSERT(filename.size() > 0);
- SkImageEncoder* encoder = SkImageEncoder::Create((SkImageEncoder::Type) type);
+ SkImageEncoder* encoder = SkImageEncoder::Create((SkEncodedFormat) type);
if (!encoder) {
return false;
}
@@ -56,9 +57,9 @@ bool SkSnapshot::draw(SkAnimateMaker& maker) {
if (++fSeqVal > 999)
sequence = false;
}
- if (type == SkImageEncoder::kJPEG_Type)
+ if (type == kJPEG_SkEncodedFormat)
name.append(".jpg");
- else if (type == SkImageEncoder::kPNG_Type)
+ else if (type == kPNG_SkEncodedFormat)
name.append(".png");
SkBitmap pixels;

Powered by Google App Engine
This is Rietveld 408576698