add assert that the pixelref really did success in requestlock
authorreed <reed@google.com>
Thu, 28 May 2015 21:06:06 +0000 (14:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 28 May 2015 21:06:06 +0000 (14:06 -0700)
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1142343010

src/core/SkBitmap.cpp

index b1198d3..563fc28 100644 (file)
@@ -1361,6 +1361,7 @@ bool SkBitmap::requestLock(SkAutoPixmapUnlock* result) const {
     SkPixelRef::LockRequest req = { fInfo.dimensions(), kNone_SkFilterQuality };
     SkPixelRef::LockResult res;
     if (pr->requestLock(req, &res)) {
+        SkASSERT(res.fPixels);
         // The bitmap may be a subset of the pixelref's dimensions
         SkASSERT(fPixelRefOrigin.x() + fInfo.width()  <= res.fSize.width());
         SkASSERT(fPixelRefOrigin.y() + fInfo.height() <= res.fSize.height());