Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(634)

Unified Diff: src/pathops/SkPathOpsTightBounds.cpp

Issue 1111333002: compute initial winding from projected rays (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add missing test reference Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkPathOpsSimplify.cpp ('k') | src/pathops/SkPathOpsTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/pathops/SkPathOpsSimplify.cpp ('k') | src/pathops/SkPathOpsTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698