Index: src/core/SkScaledImageCache.cpp |
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp |
index 7c8b66498e342f84e26a9d9236ef98bfc10eff49..2529b5f8ec60cd6a0b44de206a8d45001e405870 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,6 +233,7 @@ SkOneShotDiscardablePixelRef::~SkOneShotDiscardablePixelRef() { |
void* SkOneShotDiscardablePixelRef::onLockPixels(SkColorTable** ctable) { |
if (fFirstTime) { |
// we're already locked |
+ SkASSERT(fDM->data()); |
fFirstTime = false; |
return fDM->data(); |
} |
@@ -255,10 +254,7 @@ void* SkOneShotDiscardablePixelRef::onLockPixels(SkColorTable** ctable) { |
void SkOneShotDiscardablePixelRef::onUnlockPixels() { |
SkASSERT(!fFirstTime); |
- if (fIsLocked) { |
- fIsLocked = false; |
- fDM->unlock(); |
- } |
+ fDM->unlock(); |
} |
size_t SkOneShotDiscardablePixelRef::getAllocatedSizeInBytes() const { |