Index: src/core/SkScaledImageCache.cpp |
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp |
index b3956f4a8dbd43d225dccd159eab687e572bd63e..1b8ad524622801add8d92921dbb730c9f428e4c2 100644 |
--- a/src/core/SkScaledImageCache.cpp |
+++ b/src/core/SkScaledImageCache.cpp |
@@ -209,7 +209,6 @@ private: |
SkDiscardableMemory* fDM; |
size_t fRB; |
bool fFirstTime; |
- bool fIsLocked; |
typedef SkPixelRef INHERITED; |
}; |
@@ -225,7 +224,6 @@ SkOneShotDiscardablePixelRef::SkOneShotDiscardablePixelRef(const SkImageInfo& in |
SkASSERT(dm->data()); |
fFirstTime = true; |
- fIsLocked = false; |
} |
SkOneShotDiscardablePixelRef::~SkOneShotDiscardablePixelRef() { |
@@ -235,21 +233,16 @@ SkOneShotDiscardablePixelRef::~SkOneShotDiscardablePixelRef() { |
void* SkOneShotDiscardablePixelRef::onLockPixels(SkColorTable** ctable) { |
if (fFirstTime) { |
// we're already locked |
+ SkASSERT(fDM->data()); |
fFirstTime = false; |
return fDM->data(); |
} |
- |
- SkASSERT(!fIsLocked); |
- fIsLocked = fDM->lock(); |
- return fIsLocked ? fDM->data() : NULL; |
+ return fDM->lock() ? fDM->data() : NULL; |
} |
void SkOneShotDiscardablePixelRef::onUnlockPixels() { |
SkASSERT(!fFirstTime); |
- if (fIsLocked) { |
- fIsLocked = false; |
- fDM->unlock(); |
- } |
+ fDM->unlock(); |
} |
size_t SkOneShotDiscardablePixelRef::getAllocatedSizeInBytes() const { |