aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy/SkDiscardablePixelRef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lazy/SkDiscardablePixelRef.cpp')
-rw-r--r--src/lazy/SkDiscardablePixelRef.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index 73fa4ce84c..19bfc8ccc7 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -71,18 +71,12 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
SkPMColor colors[256];
int colorCount = 0;
- const SkImageGenerator::Result result = fGenerator->getPixels(info, pixels, fRowBytes, NULL,
- colors, &colorCount);
- switch (result) {
- case SkImageGenerator::kSuccess:
- case SkImageGenerator::kIncompleteInput:
- break;
- default:
- fDiscardableMemory->unlock();
- fDiscardableMemoryIsLocked = false;
- SkDELETE(fDiscardableMemory);
- fDiscardableMemory = NULL;
- return false;
+ if (!fGenerator->getPixels(info, pixels, fRowBytes, colors, &colorCount)) {
+ fDiscardableMemory->unlock();
+ fDiscardableMemoryIsLocked = false;
+ SkDELETE(fDiscardableMemory);
+ fDiscardableMemory = NULL;
+ return false;
}
// Note: our ctable is not purgeable, as it is not stored in the discardablememory block.