change Resize to take pixmap for src
BUG=skia:
Review URL: https://codereview.chromium.org/1174293005
diff --git a/src/core/SkBitmapController.cpp b/src/core/SkBitmapController.cpp
index dd7eb6f..c8164a3 100644
--- a/src/core/SkBitmapController.cpp
+++ b/src/core/SkBitmapController.cpp
@@ -122,11 +122,12 @@
SkScalar roundedDestHeight = SkScalarRoundToScalar(trueDestHeight);
if (!SkBitmapCache::Find(origBitmap, roundedDestWidth, roundedDestHeight, &fResultBitmap)) {
- if (!SkBitmapScaler::Resize(&fResultBitmap,
- origBitmap,
- SkBitmapScaler::RESIZE_BEST,
- roundedDestWidth,
- roundedDestHeight,
+ SkAutoPixmapUnlock src;
+ if (!origBitmap.requestLock(&src)) {
+ return false;
+ }
+ if (!SkBitmapScaler::Resize(&fResultBitmap, src.pixmap(), SkBitmapScaler::RESIZE_BEST,
+ roundedDestWidth, roundedDestHeight,
SkResourceCache::GetAllocator())) {
return false; // we failed to create fScaledBitmap
}