diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-18 21:40:08 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-18 21:40:08 +0000 |
commit | 009bcca7457b3711d48604df7547ffdb937fad50 (patch) | |
tree | 49eb0ac6e070d924f1ac262f6608ff03b6428650 | |
parent | 58be1015a04282c368f5b1be7a34508df9d39bb0 (diff) |
When doing a readback in SkGrPixelRef check whether the dst bmp was allocated.
Review URL: https://codereview.appspot.com/6936068
git-svn-id: http://skia.googlecode.com/svn/trunk@6887 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/gpu/SkGrPixelRef.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp index 255437e3a2..081c09f91c 100644 --- a/src/gpu/SkGrPixelRef.cpp +++ b/src/gpu/SkGrPixelRef.cpp @@ -167,7 +167,10 @@ bool SkGrPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { height = fSurface->height(); } dst->setConfig(SkBitmap::kARGB_8888_Config, width, height); - dst->allocPixels(); + if (!dst->allocPixels()) { + SkDebugf("SkGrPixelRef::onReadPixels failed to alloc bitmap for result!\n"); + return false; + } SkAutoLockPixels al(*dst); void* buffer = dst->getPixels(); return fSurface->readPixels(left, top, width, height, |