| Index: src/lazy/SkDiscardablePixelRef.cpp
|
| diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
|
| index 4e19c7f65b9c011e6e2ab424a5e05a67218f2986..ba203ef68de048346e1092171df9d6991dadaa16 100644
|
| --- a/src/lazy/SkDiscardablePixelRef.cpp
|
| +++ b/src/lazy/SkDiscardablePixelRef.cpp
|
| @@ -29,22 +29,34 @@ SkDiscardablePixelRef::~SkDiscardablePixelRef() {
|
| SkDELETE(fGenerator);
|
| }
|
|
|
| -void* SkDiscardablePixelRef::onLockPixels(SkColorTable**) {
|
| +bool SkDiscardablePixelRef::onGetInfo(SkImageInfo* info) {
|
| + *info = fInfo;
|
| + return true;
|
| +}
|
| +
|
| +bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
|
| if (fDiscardableMemory != NULL) {
|
| if (fDiscardableMemory->lock()) {
|
| - return fDiscardableMemory->data();
|
| + rec->fPixels = fDiscardableMemory->data();
|
| + rec->fColorTable = NULL;
|
| + rec->fRowBytes = fRowBytes;
|
| + return true;
|
| }
|
| fDiscardableMemory = NULL;
|
| }
|
| fDiscardableMemory = SkDiscardableMemory::Create(fSize);
|
| if (NULL == fDiscardableMemory) {
|
| - return NULL; // Memory allocation failed.
|
| + return false; // Memory allocation failed.
|
| }
|
| void* pixels = fDiscardableMemory->data();
|
| if (!fGenerator->getPixels(fInfo, pixels, fRowBytes)) {
|
| - return NULL; // TODO(halcanary) Find out correct thing to do.
|
| + return false; // TODO(halcanary) Find out correct thing to do.
|
| }
|
| - return pixels;
|
| +
|
| + rec->fPixels = pixels;
|
| + rec->fColorTable = NULL;
|
| + rec->fRowBytes = fRowBytes;
|
| + return true;
|
| }
|
| void SkDiscardablePixelRef::onUnlockPixels() {
|
| if (fDiscardableMemory != NULL) {
|
|
|