diff options
author | Matt Sarett <msarett@google.com> | 2017-03-15 21:17:08 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-20 15:46:52 +0000 |
commit | 480951f618822433874ae45c1ac084419bb79f9d (patch) | |
tree | e190c7b84165ebb12f8d7e1e0283c6ab794cd9ab | |
parent | 1a3c4b8cce9b6b4024bca8814be61c94cebabc19 (diff) |
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>
-rw-r--r-- | src/image/SkImage_Raster.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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> SkImage_Raster::onMakeColorSpace(sk_sp<SkColorSpace> 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()) { |