Index: src/core/SkBitmapProcState.cpp |
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp |
index eecfbbcc483c67e42e99c3dfd85bd8b9e2855b7b..220eb56316eacf4c6a532aceea89c5943d27b9f8 100644 |
--- a/src/core/SkBitmapProcState.cpp |
+++ b/src/core/SkBitmapProcState.cpp |
@@ -15,6 +15,7 @@ |
#include "SkMipMap.h" |
#include "SkPixelRef.h" |
#include "SkScaledImageCache.h" |
+#include "SkImageEncoder.h" |
#if !SK_ARM_NEON_IS_NONE |
// These are defined in src/opts/SkBitmapProcState_arm_neon.cpp |
@@ -166,8 +167,13 @@ bool SkBitmapProcState::possiblyScaleImage() { |
} |
if (NULL == fScaledCacheID) { |
- int dest_width = SkScalarCeilToInt(fOrigBitmap.width() / invScaleX); |
- int dest_height = SkScalarCeilToInt(fOrigBitmap.height() / invScaleY); |
+ float dest_width = fOrigBitmap.width() / invScaleX; |
+ float dest_height = fOrigBitmap.height() / invScaleY; |
+ |
+#ifdef SK_IGNORE_CORRECT_HIGH_QUALITY_IMAGE_SCALE |
+ dest_width = SkScalarCeilToScalar(dest_width); |
+ dest_height = SkScalarCeilToScalar(dest_height); |
+#endif |
// All the criteria are met; let's make a new bitmap. |
@@ -187,6 +193,7 @@ bool SkBitmapProcState::possiblyScaleImage() { |
return false; |
} |
+ |
SkASSERT(NULL != fScaledBitmap.getPixels()); |
fScaledCacheID = SkScaledImageCache::AddAndLock(fOrigBitmap, |
invScaleX, |