Index: include/core/SkImageDecoder.h |
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h |
index 191fe53f4c588a0584486fee25b68ee7a2c7ab1f..8cb4881b40e7a139c7e029fff9249fc56e24e7cd 100644 |
--- a/include/core/SkImageDecoder.h |
+++ b/include/core/SkImageDecoder.h |
@@ -13,6 +13,7 @@ |
#include "SkBitmap.h" |
#include "SkBitmapFactory.h" |
#include "SkImage.h" |
+#include "SkLruImageCache.h" |
#include "SkRect.h" |
#include "SkRefCnt.h" |
#include "SkTypes.h" |
@@ -97,6 +98,13 @@ public: |
*/ |
bool getRequireUnpremultipliedColors() const { return fRequireUnpremultipliedColors; } |
+ /** |
+ * Returns a pointer to the LRU cache used by LazyDecodeBitmap. |
+ */ |
+ static SkLruImageCache* getLruImageCache() { |
scroggo
2013/07/15 15:09:28
This does not generally relate to SkImageDecoder,
|
+ return &fLruImageCache; |
scroggo
2013/07/15 15:09:28
SkImageDecoder.h is built by chromium, but SkImage
|
+ } |
+ |
/** \class Peeker |
Base class for optional callbacks to retrieve meta/chunk data out of |
@@ -308,6 +316,11 @@ public: |
} |
/** |
+ * Decode the image with DecodeMemoryToTarget but defer the process until it is needed. |
+ */ |
+ static bool LazyDecodeBitmap(const void* buffer, size_t size, SkBitmap* bitmap); |
scroggo
2013/07/15 15:09:28
I support moving LazyDecodeBitmap to a header file
|
+ |
+ /** |
* Decode memory. |
* @param info Output parameter. Returns info about the encoded image. |
* @param target Contains the address of pixel memory to decode into |
@@ -468,6 +481,10 @@ private: |
mutable bool fShouldCancelDecode; |
bool fPreferQualityOverSpeed; |
bool fRequireUnpremultipliedColors; |
+ |
+ static SkLruImageCache fLruImageCache; |
+ static SkBitmapFactory fLazyBitmapFactory; |
+ |
}; |
/** Calling newDecoder with a stream returns a new matching imagedecoder |