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

Unified Diff: src/pathops/SkDQuadIntersection.cpp

Issue 16951017: convert pathops to use SkSTArray where possible. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: pathops use SkTArray Created 7 years, 6 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/SkDCubicToQuads.cpp ('k') | src/pathops/SkOpAngle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkDQuadIntersection.cpp
diff --git a/src/pathops/SkDQuadIntersection.cpp b/src/pathops/SkDQuadIntersection.cpp
index b6a1761781e7b4516e9ef2911f9165cd7a9c29e0..8b222f725d82661df928dffcdfa4f7d1717bc1a9 100644
--- a/src/pathops/SkDQuadIntersection.cpp
+++ b/src/pathops/SkDQuadIntersection.cpp
@@ -9,7 +9,7 @@
#include "SkIntersections.h"
#include "SkPathOpsLine.h"
#include "SkQuarticRoot.h"
-#include "SkTDArray.h"
+#include "SkTArray.h"
#include "SkTSort.h"
/* given the implicit form 0 = Ax^2 + Bxy + Cy^2 + Dx + Ey + F
@@ -150,9 +150,9 @@ static bool is_linear_inner(const SkDQuad& q1, double t1s, double t1e, const SkD
SkDQuad hull = q1.subDivide(t1s, t1e);
SkDLine line = {{hull[2], hull[0]}};
const SkDLine* testLines[] = { &line, (const SkDLine*) &hull[0], (const SkDLine*) &hull[1] };
- size_t testCount = SK_ARRAY_COUNT(testLines);
- SkTDArray<double> tsFound;
- for (size_t index = 0; index < testCount; ++index) {
+ const size_t kTestCount = SK_ARRAY_COUNT(testLines);
+ SkSTArray<kTestCount * 2, double, true> tsFound;
+ for (size_t index = 0; index < kTestCount; ++index) {
SkIntersections rootTs;
int roots = rootTs.intersect(q2, *testLines[index]);
for (int idx2 = 0; idx2 < roots; ++idx2) {
@@ -165,7 +165,7 @@ static bool is_linear_inner(const SkDQuad& q1, double t1s, double t1e, const SkD
if (approximately_negative(t - t2s) || approximately_positive(t - t2e)) {
continue;
}
- *tsFound.append() = rootTs[0][idx2];
+ tsFound.push_back(rootTs[0][idx2]);
}
}
int tCount = tsFound.count();
« no previous file with comments | « src/pathops/SkDCubicToQuads.cpp ('k') | src/pathops/SkOpAngle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698