static const int kHeight = 300;
public:
- ConstXTileBench(void* param,
+ ConstXTileBench(void* param,
SkShader::TileMode xTile,
SkShader::TileMode yTile,
bool doFilter,
- bool doTrans)
+ bool doTrans)
: INHERITED(param)
, fDoFilter(doFilter)
, fDoTrans(doTrans) {
// this flavor approximates the cubics with quads to find the intersecting ts
// OPTIMIZE: if this strategy proves successful, the quad approximations, or the ts used
// to create the approximations, could be stored in the cubic segment
-// fixme: this strategy needs to add short line segments on either end, or similarly extend the
+// fixme: this strategy needs to add short line segments on either end, or similarly extend the
// initial and final quadratics
bool intersect2(const Cubic& c1, const Cubic& c2, Intersections& i) {
SkTDArray<double> ts1;
cubic_to_quadratics(cubic1, calcPrecision(cubic1), quads1);
for (int index = 0; index < quads1.count(); ++index) {
const Quadratic& q = quads1[index];
- SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", q[0].x, q[0].y,
+ SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", q[0].x, q[0].y,
q[1].x, q[1].y, q[2].x, q[2].y);
}
SkDebugf("\n");
cubic_to_quadratics(cubic2, calcPrecision(cubic2), quads2);
for (int index = 0; index < quads2.count(); ++index) {
const Quadratic& q = quads2[index];
- SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", q[0].x, q[0].y,
+ SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", q[0].x, q[0].y,
q[1].x, q[1].y, q[2].x, q[2].y);
}
SkDebugf("\n");
return AlmostEqualUlps((float) x, (float) a.x)
&& AlmostEqualUlps((float) y, (float) a.y);
}
-
+
double dot(const _Point& a) {
return x * a.x + y * a.y;
}
void swap() {
fSwap ^= true;
}
-
+
void swapPts() {
int index;
for (index = 0; index < fUsed; ++index) {
* 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
*/
-
+
#if SK_DEBUG
#define QUARTIC_DEBUG 1
#else
const _Point& B = (*testLines[1])[0];
const _Point& C = (*testLines[2])[0];
-// Compute vectors
+// Compute vectors
_Point v0 = C - A;
_Point v1 = B - A;
_Point v2 = pt - A;
bool startInTriangle = pointInTriangle(end, testLines);
if (startInTriangle) {
tMin = t2s;
- }
+ }
xy_at_t(q2, t2e, end.x, end.y);
bool endInTriangle = pointInTriangle(end, testLines);
if (endInTriangle) {
break;
}
}
-
+
}
if (split == 0) { // there's one point
if (addIntercept(q1, q2, tMin, tMax, i)) {
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-
+
#if !defined QUADRATIC_UTILITIES_H
#define QUADRATIC_UTILITIES_H
other.addCancelOutsides(tStart, oStart, *this, endT);
}
}
-
+
int addUnsortableT(double newT, Segment* other, bool start) {
int result = addT(newT, other);
Span* span = &fTs[result];
pathB.cubicTo(10.7082f, -116.596f, 262.057f, 45.6468f, 294.694f, 1.96237f);
pathB.close();
testShapeOp(path, pathB, kDifference_Op);
-}
+}
static const size_t testCount = sizeof(tests) / sizeof(tests[0]);
int count) {
str->append(label);
str->append("(");
-
+
const SkScalar* values = &pts[0].fX;
count *= 2;