SkScalar fStrokeWidth;
SkPoint fPts[2];
SkAutoTUnref<SkPathEffect> fPathEffect;
-
+
public:
enum LineType {
kHori_LineType,
SkScalar cx = 640 / 2; // center X
SkScalar cy = 480 / 2; // center Y
SkMatrix matrix;
-
+
switch (lt) {
case kHori_LineType:
matrix.setIdentity();
matrix.setRotate(45, cx, cy);
break;
}
-
+
const SkScalar overshoot = 100*1000;
const SkPoint pts[2] = {
{ -overshoot, cy }, { 640 + overshoot, cy }
};
matrix.mapPoints(fPts, pts, 2);
}
-
+
protected:
virtual const char* onGetName() SK_OVERRIDE {
return fName.c_str();
}
-
+
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkPaint p;
this->setupPaint(&p);
canvas->drawPoints(SkCanvas::kLines_PointMode, 2, fPts, p);
}
-
+
private:
typedef SkBenchmark INHERITED;
};
cubic1, SkTMax(to1 - dt1, 0.), SkTMin(to1 + dt1, 1.), i);
i.swap();
--debugDepth;
-
+
}
}
t2Start = t2;
*roots++ = -u - adiv3;
}
}
- else
+ else
#endif
if (R2MinusQ3 < 0) // we have 3 real roots
{
return approximately_zero(x - y);
#else
// see http://visualstudiomagazine.com/blogs/tool-tracker/2011/11/compare-floating-point-numbers.aspx
-// this allows very small (e.g. degenerate) values to compare unequally, but in this case,
+// this allows very small (e.g. degenerate) values to compare unequally, but in this case,
// AlmostEqualUlps should be used instead.
if (x == y) {
return true;
*/
-
+
int add_valid_ts(double s[], int realRoots, double* t) {
int foundRoots = 0;
for (int index = 0; index < realRoots; ++index) {
int reducedQuarticRoots(const double t4, const double t3, const double t2, const double t1,
const double t0, const bool oneHint, double s[4]);
-
+
int quarticRootsReal(const double A, const double B, const double C, const double D,
const double E, double s[4]);
'type': 'executable',
'mac_bundle' : 1,
'include_dirs' : [
- '../src/core',
+ '../src/core',
'../src/effects', #needed for BlurMask.h
'../gm', # needed to pull gm.h
'../samplecode', # To pull SampleApp.h and SampleCode.h
*/
bool SK_WARN_UNUSED_RESULT
computeConservativeLocalClipBounds(SkRect* bounds) const;
-
+
public:
const SkBitmap* fBitmap; // required
const SkMatrix* fMatrix; // required
path.lineTo(pts[1]);
SkRect cullRect = SkRect::Make(fRC->getBounds());
-
+
if (paint.getPathEffect()->asPoints(&pointData, path, rec,
*fMatrix, &cullRect)) {
// 'asPoints' managed to find some fast path
SkScalar dx = pts[1].x() - pts[0].x();
SkScalar dy = pts[1].y() - pts[0].y();
-
+
// just do horizontal lines for now (lazy)
if (dy) {
return false;
SkScalar minX = pts[0].fX;
SkScalar maxX = pts[1].fX;
-
+
if (maxX < bounds.fLeft || minX > bounds.fRight) {
return false;
}
-
+
if (dx < 0) {
SkTSwap(minX, maxX);
}
maxX = bounds.fRight + SkScalarMod(maxX - bounds.fRight,
intervalLength);
}
-
+
SkASSERT(maxX > minX);
if (dx < 0) {
SkTSwap(minX, maxX);
}
pts[0].fX = minX;
pts[1].fX = maxX;
-
+
dstPath->moveTo(pts[0]);
dstPath->lineTo(pts[1]);
return true;
if (cull_path(src, *rec, cullRect, fIntervalLength, &cullPathStorage)) {
srcPtr = &cullPathStorage;
}
-
+
SpecialLineRec lineRec;
bool specialLine = lineRec.init(src, dst, rec, fCount >> 1, fIntervalLength);
for (int i = 0; i < 10000; i++) {
int count = rand.nextRangeU(1, SK_ARRAY_COUNT(randomArray));
rand_array(rand, randomArray, count);
-
+
// Use qsort as the reference sort.
memcpy(sortedArray, randomArray, sizeof(randomArray));
qsort(sortedArray, count, sizeof(sortedArray[0]), compare_int);