Add an SkPath conic conversion utility.
Expose SkConic::chopIntoQuadsPOW2() as SkPath::ConvertConicToQuads(). BUG=chromium:315277 R=reed@google.com Review URL: https://codereview.chromium.org/1484373002
This commit is contained in:
parent
0cbe7ee765
commit
aa0df4e98d
@ -539,6 +539,13 @@ public:
|
||||
return (FillType)(fill & 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Chop a conic into N quads, stored continguously in pts[], where
|
||||
* N = 1 << pow2. The amount of storage needed is (1 + 2 * N)
|
||||
*/
|
||||
static int ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2,
|
||||
SkScalar w, SkPoint pts[], int pow2);
|
||||
|
||||
/**
|
||||
* Returns true if the path specifies a rectangle.
|
||||
*
|
||||
|
@ -2837,3 +2837,9 @@ bool SkPath::contains(SkScalar x, SkScalar y) const {
|
||||
}
|
||||
return SkToBool(w);
|
||||
}
|
||||
|
||||
int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2,
|
||||
SkScalar w, SkPoint pts[], int pow2) {
|
||||
const SkConic conic(p0, p1, p2, w);
|
||||
return conic.chopIntoQuadsPOW2(pts, pow2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user