| Index: src/core/SkImageGenerator.cpp
|
| diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp
|
| index 440ae7f5b8f202f1175dc9ad2faef5e9826ccbd5..b6cb630d7c7d5a9ccd036dccc741b3666f63c1d2 100644
|
| --- a/src/core/SkImageGenerator.cpp
|
| +++ b/src/core/SkImageGenerator.cpp
|
| @@ -198,6 +198,28 @@ bool SkImageGenerator::tryGenerateBitmap(SkBitmap* bitmap, const SkImageInfo* in
|
| return true;
|
| }
|
|
|
| +SkImageGenerator::Result SkImageGenerator::canDecodeAndScale(const SkColorType colorType, const SkScalar scale, SkISize* availableSize, SkISize* lowerSize) {
|
| + return this->onCanDecodeAndScale(colorType, scale, availableSize, lowerSize);
|
| +}
|
| +
|
| +SkImageGenerator::Result SkImageGenerator::onCanDecodeAndScale(const SkColorType colorType, const SkScalar scale, SkISize* availableSize, SkISize* lowerSize) {
|
| + unsigned result = SkImageGenerator::kNotAvailable;
|
| + if (colorType == fInfo.colorType())
|
| + result |= SkImageGenerator::kDecode;
|
| + if (scale == SK_Scalar1) {
|
| + result |= SkImageGenerator::kScale;
|
| + if (availableSize) {
|
| + availableSize->fWidth = fInfo.width();
|
| + availableSize->fHeight = fInfo.height();
|
| + }
|
| + if (lowerSize) {
|
| + availableSize->fWidth = availableSize->fHeight = 0;
|
| + }
|
| + }
|
| + return static_cast<SkImageGenerator::Result>(result);
|
| +}
|
| +
|
| +
|
| #include "SkGraphics.h"
|
|
|
| static SkGraphics::ImageGeneratorFromEncodedFactory gFactory;
|
|
|