diff options
author | Mike Reed <reed@google.com> | 2017-03-07 14:55:37 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-07 20:51:34 +0000 |
commit | ca49067a3378b5c0364817c4198c063de05a331a (patch) | |
tree | 03117f70e401489a17232a739af839d0b48fdf67 /src/core/SkRasterClip.cpp | |
parent | fdf3bbe82110488fa271c5a8ab0f17e5c925c2dd (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 'src/core/SkRasterClip.cpp')
-rw-r--r-- | src/core/SkRasterClip.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/SkRasterClip.cpp b/src/core/SkRasterClip.cpp index f43d14e483..6f9eb6baa6 100644 --- a/src/core/SkRasterClip.cpp +++ b/src/core/SkRasterClip.cpp @@ -115,6 +115,15 @@ void SkConservativeClip::op(const SkRegion& rgn, SkRegion::Op op) { } void SkConservativeClip::op(const SkIRect& devRect, SkRegion::Op op) { + if (SkRegion::kIntersect_Op == op) { + if (devRect.isEmpty()) { + fBounds.setEmpty(); + } else { + (void)fBounds.intersect(devRect); + } + return; + } + // This may still create a complex region (which we would then take the bounds // Perhaps we should inline the op-logic directly to never create the rgn... SkRegion result; |