Index: src/lazy/SkDiscardablePixelRef.cpp |
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp |
index 3f960d3c47a0d483708948aa652a98782f04afeb..2886156102937faeb734f2891b74daaff47dba61 100644 |
--- a/src/lazy/SkDiscardablePixelRef.cpp |
+++ b/src/lazy/SkDiscardablePixelRef.cpp |
@@ -36,18 +36,15 @@ |
SkDELETE(fGenerator); |
} |
-bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) { |
+void* SkDiscardablePixelRef::onLockPixels(SkColorTable**) { |
if (fDiscardableMemory != NULL) { |
if (fDiscardableMemory->lock()) { |
- rec->fPixels = fDiscardableMemory->data(); |
- rec->fColorTable = NULL; |
- rec->fRowBytes = fRowBytes; |
- return true; |
+ return fDiscardableMemory->data(); |
} |
SkDELETE(fDiscardableMemory); |
fDiscardableMemory = NULL; |
} |
- |
+ |
const size_t size = this->info().getSafeSize(fRowBytes); |
if (fDMFactory != NULL) { |
@@ -56,23 +53,17 @@ |
fDiscardableMemory = SkDiscardableMemory::Create(size); |
} |
if (NULL == fDiscardableMemory) { |
- return false; // Memory allocation failed. |
+ return NULL; // Memory allocation failed. |
} |
- |
void* pixels = fDiscardableMemory->data(); |
if (!fGenerator->getPixels(this->info(), pixels, fRowBytes)) { |
fDiscardableMemory->unlock(); |
SkDELETE(fDiscardableMemory); |
fDiscardableMemory = NULL; |
- return false; |
+ return NULL; |
} |
- |
- rec->fPixels = pixels; |
- rec->fColorTable = NULL; |
- rec->fRowBytes = fRowBytes; |
- return true; |
+ return pixels; |
} |
- |
void SkDiscardablePixelRef::onUnlockPixels() { |
fDiscardableMemory->unlock(); |
} |