BUG=skia:
Change-Id: I3a39318bceaf6c95a50d84961d93af4ba62550e3
Reviewed-on: https://skia-review.googlesource.com/6900
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
SkPoint firstPt;
SkPoint prevPt;
- RawIter iter(*this);
+ SkPath::Iter iter(*this, true);
SkPath::Verb verb;
SkPoint pts[4];
SkDEBUGCODE(int moveCnt = 0;)
SkDEBUGCODE(int segmentCount = 0;)
SkDEBUGCODE(int closeCount = 0;)
- while ((verb = iter.next(pts)) != kDone_Verb) {
+ while ((verb = iter.next(pts, true, true)) != kDone_Verb) {
int nextPt = -1;
switch (verb) {
case kMove_Verb:
SkIntToScalar(10),
SkIntToScalar(10))));
+ // Same as above path and first test but with the extra moveTo making a degenerate sub-path
+ // following the non-empty sub-path. Verifies that this does not trigger assertions.
+ path.reset();
+ path.moveTo(0, 0);
+ path.lineTo(SkIntToScalar(100), 0);
+ path.lineTo(0, SkIntToScalar(100));
+ path.moveTo(100, 100);
+
+ REPORTER_ASSERT(reporter, path.conservativelyContainsRect(SkRect::MakeXYWH(SkIntToScalar(50), 0,
+ SkIntToScalar(10),
+ SkIntToScalar(10))));
+
// Test that multiple move commands do not cause asserts and that the function
// is not confused by the multiple moves.
path.reset();