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

Unified Diff: include/core/SkImageEncoder.h

Issue 656503003: Move SkImage::encode to SkImageEncoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « include/core/SkImage.h ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageEncoder.h
diff --git a/include/core/SkImageEncoder.h b/include/core/SkImageEncoder.h
index 4d4d2a83c0f18a0bd31a8d42bd64d947703a8126..0a850fcdcb47b545c5dbd28f66aaf6b06663c9c5 100644
--- a/include/core/SkImageEncoder.h
+++ b/include/core/SkImageEncoder.h
@@ -13,6 +13,7 @@
class SkBitmap;
class SkData;
+class SkImage;
class SkWStream;
class SkImageEncoder {
@@ -60,6 +61,16 @@ public:
bool encodeStream(SkWStream* stream, const SkBitmap& bm, int quality);
static SkData* EncodeData(const SkBitmap&, Type, int quality);
+
+ /**
+ * Encode the image's pixels and return the result as a new SkData, which
+ * the caller must manage (i.e. call unref() when they are done).
+ *
+ * If the image type cannot be encoded, or the requested encoder type is
+ * not supported, this will return NULL.
+ */
+ static SkData* EncodeData(const SkImage&, Type, int quality);
+
static bool EncodeFile(const char file[], const SkBitmap&, Type,
int quality);
static bool EncodeStream(SkWStream*, const SkBitmap&, Type,
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698