Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@7385 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
e8625ac205
commit
4024f32d99
@ -318,7 +318,7 @@ class GiantDashBench : public SkBenchmark {
|
||||
SkScalar fStrokeWidth;
|
||||
SkPoint fPts[2];
|
||||
SkAutoTUnref<SkPathEffect> fPathEffect;
|
||||
|
||||
|
||||
public:
|
||||
enum LineType {
|
||||
kHori_LineType,
|
||||
@ -345,7 +345,7 @@ public:
|
||||
SkScalar cx = 640 / 2; // center X
|
||||
SkScalar cy = 480 / 2; // center Y
|
||||
SkMatrix matrix;
|
||||
|
||||
|
||||
switch (lt) {
|
||||
case kHori_LineType:
|
||||
matrix.setIdentity();
|
||||
@ -357,19 +357,19 @@ public:
|
||||
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);
|
||||
@ -379,7 +379,7 @@ protected:
|
||||
|
||||
canvas->drawPoints(SkCanvas::kLines_PointMode, 2, fPts, p);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
typedef SkBenchmark INHERITED;
|
||||
};
|
||||
|
@ -284,7 +284,7 @@ static bool intersect2(const Cubic& cubic1, double t1s, double t1e, const Cubic&
|
||||
cubic1, SkTMax(to1 - dt1, 0.), SkTMin(to1 + dt1, 1.), i);
|
||||
i.swap();
|
||||
--debugDepth;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
t2Start = t2;
|
||||
|
@ -162,7 +162,7 @@ int cubicRootsReal(double A, double B, double C, double D, double s[3]) {
|
||||
*roots++ = -u - adiv3;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
#endif
|
||||
if (R2MinusQ3 < 0) // we have 3 real roots
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ inline bool approximately_equal(double x, double y) {
|
||||
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;
|
||||
|
@ -21,7 +21,7 @@ and using the roots
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
int add_valid_ts(double s[], int realRoots, double* t) {
|
||||
int foundRoots = 0;
|
||||
for (int index = 0; index < realRoots; ++index) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
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]);
|
||||
|
@ -5,7 +5,7 @@
|
||||
'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
|
||||
|
@ -114,7 +114,7 @@ private:
|
||||
*/
|
||||
bool SK_WARN_UNUSED_RESULT
|
||||
computeConservativeLocalClipBounds(SkRect* bounds) const;
|
||||
|
||||
|
||||
public:
|
||||
const SkBitmap* fBitmap; // required
|
||||
const SkMatrix* fMatrix; // required
|
||||
|
@ -686,7 +686,7 @@ void SkDraw::drawPoints(SkCanvas::PointMode mode, size_t count,
|
||||
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
|
||||
|
@ -118,7 +118,7 @@ static bool cull_path(const SkPath& srcPath, const SkStrokeRec& rec,
|
||||
|
||||
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;
|
||||
@ -126,11 +126,11 @@ static bool cull_path(const SkPath& srcPath, const SkStrokeRec& rec,
|
||||
|
||||
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);
|
||||
}
|
||||
@ -147,14 +147,14 @@ static bool cull_path(const SkPath& srcPath, const SkStrokeRec& rec,
|
||||
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;
|
||||
@ -243,7 +243,7 @@ bool SkDashPathEffect::filterPath(SkPath* dst, const SkPath& src,
|
||||
if (cull_path(src, *rec, cullRect, fIntervalLength, &cullPathStorage)) {
|
||||
srcPtr = &cullPathStorage;
|
||||
}
|
||||
|
||||
|
||||
SpecialLineRec lineRec;
|
||||
bool specialLine = lineRec.init(src, dst, rec, fCount >> 1, fIntervalLength);
|
||||
|
||||
|
@ -45,7 +45,7 @@ static void TestSort(skiatest::Reporter* reporter) {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user