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 <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
This commit is contained in:
Matt Sarett 2017-03-15 21:17:08 -04:00 committed by Skia Commit-Bot
parent 1a3c4b8cce
commit 480951f618

View File

@ -380,7 +380,11 @@ sk_sp<SkImage> SkImage_Raster::onMakeColorSpace(sk_sp<SkColorSpace> target) cons
dst.allocPixels(dstInfo); dst.allocPixels(dstInfo);
SkPixmap src; SkPixmap src;
SkAssertResult(this->onPeekPixels(&src)); if (!fBitmap.peekPixels(&src)) {
SkBitmap tmp(fBitmap);
tmp.lockPixels();
SkAssertResult(tmp.peekPixels(&src));
}
// Treat nullptr srcs as sRGB. // Treat nullptr srcs as sRGB.
if (!src.colorSpace()) { if (!src.colorSpace()) {