Index: src/image/SkImage.cpp |
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp |
index fdaadc569c0d0481eb416c5b8b3956b308e10881..be837f28a8fa8782e16afdc5ed0763c8668c6440 100644 |
--- a/src/image/SkImage.cpp |
+++ b/src/image/SkImage.cpp |
@@ -57,6 +57,10 @@ bool SkImage::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dst |
} |
bool SkImage::scalePixels(const SkPixmap& dst, SkFilterQuality quality, CachingHint chint) const { |
+ if (this->width() == dst.width() && this->height() == dst.height()) { |
+ return this->readPixels(dst, 0, 0, chint); |
+ } |
+ |
// Idea: If/when SkImageGenerator supports a native-scaling API (where the generator itself |
// can scale more efficiently) we should take advantage of it here. |
// |