| Index: src/pathops/SkPathOpsTightBounds.cpp
|
| diff --git a/src/pathops/SkPathOpsTightBounds.cpp b/src/pathops/SkPathOpsTightBounds.cpp
|
| index 01c16732c2f1c1dabcf234ccedeac4b08d61712f..f60c291710cb3e9fc4234de9f14c2a3a68d3902d 100644
|
| --- a/src/pathops/SkPathOpsTightBounds.cpp
|
| +++ b/src/pathops/SkPathOpsTightBounds.cpp
|
| @@ -10,24 +10,20 @@
|
| bool TightBounds(const SkPath& path, SkRect* result) {
|
| SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
|
| SkOpContour contour;
|
| - SkOpGlobalState globalState( NULL SkDEBUGPARAMS(&contour));
|
| + SkOpContourHead* contourList = static_cast<SkOpContourHead*>(&contour);
|
| + SkOpGlobalState globalState(NULL, contourList);
|
| // turn path into list of segments
|
| SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
|
| if (!builder.finish(&allocator)) {
|
| return false;
|
| }
|
| - SkTDArray<SkOpContour* > contourList;
|
| - MakeContourList(&contour, contourList, false, false);
|
| - SkOpContour** currentPtr = contourList.begin();
|
| - result->setEmpty();
|
| - if (!currentPtr) {
|
| + if (!SortContourList(&contourList, false, false)) {
|
| + result->setEmpty();
|
| return true;
|
| }
|
| - SkOpContour** listEnd = contourList.end();
|
| - SkOpContour* current = *currentPtr++;
|
| + SkOpContour* current = contourList;
|
| SkPathOpsBounds bounds = current->bounds();
|
| - while (currentPtr != listEnd) {
|
| - current = *currentPtr++;
|
| + while ((current = current->next())) {
|
| bounds.add(current->bounds());
|
| }
|
| *result = bounds;
|
|
|