Index: src/lazy/SkCachingPixelRef.cpp |
diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp |
index 033a6b5ebba17cb866faca4b23c2c48ce1fba77e..fb30d051e165a4a992792703131a9f3912a33a0e 100644 |
--- a/src/lazy/SkCachingPixelRef.cpp |
+++ b/src/lazy/SkCachingPixelRef.cpp |
@@ -7,6 +7,7 @@ |
#include "SkCachingPixelRef.h" |
#include "SkScaledImageCache.h" |
+ |
bool SkCachingPixelRef::Install(SkImageGenerator* generator, |
SkBitmap* dst) { |
@@ -40,12 +41,12 @@ |
// Assert always unlock before unref. |
} |
-bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) { |
+void* SkCachingPixelRef::onLockPixels(SkColorTable**) { |
+ const SkImageInfo& info = this->info(); |
+ |
if (fErrorInDecoding) { |
- return false; // don't try again. |
+ return NULL; // don't try again. |
} |
- |
- const SkImageInfo& info = this->info(); |
SkBitmap bitmap; |
SkASSERT(NULL == fScaledCacheId); |
fScaledCacheId = SkScaledImageCache::FindAndLock(this->getGenerationID(), |
@@ -56,12 +57,12 @@ |
// Cache has been purged, must re-decode. |
if ((!bitmap.setConfig(info, fRowBytes)) || !bitmap.allocPixels()) { |
fErrorInDecoding = true; |
- return false; |
+ return NULL; |
} |
SkAutoLockPixels autoLockPixels(bitmap); |
if (!fImageGenerator->getPixels(info, bitmap.getPixels(), fRowBytes)) { |
fErrorInDecoding = true; |
- return false; |
+ return NULL; |
} |
fScaledCacheId = SkScaledImageCache::AddAndLock(this->getGenerationID(), |
info.fWidth, |
@@ -75,7 +76,6 @@ |
SkAutoLockPixels autoLockPixels(bitmap); |
void* pixels = bitmap.getPixels(); |
SkASSERT(pixels != NULL); |
- |
// At this point, the autoLockPixels will unlockPixels() |
// to remove bitmap's lock on the pixels. We will then |
// destroy bitmap. The *only* guarantee that this pointer |
@@ -84,10 +84,7 @@ |
// bitmap (SkScaledImageCache::Rec.fBitmap) that holds a |
// reference to the concrete PixelRef while this record is |
// locked. |
- rec->fPixels = pixels; |
- rec->fColorTable = NULL; |
- rec->fRowBytes = bitmap.rowBytes(); |
- return true; |
+ return pixels; |
} |
void SkCachingPixelRef::onUnlockPixels() { |