Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: include/core/SkRect.h

Issue 23684008: Fix bounds computation in GrAAHairlineRenderer (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rob's comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/hairlines.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRect.h
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index d0eaac40e4940c6095c015540b08553452493d82..d8919ae5d6b888d3195cc57ce7346bc905cf2a8c 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.
« no previous file with comments | « gm/hairlines.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698