diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPoint.h | 17 | ||||
-rw-r--r-- | include/core/SkRSXform.h | 1 |
2 files changed, 10 insertions, 8 deletions
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h index 4aceff7a49..70437340b6 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -205,14 +205,6 @@ struct SK_API SkPoint { void setIRectFan(int l, int t, int r, int b, size_t stride); // counter-clockwise fan - void setRectFan(SkScalar l, SkScalar t, SkScalar r, SkScalar b) { - SkPoint* v = this; - v[0].set(l, t); - v[1].set(l, b); - v[2].set(r, b); - v[3].set(r, t); - } - void setRectFan(SkScalar l, SkScalar t, SkScalar r, SkScalar b, size_t stride) { SkASSERT(stride >= sizeof(SkPoint)); @@ -222,6 +214,15 @@ struct SK_API SkPoint { ((SkPoint*)((intptr_t)this + 3 * stride))->set(r, t); } + // tri strip with two counter-clockwise triangles + void setRectTriStrip(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, t); + ((SkPoint*)((intptr_t)this + 3 * stride))->set(r, b); + } static void Offset(SkPoint points[], int count, const SkPoint& offset) { Offset(points, count, offset.fX, offset.fY); diff --git a/include/core/SkRSXform.h b/include/core/SkRSXform.h index 706617e313..b11dea7723 100644 --- a/include/core/SkRSXform.h +++ b/include/core/SkRSXform.h @@ -62,6 +62,7 @@ struct SkRSXform { void toQuad(const SkSize& size, SkPoint quad[4]) const { this->toQuad(size.width(), size.height(), quad); } + void toTriStrip(SkScalar width, SkScalar height, SkPoint strip[4]) const; }; #endif |