SkDQuad quad = part.toQuad();
// FIXME: should reduceOrder be looser in this use case if quartic is going to blow up on an
// extremely shallow quadratic?
- int order = reducer->reduce(quad, SkReduceOrder::kFill_Style);
+ int order = reducer->reduce(quad);
#if DEBUG_QUAD_PART
SkDebugf("%s cubic=(%1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g)"
" t=(%1.9g,%1.9g)\n", __FUNCTION__, cubic[0].fX, cubic[0].fY,
// it would still take the prechopped cubic for reduce order and find cubic inflections
void SkDCubic::toQuadraticTs(double precision, SkTArray<double, true>* ts) const {
SkReduceOrder reducer;
- int order = reducer.reduce(*this, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ int order = reducer.reduce(*this, SkReduceOrder::kAllow_Quadratics);
if (order < 3) {
return;
}
SkDCubicPair pair;
if (inflections == 1) {
pair = chopAt(inflectT[0]);
- int orderP1 = reducer.reduce(pair.first(), SkReduceOrder::kNo_Quadratics,
- SkReduceOrder::kFill_Style);
+ int orderP1 = reducer.reduce(pair.first(), SkReduceOrder::kNo_Quadratics);
if (orderP1 < 2) {
--inflections;
} else {
- int orderP2 = reducer.reduce(pair.second(), SkReduceOrder::kNo_Quadratics,
- SkReduceOrder::kFill_Style);
+ int orderP2 = reducer.reduce(pair.second(), SkReduceOrder::kNo_Quadratics);
if (orderP2 < 2) {
--inflections;
}
return result;
}
- // OPTIMIZATION: mark as debugging only if used solely by tests
double t(int tIndex) const {
return fTs[tIndex].fT;
}
return fTs[tIndex].fWindValue;
}
+#if defined(SK_DEBUG) || DEBUG_WINDING
SkScalar xAtT(int index) const {
return xAtT(&fTs[index]);
}
-
- SkScalar xAtT(const SkOpSpan* span) const {
- return xyAtT(span).fX;
- }
+#endif
const SkPoint& xyAtT(const SkOpSpan* span) const {
return span->fPt;
return xyAtT(&fTs[index]);
}
+#if defined(SK_DEBUG) || DEBUG_WINDING
SkScalar yAtT(int index) const {
return yAtT(&fTs[index]);
}
-
- SkScalar yAtT(const SkOpSpan* span) const {
- return xyAtT(span).fY;
- }
+#endif
bool activeAngle(int index, int* done, SkTArray<SkOpAngle, true>* angles);
SkPoint activeLeftTop(bool onlySortable, int* firstT) const;
static bool UseInnerWindingReverse(int outerWinding, int innerWinding);
SkOpSpan* verifyOneWinding(const char* funName, int tIndex);
SkOpSpan* verifyOneWindingU(const char* funName, int tIndex);
+
+ SkScalar xAtT(const SkOpSpan* span) const {
+ return xyAtT(span).fX;
+ }
+
+ SkScalar yAtT(const SkOpSpan* span) const {
+ return xyAtT(span).fY;
+ }
+
void zeroSpan(SkOpSpan* span);
#if DEBUG_SWAP_TOP
return 1 + different;
}
-static double interp_quad_coords(double a, double b, double c, double t) {
- double ab = SkDInterp(a, b, t);
- double bc = SkDInterp(b, c, t);
- return SkDInterp(ab, bc, t);
-}
-
static int coincident_line(const SkDQuad& quad, SkDQuad& reduction) {
reduction[0] = reduction[1] = quad[0];
return 1;
return 1 + !reduction[0].approximatelyEqual(reduction[1]);
}
-static int vertical_line(const SkDQuad& quad, SkReduceOrder::Style reduceStyle,
- SkDQuad& reduction) {
- double tValue;
+static int vertical_line(const SkDQuad& quad, SkDQuad& reduction) {
reduction[0] = quad[0];
reduction[1] = quad[2];
- if (reduceStyle == SkReduceOrder::kFill_Style) {
- return reductionLineCount(reduction);
- }
- int smaller = reduction[1].fY > reduction[0].fY;
- int larger = smaller ^ 1;
- if (SkDQuad::FindExtrema(quad[0].fY, quad[1].fY, quad[2].fY, &tValue)) {
- double yExtrema = interp_quad_coords(quad[0].fY, quad[1].fY, quad[2].fY, tValue);
- if (reduction[smaller].fY > yExtrema) {
- reduction[smaller].fY = yExtrema;
- } else if (reduction[larger].fY < yExtrema) {
- reduction[larger].fY = yExtrema;
- }
- }
return reductionLineCount(reduction);
}
-static int horizontal_line(const SkDQuad& quad, SkReduceOrder::Style reduceStyle,
- SkDQuad& reduction) {
- double tValue;
+static int horizontal_line(const SkDQuad& quad, SkDQuad& reduction) {
reduction[0] = quad[0];
reduction[1] = quad[2];
- if (reduceStyle == SkReduceOrder::kFill_Style) {
- return reductionLineCount(reduction);
- }
- int smaller = reduction[1].fX > reduction[0].fX;
- int larger = smaller ^ 1;
- if (SkDQuad::FindExtrema(quad[0].fX, quad[1].fX, quad[2].fX, &tValue)) {
- double xExtrema = interp_quad_coords(quad[0].fX, quad[1].fX, quad[2].fX, tValue);
- if (reduction[smaller].fX > xExtrema) {
- reduction[smaller].fX = xExtrema;
- } else if (reduction[larger].fX < xExtrema) {
- reduction[larger].fX = xExtrema;
- }
- }
return reductionLineCount(reduction);
}
-static int check_linear(const SkDQuad& quad, SkReduceOrder::Style reduceStyle,
+static int check_linear(const SkDQuad& quad,
int minX, int maxX, int minY, int maxY, SkDQuad& reduction) {
int startIndex = 0;
int endIndex = 2;
// four are colinear: return line formed by outside
reduction[0] = quad[0];
reduction[1] = quad[2];
- if (reduceStyle == SkReduceOrder::kFill_Style) {
- return reductionLineCount(reduction);
- }
- int sameSide;
- bool useX = quad[maxX].fX - quad[minX].fX >= quad[maxY].fY - quad[minY].fY;
- if (useX) {
- sameSide = SkDSign(quad[0].fX - quad[1].fX) + SkDSign(quad[2].fX - quad[1].fX);
- } else {
- sameSide = SkDSign(quad[0].fY - quad[1].fY) + SkDSign(quad[2].fY - quad[1].fY);
- }
- if ((sameSide & 3) != 2) {
- return reductionLineCount(reduction);
- }
- double tValue;
- int root;
- if (useX) {
- root = SkDQuad::FindExtrema(quad[0].fX, quad[1].fX, quad[2].fX, &tValue);
- } else {
- root = SkDQuad::FindExtrema(quad[0].fY, quad[1].fY, quad[2].fY, &tValue);
- }
- if (root) {
- SkDPoint extrema;
- extrema.fX = interp_quad_coords(quad[0].fX, quad[1].fX, quad[2].fX, tValue);
- extrema.fY = interp_quad_coords(quad[0].fY, quad[1].fY, quad[2].fY, tValue);
- // sameSide > 0 means mid is smaller than either [0] or [2], so replace smaller
- int replace;
- if (useX) {
- if ((extrema.fX < quad[0].fX) ^ (extrema.fX < quad[2].fX)) {
- return reductionLineCount(reduction);
- }
- replace = ((extrema.fX < quad[0].fX) | (extrema.fX < quad[2].fX))
- ^ (quad[0].fX < quad[2].fX);
- } else {
- if ((extrema.fY < quad[0].fY) ^ (extrema.fY < quad[2].fY)) {
- return reductionLineCount(reduction);
- }
- replace = ((extrema.fY < quad[0].fY) | (extrema.fY < quad[2].fY))
- ^ (quad[0].fY < quad[2].fY);
- }
- reduction[replace] = extrema;
- }
return reductionLineCount(reduction);
}
// note that three points in a line doesn't simplify a cubic
// look for approximation with single quadratic
// save approximation with multiple quadratics for later
-int SkReduceOrder::reduce(const SkDQuad& quad, Style reduceStyle) {
+int SkReduceOrder::reduce(const SkDQuad& quad) {
int index, minX, maxX, minY, maxY;
int minXSet, minYSet;
minX = maxX = minY = maxY = 0;
if (minYSet == 0x7) { // return 1 if all four are coincident
return coincident_line(quad, fQuad);
}
- return vertical_line(quad, reduceStyle, fQuad);
+ return vertical_line(quad, fQuad);
}
if (minYSet == 0xF) { // test for horizontal line
- return horizontal_line(quad, reduceStyle, fQuad);
+ return horizontal_line(quad, fQuad);
}
- int result = check_linear(quad, reduceStyle, minX, maxX, minY, maxY, fQuad);
+ int result = check_linear(quad, minX, maxX, minY, maxY, fQuad);
if (result) {
return result;
}
////////////////////////////////////////////////////////////////////////////////////
-static double interp_cubic_coords(const double* src, double t) {
- double ab = SkDInterp(src[0], src[2], t);
- double bc = SkDInterp(src[2], src[4], t);
- double cd = SkDInterp(src[4], src[6], t);
- double abc = SkDInterp(ab, bc, t);
- double bcd = SkDInterp(bc, cd, t);
- return SkDInterp(abc, bcd, t);
-}
-
static int coincident_line(const SkDCubic& cubic, SkDCubic& reduction) {
reduction[0] = reduction[1] = cubic[0];
return 1;
return 1 + !reduction[0].approximatelyEqual(reduction[1]);
}
-static int vertical_line(const SkDCubic& cubic, SkReduceOrder::Style reduceStyle,
- SkDCubic& reduction) {
- double tValues[2];
+static int vertical_line(const SkDCubic& cubic, SkDCubic& reduction) {
reduction[0] = cubic[0];
reduction[1] = cubic[3];
- if (reduceStyle == SkReduceOrder::kFill_Style) {
- return reductionLineCount(reduction);
- }
- int smaller = reduction[1].fY > reduction[0].fY;
- int larger = smaller ^ 1;
- int roots = SkDCubic::FindExtrema(cubic[0].fY, cubic[1].fY, cubic[2].fY, cubic[3].fY, tValues);
- for (int index = 0; index < roots; ++index) {
- double yExtrema = interp_cubic_coords(&cubic[0].fY, tValues[index]);
- if (reduction[smaller].fY > yExtrema) {
- reduction[smaller].fY = yExtrema;
- continue;
- }
- if (reduction[larger].fY < yExtrema) {
- reduction[larger].fY = yExtrema;
- }
- }
return reductionLineCount(reduction);
}
-static int horizontal_line(const SkDCubic& cubic, SkReduceOrder::Style reduceStyle,
- SkDCubic& reduction) {
- double tValues[2];
+static int horizontal_line(const SkDCubic& cubic, SkDCubic& reduction) {
reduction[0] = cubic[0];
reduction[1] = cubic[3];
- if (reduceStyle == SkReduceOrder::kFill_Style) {
- return reductionLineCount(reduction);
- }
- int smaller = reduction[1].fX > reduction[0].fX;
- int larger = smaller ^ 1;
- int roots = SkDCubic::FindExtrema(cubic[0].fX, cubic[1].fX, cubic[2].fX, cubic[3].fX, tValues);
- for (int index = 0; index < roots; ++index) {
- double xExtrema = interp_cubic_coords(&cubic[0].fX, tValues[index]);
- if (reduction[smaller].fX > xExtrema) {
- reduction[smaller].fX = xExtrema;
- continue;
- }
- if (reduction[larger].fX < xExtrema) {
- reduction[larger].fX = xExtrema;
- }
- }
return reductionLineCount(reduction);
}
return 3;
}
-static int check_linear(const SkDCubic& cubic, SkReduceOrder::Style reduceStyle,
+static int check_linear(const SkDCubic& cubic,
int minX, int maxX, int minY, int maxY, SkDCubic& reduction) {
int startIndex = 0;
int endIndex = 3;
// four are colinear: return line formed by outside
reduction[0] = cubic[0];
reduction[1] = cubic[3];
- if (reduceStyle == SkReduceOrder::kFill_Style) {
- return reductionLineCount(reduction);
- }
- int sameSide1;
- int sameSide2;
- bool useX = cubic[maxX].fX - cubic[minX].fX >= cubic[maxY].fY - cubic[minY].fY;
- if (useX) {
- sameSide1 = SkDSign(cubic[0].fX - cubic[1].fX) + SkDSign(cubic[3].fX - cubic[1].fX);
- sameSide2 = SkDSign(cubic[0].fX - cubic[2].fX) + SkDSign(cubic[3].fX - cubic[2].fX);
- } else {
- sameSide1 = SkDSign(cubic[0].fY - cubic[1].fY) + SkDSign(cubic[3].fY - cubic[1].fY);
- sameSide2 = SkDSign(cubic[0].fY - cubic[2].fY) + SkDSign(cubic[3].fY - cubic[2].fY);
- }
- if (sameSide1 == sameSide2 && (sameSide1 & 3) != 2) {
- return reductionLineCount(reduction);
- }
- double tValues[2];
- int roots;
- if (useX) {
- roots = SkDCubic::FindExtrema(cubic[0].fX, cubic[1].fX, cubic[2].fX, cubic[3].fX, tValues);
- } else {
- roots = SkDCubic::FindExtrema(cubic[0].fY, cubic[1].fY, cubic[2].fY, cubic[3].fY, tValues);
- }
- for (int index = 0; index < roots; ++index) {
- SkDPoint extrema;
- extrema.fX = interp_cubic_coords(&cubic[0].fX, tValues[index]);
- extrema.fY = interp_cubic_coords(&cubic[0].fY, tValues[index]);
- // sameSide > 0 means mid is smaller than either [0] or [3], so replace smaller
- int replace;
- if (useX) {
- if ((extrema.fX < cubic[0].fX) ^ (extrema.fX < cubic[3].fX)) {
- continue;
- }
- replace = ((extrema.fX < cubic[0].fX) | (extrema.fX < cubic[3].fX))
- ^ (cubic[0].fX < cubic[3].fX);
- } else {
- if ((extrema.fY < cubic[0].fY) ^ (extrema.fY < cubic[3].fY)) {
- continue;
- }
- replace = ((extrema.fY < cubic[0].fY) | (extrema.fY < cubic[3].fY))
- ^ (cubic[0].fY < cubic[3].fY);
- }
- reduction[replace] = extrema;
- }
return reductionLineCount(reduction);
}
// note that three points in a line doesn't simplify a cubic
// look for approximation with single quadratic
// save approximation with multiple quadratics for later
-int SkReduceOrder::reduce(const SkDCubic& cubic, Quadratics allowQuadratics,
- Style reduceStyle) {
+int SkReduceOrder::reduce(const SkDCubic& cubic, Quadratics allowQuadratics) {
int index, minX, maxX, minY, maxY;
int minXSet, minYSet;
minX = maxX = minY = maxY = 0;
if (minYSet == 0xF) { // return 1 if all four are coincident
return coincident_line(cubic, fCubic);
}
- return vertical_line(cubic, reduceStyle, fCubic);
+ return vertical_line(cubic, fCubic);
}
if (minYSet == 0xF) { // test for horizontal line
- return horizontal_line(cubic, reduceStyle, fCubic);
+ return horizontal_line(cubic, fCubic);
}
- int result = check_linear(cubic, reduceStyle, minX, maxX, minY, maxY, fCubic);
+ int result = check_linear(cubic, minX, maxX, minY, maxY, fCubic);
if (result) {
return result;
}
SkDQuad quad;
quad.set(a);
SkReduceOrder reducer;
- int order = reducer.reduce(quad, kFill_Style);
+ int order = reducer.reduce(quad);
if (order == 2) { // quad became line
for (int index = 0; index < order; ++index) {
*reducePts++ = reducer.fLine[index].asSkPoint();
SkDCubic cubic;
cubic.set(a);
SkReduceOrder reducer;
- int order = reducer.reduce(cubic, kAllow_Quadratics, kFill_Style);
+ int order = reducer.reduce(cubic, kAllow_Quadratics);
if (order == 2 || order == 3) { // cubic became line or quad
for (int index = 0; index < order; ++index) {
*reducePts++ = reducer.fQuad[index].asSkPoint();
kNo_Quadratics,
kAllow_Quadratics
};
- enum Style {
- kStroke_Style,
- kFill_Style
- };
- int reduce(const SkDCubic& cubic, Quadratics, Style);
+ int reduce(const SkDCubic& cubic, Quadratics);
int reduce(const SkDLine& line);
- int reduce(const SkDQuad& quad, Style);
+ int reduce(const SkDQuad& quad);
static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
const SkDCubic& cubic1 = tests[index][0];
const SkDCubic& cubic2 = tests[index][1];
SkReduceOrder reduce1, reduce2;
- int order1 = reduce1.reduce(cubic1, SkReduceOrder::kNo_Quadratics,
- SkReduceOrder::kFill_Style);
- int order2 = reduce2.reduce(cubic2, SkReduceOrder::kNo_Quadratics,
- SkReduceOrder::kFill_Style);
+ int order1 = reduce1.reduce(cubic1, SkReduceOrder::kNo_Quadratics);
+ int order2 = reduce2.reduce(cubic2, SkReduceOrder::kNo_Quadratics);
const bool showSkipped = false;
if (order1 < 4) {
if (showSkipped) {
SkASSERT(ValidLine(line));
SkReduceOrder reduce1;
SkReduceOrder reduce2;
- int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics,
- SkReduceOrder::kFill_Style);
+ int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics);
int order2 = reduce2.reduce(line);
if (order1 < 4) {
SkDebugf("[%d] cubic order=%d\n", iIndex, order1);
SkASSERT(ValidQuad(quad));
SkReduceOrder reduce1;
SkReduceOrder reduce2;
- int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics,
- SkReduceOrder::kFill_Style);
- int order2 = reduce2.reduce(quad, SkReduceOrder::kFill_Style);
+ int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics);
+ int order2 = reduce2.reduce(quad);
if (order1 != 4) {
SkDebugf("[%d] cubic order=%d\n", iIndex, order1);
REPORTER_ASSERT(reporter, 0);
? firstTestIndex : SK_MaxS32;
int firstQuadraticModLineTest = run == RunAll ? 0 : run == RunQuadraticModLines
? firstTestIndex : SK_MaxS32;
+#if 0
int firstComputedLinesTest = run == RunAll ? 0 : run == RunComputedLines
? firstTestIndex : SK_MaxS32;
-
+#endif
for (index = firstPointDegeneratesTest; index < pointDegenerates_count; ++index) {
const SkDCubic& cubic = pointDegenerates[index];
SkASSERT(ValidCubic(cubic));
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order != 1) {
SkDebugf("[%d] pointDegenerates order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
for (index = firstNotPointDegeneratesTest; index < notPointDegenerates_count; ++index) {
const SkDCubic& cubic = notPointDegenerates[index];
SkASSERT(ValidCubic(cubic));
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order == 1) {
SkDebugf("[%d] notPointDegenerates order=%d\n", static_cast<int>(index), order);
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics,
- SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
REPORTER_ASSERT(reporter, 0);
}
}
for (index = firstLinesTest; index < lines_count; ++index) {
const SkDCubic& cubic = lines[index];
SkASSERT(ValidCubic(cubic));
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order != 2) {
SkDebugf("[%d] lines order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
for (index = firstNotLinesTest; index < notLines_count; ++index) {
const SkDCubic& cubic = notLines[index];
SkASSERT(ValidCubic(cubic));
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order == 2) {
SkDebugf("[%d] notLines order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
for (index = firstModEpsilonTest; index < modEpsilonLines_count; ++index) {
const SkDCubic& cubic = modEpsilonLines[index];
SkASSERT(ValidCubic(cubic));
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order == 2) {
SkDebugf("[%d] line mod by epsilon order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
for (index = firstLessEpsilonTest; index < lessEpsilonLines_count; ++index) {
const SkDCubic& cubic = lessEpsilonLines[index];
SkASSERT(ValidCubic(cubic));
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order != 2) {
SkDebugf("[%d] line less by epsilon/2 order=%d\n", static_cast<int>(index), order);
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics,
- SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
REPORTER_ASSERT(reporter, 0);
}
}
for (index = firstNegEpsilonTest; index < negEpsilonLines_count; ++index) {
const SkDCubic& cubic = negEpsilonLines[index];
SkASSERT(ValidCubic(cubic));
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order != 2) {
SkDebugf("[%d] line neg by epsilon/2 order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
const SkDQuad& quad = quadraticPoints[index];
SkASSERT(ValidQuad(quad));
SkDCubic cubic = quad.toCubic();
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order != 1) {
SkDebugf("[%d] point quad order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
const SkDQuad& quad = quadraticLines[index];
SkASSERT(ValidQuad(quad));
SkDCubic cubic = quad.toCubic();
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order != 2) {
SkDebugf("[%d] line quad order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
const SkDQuad& quad = quadraticModEpsilonLines[index];
SkASSERT(ValidQuad(quad));
SkDCubic cubic = quad.toCubic();
- order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(cubic, SkReduceOrder::kAllow_Quadratics);
if (order != 3) {
SkDebugf("[%d] line mod quad order=%d\n", static_cast<int>(index), order);
REPORTER_ASSERT(reporter, 0);
}
}
- // test if computed line end points are valid
+#if 0 // disable test until stroke reduction is supported
+// test if computed line end points are valid
for (index = firstComputedLinesTest; index < lines_count; ++index) {
const SkDCubic& cubic = lines[index];
SkASSERT(ValidCubic(cubic));
}
}
}
+#endif
}
#include "TestClassDef.h"
const SkDQuad& quad2 = quadraticTests[index][1];
SkASSERT(ValidQuad(quad2));
SkReduceOrder reduce1, reduce2;
- int order1 = reduce1.reduce(quad1, SkReduceOrder::kFill_Style);
- int order2 = reduce2.reduce(quad2, SkReduceOrder::kFill_Style);
+ int order1 = reduce1.reduce(quad1);
+ int order2 = reduce2.reduce(quad2);
if (order1 < 3) {
if (showSkipped) {
SkDebugf("[%d] quad1 order=%d\n", static_cast<int>(index), order1);
const SkDLine& line = lineQuadTests[index].line;
SkASSERT(ValidLine(line));
SkReduceOrder reducer1, reducer2;
- int order1 = reducer1.reduce(quad, SkReduceOrder::kFill_Style);
+ int order1 = reducer1.reduce(quad);
int order2 = reducer2.reduce(line);
if (order1 < 3) {
SkDebugf("%s [%d] quad order=%d\n", __FUNCTION__, iIndex, order1);
SkDQuad quad = {{{(double) ax, (double) ay}, {(double) bx, (double) by},
{(double) cx, (double) cy}}};
SkReduceOrder reducer;
- int order = reducer.reduce(quad, SkReduceOrder::kFill_Style);
+ int order = reducer.reduce(quad);
if (order < 3) {
return;
}
for (size_t index = 0; index < testSetCount; ++index) {
const SkDQuad& quad = testSet[index];
SkReduceOrder reducer;
- SkDEBUGCODE(int result = ) reducer.reduce(quad, SkReduceOrder::kFill_Style);
+ SkDEBUGCODE(int result = ) reducer.reduce(quad);
SkASSERT(result == 3);
}
}
for (index = firstQuadraticLineTest; index < quadraticLines_count; ++index) {
const SkDQuad& quad = quadraticLines[index];
- order = reducer.reduce(quad, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(quad);
if (order != 2) {
SkDebugf("[%d] line quad order=%d\n", (int) index, order);
}
}
for (index = firstQuadraticModLineTest; index < quadraticModEpsilonLines_count; ++index) {
const SkDQuad& quad = quadraticModEpsilonLines[index];
- order = reducer.reduce(quad, SkReduceOrder::kFill_Style);
+ order = reducer.reduce(quad);
if (order != 3) {
SkDebugf("[%d] line mod quad order=%d\n", (int) index, order);
}