Index: src/core/SkBitmapProcState.cpp |
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp |
index 8874e7b4452308e62bcb12e964f3e9d9660ce92f..ed02afe8933febbb0d4bcc5be44782c0dcd0a591 100644 |
--- a/src/core/SkBitmapProcState.cpp |
+++ b/src/core/SkBitmapProcState.cpp |
@@ -263,6 +263,7 @@ bool SkBitmapProcState::possiblyScaleImage() { |
if (mip) { |
fScaledCacheID = SkScaledImageCache::AddAndLockMip(fOrigBitmap, |
mip); |
+ SkASSERT(mip->getRefCnt() > 1); |
mip->unref(); // the cache took a ref |
SkASSERT(fScaledCacheID); |
} |
@@ -383,6 +384,7 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { |
fBitmap = NULL; |
fInvMatrix = inv; |
fFilterLevel = paint.getFilterLevel(); |
+// fFilterLevel = SkPaint::kMedium_FilterLevel; |
SkASSERT(NULL == fScaledCacheID); |
@@ -403,6 +405,12 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { |
return false; |
} |
+ // If we are "still" kMedium_FilterLeve, then then request was not fulfilled by possiblyScale, |
+ // so we downgrade to kLow (so the rest of the sniffing code can assume that |
+ if (SkPaint::kMedium_FilterLevel == fFilterLevel) { |
+ fFilterLevel = SkPaint::kLow_FilterLevel; |
+ } |
+ |
bool trivialMatrix = (fInvMatrix.getType() & ~SkMatrix::kTranslate_Mask) == 0; |
bool clampClamp = SkShader::kClamp_TileMode == fTileModeX && |
SkShader::kClamp_TileMode == fTileModeY; |