Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@5561 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
6c5418e6c2
commit
055c7c299c
@ -190,7 +190,7 @@ struct _Rect {
|
||||
bottom = pt.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FIXME: used by debugging only ?
|
||||
bool contains(const _Point& pt) {
|
||||
return approximately_between(left, pt.x, right)
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
#include "DataTypes.h"
|
||||
#include "Intersections.h"
|
||||
|
||||
@ -12,5 +12,5 @@ void Intersections::cleanUp() {
|
||||
assert(fCoincidentUsed);
|
||||
assert(fUsed);
|
||||
// find any entries in fT that could be part of the coincident range
|
||||
|
||||
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
fT[fSwap][index] = val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void insert(double one, double two) {
|
||||
assert(fUsed <= 1 || fT[0][0] < fT[0][1]);
|
||||
int index;
|
||||
@ -141,7 +141,7 @@ public:
|
||||
fT[1][index] = two;
|
||||
++fUsed;
|
||||
}
|
||||
|
||||
|
||||
void insertOne(double t, int side) {
|
||||
int used = side ? fUsed2 : fUsed;
|
||||
assert(used <= 1 || fT[side][0] < fT[side][1]);
|
||||
@ -166,7 +166,7 @@ public:
|
||||
bool intersected() const {
|
||||
return fUsed > 0;
|
||||
}
|
||||
|
||||
|
||||
bool insertBalanced() const {
|
||||
return fUsed == fUsed2;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
/* given the implicit form 0 = Ax^2 + Bxy + Cy^2 + Dx + Ey + F
|
||||
* and given x = at^2 + bt + c (the parameterized form)
|
||||
* y = dt^2 + et + f
|
||||
* then
|
||||
* then
|
||||
* 0 = A(at^2+bt+c)(at^2+bt+c)+B(at^2+bt+c)(dt^2+et+f)+C(dt^2+et+f)(dt^2+et+f)+D(at^2+bt+c)+E(dt^2+et+f)+F
|
||||
*/
|
||||
|
||||
|
@ -262,7 +262,7 @@ double coinMaxT2;
|
||||
|
||||
static void hackToFixPartialCoincidence(const Quadratic& q1, const Quadratic& q2, Intersections& i) {
|
||||
// look to see if non-coincident data basically has unsortable tangents
|
||||
|
||||
|
||||
// look to see if a point between non-coincident data is on the curve
|
||||
int cIndex;
|
||||
for (int uIndex = 0; uIndex < i.fUsed; ) {
|
||||
|
@ -4,7 +4,7 @@ class QuadImplicitForm {
|
||||
public:
|
||||
QuadImplicitForm(const Quadratic& q);
|
||||
bool implicit_match(const QuadImplicitForm& two) const;
|
||||
|
||||
|
||||
double x2() const { return p[xx_coeff]; }
|
||||
double xy() const { return p[xy_coeff]; }
|
||||
double y2() const { return p[yy_coeff]; }
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* Jan 26, 1990 Version for Graphics Gems
|
||||
* Oct 11, 1990 Fixed sign problem for negative q's in SolveQuartic
|
||||
* (reported by Mark Podlipec),
|
||||
* Old-style function definitions,
|
||||
* IsZero() as a macro
|
||||
* (reported by Mark Podlipec),
|
||||
* Old-style function definitions,
|
||||
* IsZero() as a macro
|
||||
* Nov 23, 1990 Some systems do not declare acos() and cbrt() in
|
||||
* <math.h>, though the functions exist in the library.
|
||||
* If large coefficients are used, EQN_EPS should be
|
||||
@ -72,7 +72,7 @@ static int cubicRootsX(const double A, const double B, const double C,
|
||||
const double b = C * invA;
|
||||
const double c = D * invA;
|
||||
/* substitute x = y - a/3 to eliminate quadric term:
|
||||
x^3 +px + q = 0 */
|
||||
x^3 +px + q = 0 */
|
||||
const double a2 = a * a;
|
||||
const double Q = (-a2 + b * 3) / 9;
|
||||
const double R = (2 * a2 * a - 9 * a * b + 27 * c) / 54;
|
||||
@ -84,7 +84,7 @@ static int cubicRootsX(const double A, const double B, const double C,
|
||||
s[0] = 0;
|
||||
num = 1;
|
||||
} else { /* one single and one double solution */
|
||||
|
||||
|
||||
double u = cube_root(-R);
|
||||
s[0] = 2 * u;
|
||||
s[1] = -u;
|
||||
@ -130,13 +130,13 @@ int quarticRoots(const double A, const double B, const double C, const double D,
|
||||
const double c = D * invA;
|
||||
const double d = E * invA;
|
||||
/* substitute x = y - a/4 to eliminate cubic term:
|
||||
x^4 + px^2 + qx + r = 0 */
|
||||
x^4 + px^2 + qx + r = 0 */
|
||||
const double a2 = a * a;
|
||||
const double p = -3 * a2 / 8 + b;
|
||||
const double q = a2 * a / 8 - a * b / 2 + c;
|
||||
const double r = -3 * a2 * a2 / 256 + a2 * b / 16 - a * c / 4 + d;
|
||||
if (approximately_zero(r)) {
|
||||
/* no absolute term: y(y^3 + py + q) = 0 */
|
||||
/* no absolute term: y(y^3 + py + q) = 0 */
|
||||
num = cubicRootsX(1, 0, p, q, s);
|
||||
s[num++] = 0;
|
||||
} else {
|
||||
|
@ -16,7 +16,7 @@ static bool windingIsActive(int winding, int spanWinding, int oppWinding,
|
||||
&& (!winding || !spanWinding || winding == -spanWinding);
|
||||
}
|
||||
|
||||
static void bridgeOp(SkTDArray<Contour*>& contourList, const ShapeOp op,
|
||||
static void bridgeOp(SkTDArray<Contour*>& contourList, const ShapeOp op,
|
||||
const int aXorMask, const int bXorMask, SkPath& simple) {
|
||||
bool firstContour = true;
|
||||
do {
|
||||
|
@ -539,7 +539,7 @@ public:
|
||||
SkASSERT(fSide != rh.fSide);
|
||||
return fSide < rh.fSide;
|
||||
}
|
||||
#if 0 // the following code is a bust. In particular, tangent length doesn't provide a sort
|
||||
#if 0 // the following code is a bust. In particular, tangent length doesn't provide a sort
|
||||
if (y != ry) {
|
||||
return (fabs(y) < fabs(ry)) ^ (fSide > 0);
|
||||
}
|
||||
@ -555,7 +555,7 @@ public:
|
||||
#else
|
||||
SkASSERT(fVerb == SkPath::kQuad_Verb); // worry about cubics later
|
||||
SkASSERT(rh.fVerb == SkPath::kQuad_Verb);
|
||||
// FIXME: until I can think of something better, project a ray perpendicular from the
|
||||
// FIXME: until I can think of something better, project a ray perpendicular from the
|
||||
// end of the shorter tangent through both curves and use the resulting angle to sort
|
||||
// FIXME: some of this setup can be moved to set() if it works, or cached if it's expensive
|
||||
double len = fTangent1.normalSquared();
|
||||
@ -1653,7 +1653,7 @@ public:
|
||||
const Span& mSpan = fTs[SkMin32(start, end)];
|
||||
return mSpan.fDone;
|
||||
}
|
||||
|
||||
|
||||
Segment* findNextOp(SkTDArray<Span*>& chase, bool active,
|
||||
int& nextStart, int& nextEnd, int& winding, int& spanWinding, ShapeOp op,
|
||||
const int aXorMask, const int bXorMask) {
|
||||
@ -1765,7 +1765,7 @@ public:
|
||||
SkDebugf("%s [%d] maxWinding=%d sumWinding=%d sign=%d altFlipped=%d\n", __FUNCTION__,
|
||||
nextIndex, maxWinding, sumWinding, nextAngle->sign(), altFlipped);
|
||||
#endif
|
||||
|
||||
|
||||
if (!(sumWinding & xorMask) && activeOp(angleIsOp, otherNonZero, op)) {
|
||||
if (!active) {
|
||||
markDone(SkMin32(startIndex, endIndex), outerWinding);
|
||||
@ -2603,7 +2603,7 @@ public:
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
bool operand() const {
|
||||
return fOperand;
|
||||
}
|
||||
@ -2710,7 +2710,7 @@ public:
|
||||
SkScalar xAtT(const Span* span) const {
|
||||
return xyAtT(span).fX;
|
||||
}
|
||||
|
||||
|
||||
const SkPoint& xyAtT(int index) const {
|
||||
return xyAtT(&fTs[index]);
|
||||
}
|
||||
@ -3157,7 +3157,7 @@ public:
|
||||
void setOperand(bool isOp) {
|
||||
fOperand = isOp;
|
||||
}
|
||||
|
||||
|
||||
void setXor(bool isXor) {
|
||||
fXor = isXor;
|
||||
}
|
||||
@ -3441,7 +3441,7 @@ void walk() {
|
||||
SkASSERT(fCurrentContour);
|
||||
if (verbPtr == endOfFirstHalf) {
|
||||
fOperand = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,7 +476,7 @@ int SkCubicEdge::updateCubic()
|
||||
newx = fCLastX;
|
||||
newy = fCLastY;
|
||||
}
|
||||
|
||||
|
||||
// we want to say SkASSERT(oldy <= newy), but our finite fixedpoint
|
||||
// doesn't always achieve that, so we have to explicitly pin it here.
|
||||
if (newy < oldy) {
|
||||
|
@ -31,10 +31,10 @@ static SkSurface* new_surface(int w, int h) {
|
||||
// assert in the SK_DEBUG build.
|
||||
static void test_tricky_cubic(skiatest::Reporter* reporter) {
|
||||
const SkPoint pts[] = {
|
||||
{ SkDoubleToScalar(18.8943768), SkDoubleToScalar(129.121277) },
|
||||
{ SkDoubleToScalar(18.8937435), SkDoubleToScalar(129.121689) },
|
||||
{ SkDoubleToScalar(18.8950119), SkDoubleToScalar(129.120422) },
|
||||
{ SkDoubleToScalar(18.5030727), SkDoubleToScalar(129.13121) },
|
||||
{ SkDoubleToScalar(18.8943768), SkDoubleToScalar(129.121277) },
|
||||
{ SkDoubleToScalar(18.8937435), SkDoubleToScalar(129.121689) },
|
||||
{ SkDoubleToScalar(18.8950119), SkDoubleToScalar(129.120422) },
|
||||
{ SkDoubleToScalar(18.5030727), SkDoubleToScalar(129.13121) },
|
||||
};
|
||||
|
||||
SkPath path;
|
||||
|
Loading…
Reference in New Issue
Block a user