| Index: include/core/SkImage.h
|
| diff --git a/include/core/SkImage.h b/include/core/SkImage.h
|
| index 4e016348559b0f32358a710269724dedba545fd4..35515af9bb9f8251abbc7187445fa25e1b15bdf7 100644
|
| --- a/include/core/SkImage.h
|
| +++ b/include/core/SkImage.h
|
| @@ -9,7 +9,6 @@
|
| #define SkImage_DEFINED
|
|
|
| #include "SkImageInfo.h"
|
| -#include "SkImageEncoder.h"
|
| #include "SkRefCnt.h"
|
| #include "SkScalar.h"
|
| #include "SkShader.h"
|
| @@ -17,6 +16,7 @@
|
| class SkData;
|
| class SkCanvas;
|
| class SkImageGenerator;
|
| +class SkImageEncoder;
|
| class SkPaint;
|
| class GrContext;
|
| class GrTexture;
|
| @@ -82,16 +82,6 @@ public:
|
| */
|
| const void* peekPixels(SkImageInfo* info, size_t* rowBytes) const;
|
|
|
| - /**
|
| - * 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(SkImageEncoder::Type t = SkImageEncoder::kPNG_Type,
|
| - int quality = 80) const;
|
| -
|
| protected:
|
| SkImage(int width, int height) :
|
| fWidth(width),
|
| @@ -112,6 +102,7 @@ private:
|
| typedef SkRefCnt INHERITED;
|
|
|
| friend class SkCanvas;
|
| + friend class SkImageEncoder;
|
|
|
| void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const;
|
|
|
| @@ -146,6 +137,11 @@ private:
|
| // - should it have separate entrypoints for preallocated and not bitmaps?
|
| // - isn't it enough to allow the caller to draw() the image into a canvas?
|
| bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const;
|
| +
|
| + /** Returns the image for encoding.
|
| + * Returns true if bm contains the image, false if the operation fails.
|
| + */
|
| + bool getBitmapForEncoding(SkBitmap* bm) const;
|
| };
|
|
|
| #endif
|
|
|