aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpContour.cpp
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-17 14:10:36 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-17 14:10:36 +0000
commitd892bd8ba676d34d4ce4a73ac7aad88e102fad70 (patch)
treef8b35e6d7582800ef622fc796ef4077163763a05 /src/pathops/SkOpContour.cpp
parentacb3d88cf84adf367c173a7a33cd3b0c379291dc (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/SkOpContour.cpp')
-rw-r--r--src/pathops/SkOpContour.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pathops/SkOpContour.cpp b/src/pathops/SkOpContour.cpp
index 6266c65cf8..f3861a1e0b 100644
--- a/src/pathops/SkOpContour.cpp
+++ b/src/pathops/SkOpContour.cpp
@@ -11,7 +11,7 @@
void SkOpContour::addCoincident(int index, SkOpContour* other, int otherIndex,
const SkIntersections& ts, bool swap) {
- SkCoincidence& coincidence = *fCoincidences.append();
+ SkCoincidence& coincidence = fCoincidences.push_back();
coincidence.fContours[0] = this; // FIXME: no need to store
coincidence.fContours[1] = other;
coincidence.fSegments[0] = index;
@@ -152,9 +152,9 @@ void SkOpContour::calcCoincidentWinding() {
void SkOpContour::sortSegments() {
int segmentCount = fSegments.count();
- fSortedSegments.setReserve(segmentCount);
+ fSortedSegments.push_back_n(segmentCount);
for (int test = 0; test < segmentCount; ++test) {
- *fSortedSegments.append() = &fSegments[test];
+ fSortedSegments[test] = &fSegments[test];
}
SkTQSort<SkOpSegment>(fSortedSegments.begin(), fSortedSegments.end() - 1);
fFirstSorted = 0;
@@ -229,7 +229,7 @@ int SkOpContour::debugShowWindingValues(int totalSegments, int ofInterest) {
return sum;
}
-static void SkOpContour::debugShowWindingValues(const SkTDArray<SkOpContour*>& contourList) {
+static void SkOpContour::debugShowWindingValues(const SkTArray<SkOpContour*, true>& contourList) {
// int ofInterest = 1 << 1 | 1 << 5 | 1 << 9 | 1 << 13;
// int ofInterest = 1 << 4 | 1 << 8 | 1 << 12 | 1 << 16;
int ofInterest = 1 << 5 | 1 << 8;