diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-09 13:42:39 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-09 13:42:39 +0000 |
commit | ef0e3190d3dd4c4e0652c550ac3dbd73762b5322 (patch) | |
tree | 976f6e5c354d5c338ea0032c00b70d8ea9b06902 /src | |
parent | a4de8c257ea0be8ff7081f645249b6afe5c48e7e (diff) |
move decision to smash invmatrix into unit-space (for faster repeat/mirror to after the call to possiblyScaleImage(), so we don't confuse that code with a munged matrix. Fixes the scaled_tilemodes gm for HQ
BUG=
R=humper@google.com
Review URL: https://codereview.chromium.org/23470005
git-svn-id: http://skia.googlecode.com/svn/trunk@11152 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmapProcState.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp index bc9a8fb1d6..c1874a9f25 100644 --- a/src/core/SkBitmapProcState.cpp +++ b/src/core/SkBitmapProcState.cpp @@ -281,16 +281,8 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { return false; } - bool trivialMatrix = (inv.getType() & ~SkMatrix::kTranslate_Mask) == 0; - bool clampClamp = SkShader::kClamp_TileMode == fTileModeX && - SkShader::kClamp_TileMode == fTileModeY; - - fInvMatrix = inv; - if (!(clampClamp || trivialMatrix)) { - fInvMatrix.postIDiv(fOrigBitmap.width(), fOrigBitmap.height()); - } - fBitmap = &fOrigBitmap; + fInvMatrix = inv; // initialize our filter quality to the one requested by the caller. // We may downgrade it later if we determine that we either don't need @@ -308,6 +300,14 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { this->possiblyScaleImage(); #endif + bool trivialMatrix = (fInvMatrix.getType() & ~SkMatrix::kTranslate_Mask) == 0; + bool clampClamp = SkShader::kClamp_TileMode == fTileModeX && + SkShader::kClamp_TileMode == fTileModeY; + + if (!(clampClamp || trivialMatrix)) { + fInvMatrix.postIDiv(fOrigBitmap.width(), fOrigBitmap.height()); + } + // Now that all possible changes to the matrix have taken place, check // to see if we're really close to a no-scale matrix. If so, explicitly // set it to be so. Subsequent code may inspect this matrix to choose |