From d892bd8ba676d34d4ce4a73ac7aad88e102fad70 Mon Sep 17 00:00:00 2001 From: "caryclark@google.com" Date: Mon, 17 Jun 2013 14:10:36 +0000 Subject: 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 --- tests/PathOpsTestCommon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/PathOpsTestCommon.cpp') diff --git a/tests/PathOpsTestCommon.cpp b/tests/PathOpsTestCommon.cpp index aab7d6ea25..4356b42414 100644 --- a/tests/PathOpsTestCommon.cpp +++ b/tests/PathOpsTestCommon.cpp @@ -7,12 +7,12 @@ #include "PathOpsTestCommon.h" #include "SkPathOpsCubic.h" -void CubicToQuads(const SkDCubic& cubic, double precision, SkTDArray& quads) { - SkTDArray ts; +void CubicToQuads(const SkDCubic& cubic, double precision, SkTArray& quads) { + SkTArray ts; cubic.toQuadraticTs(precision, &ts); if (ts.count() <= 0) { SkDQuad quad = cubic.toQuad(); - *quads.append() = quad; + quads.push_back(quad); return; } double tStart = 0; @@ -20,7 +20,7 @@ void CubicToQuads(const SkDCubic& cubic, double precision, SkTDArray& q const double tEnd = i1 < ts.count() ? ts[i1] : 1; SkDCubic part = cubic.subDivide(tStart, tEnd); SkDQuad quad = part.toQuad(); - *quads.append() = quad; + quads.push_back(quad); tStart = tEnd; } } -- cgit v1.2.3