aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/android
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-11-13 05:56:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-13 05:56:27 -0800
commit7fdda6091ca0579e823cc014a000828dd53571e6 (patch)
treebda42047bab08db2e30ed2a4b6bebae3c3101dfb /tools/android
parente0c64c5846b7c2a2d078bbaf954e15cee56fdbe6 (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.cpp1
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");