add encodeData() to SkImageEncoder, and add encoding to SkImage

BUG=
R=scroggo@google.com

Review URL: https://codereview.chromium.org/15002004

git-svn-id: http://skia.googlecode.com/svn/trunk@9193 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index d8e64a9..0b3ddb4 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -16,6 +16,10 @@
 
     virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) = 0;
     virtual GrTexture* onGetTexture() { return NULL; }
+    
+    // return a read-only copy of the pixels. We promise to not modify them,
+    // but only inspect them (or encode them).
+    virtual bool getROPixels(SkBitmap*) const { return false; }
 
 private:
     typedef SkImage INHERITED;