////////////////////////////////////////////////////////////////////////////
SkPath::SkPath() : fBoundsIsDirty(true), fFillType(kWinding_FillType) {
- fIsConvex = false;
+ fIsConvex = false; // really should be kUnknown
}
SkPath::SkPath(const SkPath& src) {
fPts.reset();
fVerbs.reset();
fBoundsIsDirty = true;
+ fIsConvex = false; // really should be kUnknown
}
void SkPath::rewind() {
fPts.rewind();
fVerbs.rewind();
fBoundsIsDirty = true;
+ fIsConvex = false; // really should be kUnknown
}
bool SkPath::isEmpty() const {
const SkRect& bounds) {
REPORTER_ASSERT(reporter, p.isConvex());
REPORTER_ASSERT(reporter, p.getBounds() == bounds);
-
+
SkPath p2(p);
REPORTER_ASSERT(reporter, p2.isConvex());
REPORTER_ASSERT(reporter, p2.getBounds() == bounds);
p.setIsConvex(false);
p.addRoundRect(bounds, SK_Scalar1, SK_Scalar1);
check_convex_bounds(reporter, p, bounds);
-
+
p.reset();
p.setIsConvex(false);
p.addOval(bounds);
check_convex_bounds(reporter, p, bounds);
-
+
p.reset();
p.setIsConvex(false);
p.addRect(bounds);
p.moveTo(SK_Scalar1, 0);
p.getLastPt(&pt);
REPORTER_ASSERT(reporter, pt.fX == SK_Scalar1);
+
+ // check that reset and rewind clear the convex hint back to false
+ p.setIsConvex(false);
+ REPORTER_ASSERT(reporter, !p.isConvex());
+ p.setIsConvex(true);
+ REPORTER_ASSERT(reporter, p.isConvex());
+ p.reset();
+ REPORTER_ASSERT(reporter, !p.isConvex());
+ p.setIsConvex(true);
+ REPORTER_ASSERT(reporter, p.isConvex());
+ p.rewind();
+ REPORTER_ASSERT(reporter, !p.isConvex());
}
#include "TestClassDef.h"