Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: include/core/SkImageDecoder.h

Issue 19109002: Add the lazy decoder from PictureFlags to SkImageDecoder (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/images/SkImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | src/images/SkImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698