aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkMatrix.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-03-07 14:55:37 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-07 20:51:34 +0000
commitca49067a3378b5c0364817c4198c063de05a331a (patch)
tree03117f70e401489a17232a739af839d0b48fdf67 /include/core/SkMatrix.h
parentfdf3bbe82110488fa271c5a8ab0f17e5c925c2dd (diff)
optimize intersect, use getType to utilize fast-case in preTranslate
10-15% speed up in clip_record_overhead bench Comparing the raw fType field was missing the (maybe deprecatable) IsRectToRect bit (0x10), which is set for identity and translate matrices, so we were never taking the fast case. BUG=skia: Change-Id: I1c73f4bae42f2311454c7568ef8891239c3cae83 Reviewed-on: https://skia-review.googlesource.com/9388 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'include/core/SkMatrix.h')
-rw-r--r--include/core/SkMatrix.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index bae37a75b2..d408fb12b0 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -816,6 +816,14 @@ private:
return ((fTypeMask & 0xF) == 0);
}
+ inline void updateTranslateMask() {
+ if ((fMat[kMTransX] != 0) | (fMat[kMTransY] != 0)) {
+ fTypeMask |= kTranslate_Mask;
+ } else {
+ fTypeMask &= ~kTranslate_Mask;
+ }
+ }
+
bool SK_WARN_UNUSED_RESULT invertNonIdentity(SkMatrix* inverse) const;
static bool Poly2Proc(const SkPoint[], SkMatrix*, const SkPoint& scale);