aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRect.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-03 14:56:17 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-03 14:56:17 +0000
commitb8bd6cbbcde9846094ade18cafadfad46dc00889 (patch)
tree43c334ad5bc8b19c27341e8cfa108b9ffd01f17a /include/core/SkRect.h
parent91f4d704ce16e147125b790a060575a1b74bcfa3 (diff)
Fix bounds computation in GrAAHairlineRenderer
R=robertphillips@google.com, jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/23684008 git-svn-id: http://skia.googlecode.com/svn/trunk@11054 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r--include/core/SkRect.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index d0eaac40e4..d8919ae5d6 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -691,6 +691,21 @@ struct SK_API SkRect {
fBottom = SkMaxScalar(y, fBottom);
}
+ /** Bulk version of growToInclude */
+ void growToInclude(const SkPoint pts[], int count) {
+ this->growToInclude(pts, sizeof(SkPoint), count);
+ }
+
+ /** Bulk version of growToInclude with stride. */
+ void growToInclude(const SkPoint pts[], size_t stride, int count) {
+ SkASSERT(count >= 0);
+ SkASSERT(stride >= sizeof(SkPoint));
+ const SkPoint* end = (const SkPoint*)((intptr_t)pts + count * stride);
+ for (; pts < end; pts = (const SkPoint*)((intptr_t)pts + stride)) {
+ this->growToInclude(pts->fX, pts->fY);
+ }
+ }
+
/**
* Returns true if (p.fX,p.fY) is inside the rectangle, and the rectangle
* is not empty.