From 480951f618822433874ae45c1ac084419bb79f9d Mon Sep 17 00:00:00 2001 From: Matt Sarett Date: Wed, 15 Mar 2017 21:17:08 -0400 Subject: [PATCH] Fix discardable memory bot by calling lockPixels() CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE BUG=skia: Change-Id: I684226544f0e1f0234257ba88f6f2e56c32d5706 Reviewed-on: https://skia-review.googlesource.com/9783 Reviewed-by: Mike Klein Commit-Queue: Matt Sarett --- src/image/SkImage_Raster.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp index be825c64a7..960952b45a 100644 --- a/src/image/SkImage_Raster.cpp +++ b/src/image/SkImage_Raster.cpp @@ -380,7 +380,11 @@ sk_sp SkImage_Raster::onMakeColorSpace(sk_sp target) cons dst.allocPixels(dstInfo); SkPixmap src; - SkAssertResult(this->onPeekPixels(&src)); + if (!fBitmap.peekPixels(&src)) { + SkBitmap tmp(fBitmap); + tmp.lockPixels(); + SkAssertResult(tmp.peekPixels(&src)); + } // Treat nullptr srcs as sRGB. if (!src.colorSpace()) {