Index: include/images/SkBitmapRegionDecoder.h |
diff --git a/include/images/SkBitmapRegionDecoder.h b/include/images/SkBitmapRegionDecoder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5c8df3e57f2b484abe540a3dc7492302506df7f8 |
--- /dev/null |
+++ b/include/images/SkBitmapRegionDecoder.h |
@@ -0,0 +1,46 @@ |
+/* |
robertphillips
2013/03/11 18:25:55
Is this the right header?
djsollen
2013/03/11 19:43:24
Yes, as it is was originally release as part of AO
|
+ * Copyright 2011 The Android Open Source Project |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+ |
+#ifndef SkBitmapRegionDecoder_DEFINED |
+#define SkBitmapRegionDecoder_DEFINED |
+ |
+#include "SkBitmap.h" |
robertphillips
2013/03/11 18:25:55
I think we only need "class SkIRect;" here.
djsollen
2013/03/11 19:43:24
Done.
|
+#include "SkRect.h" |
+#include "SkImageDecoder.h" |
+#include "SkStream.h" |
+ |
robertphillips
2013/03/11 18:25:55
comment?
|
+class SkBitmapRegionDecoder { |
+public: |
+ SkBitmapRegionDecoder(SkImageDecoder *decoder, SkStream *stream, |
robertphillips
2013/03/11 18:25:55
line up next line?
|
+ int width, int height) { |
+ fDecoder = decoder; |
+ fStream = stream; |
+ fWidth = width; |
+ fHeight = height; |
+ } |
+ virtual ~SkBitmapRegionDecoder() { |
+ delete fDecoder; |
+ fStream->unref(); |
+ } |
+ |
+ virtual bool decodeRegion(SkBitmap* bitmap, SkIRect rect, |
djsollen
2013/03/11 17:47:24
const SkIRect&
|
+ SkBitmap::Config pref, int sampleSize); |
+ |
robertphillips
2013/03/11 18:25:55
consts?
djsollen
2013/03/11 19:43:24
Done.
|
+ virtual int getWidth() { return fWidth; } |
+ virtual int getHeight() { return fHeight; } |
+ |
+ virtual SkImageDecoder* getDecoder() { return fDecoder; } |
+ |
+private: |
+ SkImageDecoder *fDecoder; |
+ SkStream *fStream; |
+ int fWidth; |
+ int fHeight; |
+}; |
+ |
+#endif |