Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: src/core/SkBitmapController.cpp

Issue 1174293005: change Resize to take pixmap for src (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkBitmapScaler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapController.cpp
diff --git a/src/core/SkBitmapController.cpp b/src/core/SkBitmapController.cpp
index dd7eb6f36f05627a85318a1d8ecbf0a77bb762ac..c8164a35c79109e398fe45b81726c181b02b246b 100644
--- a/src/core/SkBitmapController.cpp
+++ b/src/core/SkBitmapController.cpp
@@ -122,11 +122,12 @@ bool SkDefaultBitmapControllerState::processHQRequest(const SkBitmap& origBitmap
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
}
« no previous file with comments | « no previous file | src/core/SkBitmapScaler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698