diff options
author | msarett <msarett@google.com> | 2015-11-13 05:56:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-13 05:56:27 -0800 |
commit | 7fdda6091ca0579e823cc014a000828dd53571e6 (patch) | |
tree | bda42047bab08db2e30ed2a4b6bebae3c3101dfb /tools/android | |
parent | e0c64c5846b7c2a2d078bbaf954e15cee56fdbe6 (diff) |
Lock pixels again after dummy reset of pixel ref in SkBitmapRegionCodec
This fixes a bug in Android. We cannot access the pixels after
calling decodeRegion() because the call to lock is missing.
BUG=skia:
Review URL: https://codereview.chromium.org/1442553003
Diffstat (limited to 'tools/android')
-rw-r--r-- | tools/android/SkBitmapRegionCodec.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/android/SkBitmapRegionCodec.cpp b/tools/android/SkBitmapRegionCodec.cpp index 7c3c2471b0..415b60c5ab 100644 --- a/tools/android/SkBitmapRegionCodec.cpp +++ b/tools/android/SkBitmapRegionCodec.cpp @@ -129,6 +129,7 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat size_t rowBytes = pr->rowBytes(); bitmap->setInfo(outInfo, rowBytes); bitmap->setPixelRef(pr)->unref(); + bitmap->lockPixels(); SkCodec::Result result = fCodec->getAndroidPixels(decodeInfo, dst, rowBytes, &options); if (SkCodec::kSuccess != result && SkCodec::kIncompleteInput != result) { SkCodecPrintf("Error: Could not get pixels.\n"); |