Index: include/core/SkPoint.h |
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h |
index 6f32d98c751c3827a10e98b86810b130c2351edf..18b371f2ca3910274fc0520de772c87ef90075d2 100644 |
--- a/include/core/SkPoint.h |
+++ b/include/core/SkPoint.h |
@@ -212,7 +212,16 @@ struct SK_API SkPoint { |
v[2].set(r, b); |
v[3].set(r, t); |
} |
- void setRectFan(SkScalar l, SkScalar t, SkScalar r, SkScalar b, size_t stride); |
+ |
+ void setRectFan(SkScalar l, SkScalar t, SkScalar r, SkScalar b, size_t stride) { |
+ SkASSERT(stride >= sizeof(SkPoint)); |
+ |
+ ((SkPoint*)((intptr_t)this + 0 * stride))->set(l, t); |
+ ((SkPoint*)((intptr_t)this + 1 * stride))->set(l, b); |
+ ((SkPoint*)((intptr_t)this + 2 * stride))->set(r, b); |
+ ((SkPoint*)((intptr_t)this + 3 * stride))->set(r, t); |
+ } |
+ |
static void Offset(SkPoint points[], int count, const SkPoint& offset) { |
Offset(points, count, offset.fX, offset.fY); |