Fix android errors when unflattening an SkImageRef_ashmem object.
Review URL: https://codereview.appspot.com/7228071
git-svn-id: http://skia.googlecode.com/svn/trunk@7514 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 618cc71..89ce69a 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -216,13 +216,6 @@
// Performance tweak to avoid those calls (esp. in multi-thread use case).
void setPreLocked(void* pixels, SkColorTable* ctable);
- /**
- * If a subclass passed a particular mutex to the base constructor, it can
- * override that to go back to the default mutex by calling this. However,
- * this should only be called from within the subclass' constructor.
- */
- void useDefaultMutex() { this->setMutex(NULL); }
-
private:
SkBaseMutex* fMutex; // must remain in scope for the life of this object
diff --git a/include/images/SkImageRef.h b/include/images/SkImageRef.h
index dcc4c0e..bca4305 100644
--- a/include/images/SkImageRef.h
+++ b/include/images/SkImageRef.h
@@ -34,7 +34,7 @@
@param config The preferred config of the decoded bitmap.
@param sampleSize Requested sampleSize for decoding. Defaults to 1.
*/
- SkImageRef(SkStream*, SkBitmap::Config config, int sampleSize = 1);
+ SkImageRef(SkStream*, SkBitmap::Config config, int sampleSize = 1, SkBaseMutex* mutex = NULL);
virtual ~SkImageRef();
/** this value is passed onto the decoder. Default is true
@@ -73,9 +73,9 @@
virtual void* onLockPixels(SkColorTable**);
// override this in your subclass to clean up when we're unlocking pixels
- virtual void onUnlockPixels();
+ virtual void onUnlockPixels() {}
- SkImageRef(SkFlattenableReadBuffer&);
+ SkImageRef(SkFlattenableReadBuffer&, SkBaseMutex* mutex = NULL);
virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
SkBitmap fBitmap;