Chromium Code Reviews| Index: include/core/SkRect.h |
| diff --git a/include/core/SkRect.h b/include/core/SkRect.h |
| index d0eaac40e4940c6095c015540b08553452493d82..d43ffce204e2b2326fc6ec70f99279ecffe4f807 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) { |
|
robertphillips
2013/09/01 11:15:37
Shouldn't this be (pts, sizeof(SkPoint), count)?
bsalomon
2013/09/03 14:47:35
Yes nice catch. I originally had it as ptr, stride
|
| + this->growToInclude(pts, count, sizeof(SkPoint)); |
| + } |
| + |
| + /** 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. |