Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: src/core/SkBitmapProcState.cpp

Issue 23470005: move decision to smash invmatrix into unit-space (for faster repeat/mirror to after the call to pos… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState.cpp
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index bc9a8fb1d6a47ee0055ba4a3094442bc4ea85e3b..c1874a9f255623df96769277cff56e8ae10511f3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698