#include "SkFlattenable.h"
class SkColorTable;
+class SkData;
struct SkIRect;
class SkMutex;
*/
void setURI(const SkString& uri) { fURI = uri; }
+ /**
+ * If the pixelRef has an encoded (i.e. compressed) representation,
+ * return a ref to its data. If the pixelRef
+ * is uncompressed or otherwise does not have this form, return NULL.
+ *
+ * If non-null is returned, the caller is responsible for calling unref()
+ * on the data when it is finished.
+ */
+ SkData* refEncodedData() {
+ return this->onRefEncodedData();
+ }
+
/** Are we really wrapping a texture instead of a bitmap?
*/
virtual SkGpuTexture* getTexture() { return NULL; }
*/
virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subsetOrNull);
+ // default impl returns NULL.
+ virtual SkData* onRefEncodedData();
+
/** Return the mutex associated with this pixelref. This value is assigned
in the constructor, and cannot change during the lifetime of the object.
*/
return false;
}
+SkData* SkPixelRef::onRefEncodedData() {
+ return NULL;
+}
+
///////////////////////////////////////////////////////////////////////////////
#ifdef SK_BUILD_FOR_ANDROID