Fix asserts in SkPathMeasure to honor documented API
Review URL: https://codereview.appspot.com/6822061 git-svn-id: http://skia.googlecode.com/svn/trunk@6232 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
f3dc199c0b
commit
dfef456f18
@ -418,8 +418,7 @@ const SkPathMeasure::Segment* SkPathMeasure::distanceToSegment(
|
|||||||
|
|
||||||
bool SkPathMeasure::getPosTan(SkScalar distance, SkPoint* pos,
|
bool SkPathMeasure::getPosTan(SkScalar distance, SkPoint* pos,
|
||||||
SkVector* tangent) {
|
SkVector* tangent) {
|
||||||
SkASSERT(fPath);
|
if (NULL == fPath) {
|
||||||
if (fPath == NULL) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,6 +445,10 @@ bool SkPathMeasure::getPosTan(SkScalar distance, SkPoint* pos,
|
|||||||
|
|
||||||
bool SkPathMeasure::getMatrix(SkScalar distance, SkMatrix* matrix,
|
bool SkPathMeasure::getMatrix(SkScalar distance, SkMatrix* matrix,
|
||||||
MatrixFlags flags) {
|
MatrixFlags flags) {
|
||||||
|
if (NULL == fPath) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
SkPoint position;
|
SkPoint position;
|
||||||
SkVector tangent;
|
SkVector tangent;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user