| Index: src/core/SkPath.cpp
|
| ===================================================================
|
| --- src/core/SkPath.cpp (revision 9163)
|
| +++ src/core/SkPath.cpp (working copy)
|
| @@ -600,17 +600,18 @@
|
| return isRectContour(false, &currVerb, &pts, isClosed, direction);
|
| }
|
|
|
| -bool SkPath::isNestedRects(SkRect rects[2]) const {
|
| +bool SkPath::isNestedRects(SkRect rects[2], Direction dirs[2]) const {
|
| SkDEBUGCODE(this->validate();)
|
| int currVerb = 0;
|
| const SkPoint* pts = fPathRef->points();
|
| const SkPoint* first = pts;
|
| - if (!isRectContour(true, &currVerb, &pts, NULL, NULL)) {
|
| + Direction testDirs[2];
|
| + if (!isRectContour(true, &currVerb, &pts, NULL, &testDirs[0])) {
|
| return false;
|
| }
|
| const SkPoint* last = pts;
|
| SkRect testRects[2];
|
| - if (isRectContour(false, &currVerb, &pts, NULL, NULL)) {
|
| + if (isRectContour(false, &currVerb, &pts, NULL, &testDirs[1])) {
|
| testRects[0].set(first, SkToS32(last - first));
|
| testRects[1].set(last, SkToS32(pts - last));
|
| if (testRects[0].contains(testRects[1])) {
|
| @@ -618,6 +619,10 @@
|
| rects[0] = testRects[0];
|
| rects[1] = testRects[1];
|
| }
|
| + if (dirs) {
|
| + dirs[0] = testDirs[0];
|
| + dirs[1] = testDirs[1];
|
| + }
|
| return true;
|
| }
|
| if (testRects[1].contains(testRects[0])) {
|
| @@ -625,6 +630,10 @@
|
| rects[0] = testRects[1];
|
| rects[1] = testRects[0];
|
| }
|
| + if (dirs) {
|
| + dirs[0] = testDirs[1];
|
| + dirs[1] = testDirs[0];
|
| + }
|
| return true;
|
| }
|
| }
|
|
|