aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRect.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/SkRect.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/SkRect.h')
-rw-r--r--include/core/SkRect.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 27a648feeb..bcdc4f147b 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -280,7 +280,7 @@ struct SK_API SkIRect {
intersection, otherwise return false and do not change this rectangle.
If either rectangle is empty, do nothing and return false.
*/
- bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& r) {
+ bool intersect(const SkIRect& r) {
return this->intersect(r.fLeft, r.fTop, r.fRight, r.fBottom);
}
@@ -327,7 +327,7 @@ struct SK_API SkIRect {
otherwise return false and do not change this rectangle.
If either rectangle is empty, do nothing and return false.
*/
- bool SK_WARN_UNUSED_RESULT intersect(int32_t left, int32_t top,
+ bool intersect(int32_t left, int32_t top,
int32_t right, int32_t bottom) {
if (left < right && top < bottom && !this->isEmpty() &&
fLeft < right && left < fRight && fTop < bottom && top < fBottom) {
@@ -676,15 +676,14 @@ struct SK_API SkRect {
intersection, otherwise return false and do not change this rectangle.
If either rectangle is empty, do nothing and return false.
*/
- bool SK_WARN_UNUSED_RESULT intersect(const SkRect& r);
+ bool intersect(const SkRect& r);
/** If this rectangle intersects the rectangle specified by left, top, right, bottom,
return true and set this rectangle to that intersection, otherwise return false
and do not change this rectangle.
If either rectangle is empty, do nothing and return false.
*/
- bool SK_WARN_UNUSED_RESULT intersect(SkScalar left, SkScalar top,
- SkScalar right, SkScalar bottom);
+ bool intersect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom);
/**
* If rectangles a and b intersect, return true and set this rectangle to