Index: src/core/SkBitmapProcState.cpp |
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp |
index 2a449d6d8fa8e7732732bd9046517eb2a2ddb57d..69c5d7a2f3aa4794f3e6f90df3a299b214ddaf72 100644 |
--- a/src/core/SkBitmapProcState.cpp |
+++ b/src/core/SkBitmapProcState.cpp |
@@ -129,8 +129,6 @@ static inline bool cache_size_okay(const SkBitmap& bm, const SkMatrix& invMat) { |
bool SkBitmapProcState::possiblyScaleImage() { |
SkASSERT(NULL == fBitmap); |
- fAdjustedMatrix = false; |
- |
if (fFilterLevel <= SkPaint::kLow_FilterLevel) { |
return false; |
} |
@@ -196,19 +194,10 @@ bool SkBitmapProcState::possiblyScaleImage() { |
SkASSERT(fScaledBitmap.getPixels()); |
fBitmap = &fScaledBitmap; |
- // set the inv matrix type to translate-only; |
- fInvMatrix.setTranslate(fInvMatrix.getTranslateX() / fInvMatrix.getScaleX(), |
- fInvMatrix.getTranslateY() / fInvMatrix.getScaleY()); |
- |
-#ifndef SK_IGNORE_PROPER_FRACTIONAL_SCALING |
- // reintroduce any fractional scaling missed by our integral scale done above. |
- |
- float fractionalScaleX = roundedDestWidth/trueDestWidth; |
- float fractionalScaleY = roundedDestHeight/trueDestHeight; |
+ // clean up the inverse matrix by incorporating the scale we just performed. |
- fInvMatrix.postScale(fractionalScaleX, fractionalScaleY); |
-#endif |
- fAdjustedMatrix = true; |
+ fInvMatrix.postScale(roundedDestWidth / fOrigBitmap.width(), |
+ roundedDestHeight / fOrigBitmap.height()); |
// Set our filter level to low -- the only post-filtering this |
// image might require is some interpolation if the translation |
@@ -372,8 +361,11 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { |
bool clampClamp = SkShader::kClamp_TileMode == fTileModeX && |
SkShader::kClamp_TileMode == fTileModeY; |
- if (!(fAdjustedMatrix || clampClamp || trivialMatrix)) { |
- fInvMatrix.postIDiv(fOrigBitmap.width(), fOrigBitmap.height()); |
+ // TODO(reed): The following conditional and matrix division could really use |
+ // a comment! |
+ |
+ if (!(clampClamp || trivialMatrix)) { |
+ fInvMatrix.postIDiv(fBitmap->width(), fBitmap->height()); |
} |
// Now that all possible changes to the matrix have taken place, check |