Index: include/core/SkImageDecoder.h |
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h |
index 191fe53f4c588a0584486fee25b68ee7a2c7ab1f..f06af9588dce3e7dd76ce465a1fd06920cc48197 100644 |
--- a/include/core/SkImageDecoder.h |
+++ b/include/core/SkImageDecoder.h |
@@ -13,8 +13,10 @@ |
#include "SkBitmap.h" |
#include "SkBitmapFactory.h" |
#include "SkImage.h" |
+#include "SkLruImageCache.h" |
#include "SkRect.h" |
#include "SkRefCnt.h" |
+#include "SkPurgeableImageCache.h" |
caryclark
2013/07/12 18:29:39
this may be correct but why is it required? I don'
sglez
2013/07/13 04:11:27
Good catch. I was using it when trying to implemen
|
#include "SkTypes.h" |
class SkStream; |
@@ -97,6 +99,13 @@ public: |
*/ |
bool getRequireUnpremultipliedColors() const { return fRequireUnpremultipliedColors; } |
+ /** |
+ * Returns a pointer to the LRU cache used by LazyDecodeBitmap. |
+ */ |
+ static SkLruImageCache* getLruImageCache() { |
+ return &fLruImageCache; |
+ } |
+ |
/** \class Peeker |
Base class for optional callbacks to retrieve meta/chunk data out of |
@@ -308,6 +317,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); |
+ |
+ /** |
* 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 +482,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 |