Index: src/gpu/SkGrPixelRef.cpp |
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp |
index dc5d7558f0d7a3e5c0294ec59f08f1622ef0ea16..acbe5229c1ff2d4547dc0f2cf8cec32448fc7fc9 100644 |
--- a/src/gpu/SkGrPixelRef.cpp |
+++ b/src/gpu/SkGrPixelRef.cpp |
@@ -24,10 +24,11 @@ SkROLockPixelsPixelRef::SkROLockPixelsPixelRef() : INHERITED(&gROLockPixelsPixel |
SkROLockPixelsPixelRef::~SkROLockPixelsPixelRef() { |
} |
-void* SkROLockPixelsPixelRef::onLockPixels(SkColorTable** ctable) { |
- if (ctable) { |
- *ctable = NULL; |
- } |
+bool SkROLockPixelsPixelRef::onGetInfo(SkImageInfo* info) { |
+ return fBitmap.asImageInfo(info); |
+} |
+ |
+bool SkROLockPixelsPixelRef::onNewLockPixels(LockRec* rec) { |
fBitmap.reset(); |
// SkDebugf("---------- calling readpixels in support of lockpixels\n"); |
if (!this->onReadPixels(&fBitmap, NULL)) { |
@@ -35,7 +36,14 @@ void* SkROLockPixelsPixelRef::onLockPixels(SkColorTable** ctable) { |
return NULL; |
} |
fBitmap.lockPixels(); |
- return fBitmap.getPixels(); |
+ if (NULL == fBitmap.getPixels()) { |
+ return false; |
+ } |
+ |
+ rec->fPixels = fBitmap.getPixels(); |
+ rec->fColorTable = NULL; |
+ rec->fRowBytes = fBitmap.rowBytes(); |
+ return true; |
} |
void SkROLockPixelsPixelRef::onUnlockPixels() { |