SkImage method for detecting lazy decoding
BUG=skia:4224
R=reed@google.com
Review URL: https://codereview.chromium.org/1305453007
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 5d1aef7..0d9182a 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -265,6 +265,11 @@
virtual SkDiscardableMemory* diagnostic_only_getDiscardable() const { return NULL; }
+ /**
+ * Returns true if the pixels are generated on-the-fly (when required).
+ */
+ bool isLazyGenerated() const { return this->onIsLazyGenerated(); }
+
protected:
/**
* On success, returns true and fills out the LockRec for the pixels. On
@@ -318,6 +323,8 @@
virtual bool onRequestLock(const LockRequest&, LockResult*);
+ virtual bool onIsLazyGenerated() const { return false; }
+
/** Return the mutex associated with this pixelref. This value is assigned
in the constructor, and cannot change during the lifetime of the object.
*/