Index: include/core/SkImage.h |
diff --git a/include/core/SkImage.h b/include/core/SkImage.h |
index e6ac68287672d1582ffde1adc1fc74fc8c8176dc..6a93d3b78b7f0515f625c331964da4fe55d5e057 100644 |
--- a/include/core/SkImage.h |
+++ b/include/core/SkImage.h |
@@ -21,8 +21,6 @@ class GrTexture; |
// need for TileMode |
#include "SkShader.h" |
-////// EXPERIMENTAL |
- |
/** |
* SkImage is an abstraction for drawing a rectagle of pixels, though the |
* particular type of image could be actually storing its data on the GPU, or |
@@ -84,6 +82,19 @@ public: |
void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*); |
+ enum EncodeType { |
+ kPNG_EncodeType, |
scroggo
2013/05/16 17:34:41
Any reason we don't support all types in SkImageEn
reed1
2013/05/16 17:55:02
Laziness. At first I tried to include SkImageEncod
|
+ kJPEG_EncodeType, |
+ }; |
+ /** |
+ * 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. |
+ */ |
+ SkData* encode(EncodeType t = kPNG_EncodeType, int quality = 80) const; |
+ |
protected: |
SkImage(int width, int height) : |
fWidth(width), |