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:
skia.committer@gmail.com 2013-01-25 07:06:46 +00:00
parent e8625ac205
commit 4024f32d99
11 changed files with 21 additions and 21 deletions

View File

@ -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;
};

View File

@ -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;

View File

@ -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
{

View File

@ -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;

View File

@ -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) {

View File

@ -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]);

View File

@ -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

View File

@ -114,7 +114,7 @@ private:
*/
bool SK_WARN_UNUSED_RESULT
computeConservativeLocalClipBounds(SkRect* bounds) const;
public:
const SkBitmap* fBitmap; // required
const SkMatrix* fMatrix; // required

View File

@ -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

View File

@ -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);

View File

@ -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);