| Index: src/core/SkBitmapScaler.cpp
|
| diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp
|
| index 35e101efa964238f7f05a13de849d396a636d759..aaee600c8f8650dff77582d9cfdea3168b53c901 100644
|
| --- a/src/core/SkBitmapScaler.cpp
|
| +++ b/src/core/SkBitmapScaler.cpp
|
| @@ -317,3 +317,16 @@ bool SkBitmapScaler::Resize(SkBitmap* resultPtr,
|
| SkASSERT(NULL != resultPtr->getPixels());
|
| return true;
|
| }
|
| +
|
| +// static -- simpler interface to the resizer; returns a default bitmap if scaling
|
| +// fails for any reason. This is the interface that Chrome expects.
|
| +SkBitmap SkBitmapScaler::Resize(const SkBitmap& source,
|
| + ResizeMethod method,
|
| + float destWidth, float destHeight,
|
| + SkBitmap::Allocator* allocator) {
|
| + SkBitmap result;
|
| + if (!Resize(&result, source, method, destWidth, destHeight, allocator)) {
|
| + return SkBitmap();
|
| + }
|
| + return result;
|
| +}
|
|
|