diff options
author | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-17 14:10:36 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-17 14:10:36 +0000 |
commit | d892bd8ba676d34d4ce4a73ac7aad88e102fad70 (patch) | |
tree | f8b35e6d7582800ef622fc796ef4077163763a05 /src/pathops/SkPathOpsSimplify.cpp | |
parent | acb3d88cf84adf367c173a7a33cd3b0c379291dc (diff) |
convert pathops to use SkSTArray where possible.
Replace SkTDArray with SkTArray and use SkSTArray when
the probable array size is known.
In a couple of places (spans, chases) the arrays are
constructed using insert() so SkTArrays can't be used for
now.
Also, add an optimization to cubic subdivide if either end
is zero or one.
BUG=
Review URL: https://codereview.chromium.org/16951017
git-svn-id: http://skia.googlecode.com/svn/trunk@9635 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkPathOpsSimplify.cpp')
-rw-r--r-- | src/pathops/SkPathOpsSimplify.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp index 9a319e08ba..f89c4afcc7 100644 --- a/src/pathops/SkPathOpsSimplify.cpp +++ b/src/pathops/SkPathOpsSimplify.cpp @@ -9,7 +9,7 @@ #include "SkPathOpsCommon.h" #include "SkPathWriter.h" -static bool bridgeWinding(SkTDArray<SkOpContour*>& contourList, SkPathWriter* simple) { +static bool bridgeWinding(SkTArray<SkOpContour*, true>& contourList, SkPathWriter* simple) { bool firstContour = true; bool unsortable = false; bool topUnsortable = false; @@ -94,7 +94,7 @@ static bool bridgeWinding(SkTDArray<SkOpContour*>& contourList, SkPathWriter* si } // returns true if all edges were processed -static bool bridgeXor(SkTDArray<SkOpContour*>& contourList, SkPathWriter* simple) { +static bool bridgeXor(SkTArray<SkOpContour*, true>& contourList, SkPathWriter* simple) { SkOpSegment* current; int start, end; bool unsortable = false; @@ -161,7 +161,7 @@ bool Simplify(const SkPath& path, SkPath* result) { if (!builder.finish()) { return false; } - SkTDArray<SkOpContour*> contourList; + SkTArray<SkOpContour*, true> contourList; MakeContourList(contours, contourList, false, false); SkOpContour** currentPtr = contourList.begin(); result->setFillType(fillType); |