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

Unified Diff: src/lazy/SkLazyPixelRef.h

Issue 37343002: Allow SkLazyPixelRef to use SkScaledImageCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: re-upload Created 7 years, 2 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 | « src/core/SkScaledImageCache.cpp ('k') | src/lazy/SkLazyPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkLazyPixelRef.h
diff --git a/src/lazy/SkLazyPixelRef.h b/src/lazy/SkLazyPixelRef.h
index 8f7a751e953693efd0b81cc9e0bafd24dba6154c..c7fbd7be65b8928f595bbbcc3984ebccf8a4db31 100644
--- a/src/lazy/SkLazyPixelRef.h
+++ b/src/lazy/SkLazyPixelRef.h
@@ -10,8 +10,10 @@
#include "SkBitmapFactory.h"
#include "SkImage.h"
+#include "SkImageCache.h"
#include "SkPixelRef.h"
#include "SkFlattenable.h"
+#include "SkScaledImageCache.h"
class SkColorTable;
class SkData;
@@ -33,8 +35,9 @@ public:
* Create a new SkLazyPixelRef.
* @param SkData Encoded data representing the pixels.
* @param DecodeProc Called to decode the pixels when needed. Must be non-NULL.
- * @param SkImageCache Object that handles allocating and freeing the pixel memory, as needed.
- * Must not be NULL.
+ * @param SkImageCache Object that handles allocating and freeing
+ * the pixel memory, as needed. If NULL, use the global
+ * SkScaledImageCache.
*/
SkLazyPixelRef(SkData*, SkBitmapFactory::DecodeProc, SkImageCache*);
@@ -69,7 +72,10 @@ private:
SkData* fData;
SkBitmapFactory::DecodeProc fDecodeProc;
SkImageCache* fImageCache;
- intptr_t fCacheId;
+ union {
+ SkImageCache::ID fCacheId;
+ SkScaledImageCache::ID* fScaledCacheId;
+ };
size_t fRowBytes;
SkImage::Info fLazilyCachedInfo;
@@ -80,6 +86,9 @@ private:
// lazily initialized our cached info. Returns NULL on failure.
const SkImage::Info* getCachedInfo();
+ void* lockScaledImageCachePixels();
+ void* lockImageCachePixels();
+
typedef SkPixelRef INHERITED;
};
« no previous file with comments | « src/core/SkScaledImageCache.cpp ('k') | src/lazy/SkLazyPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698