Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@7803 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/BlurRectBench.cpp b/bench/BlurRectBench.cpp
index cbb624c..8767dee 100644
--- a/bench/BlurRectBench.cpp
+++ b/bench/BlurRectBench.cpp
@@ -117,7 +117,7 @@
memset(fSrcMask.fImage, 0xff, fSrcMask.computeTotalImageSize());
}
-
+
SkMask fSrcMask;
private:
typedef BlurRectBench INHERITED;
diff --git a/experimental/Intersection/CubicIntersection_Test.cpp b/experimental/Intersection/CubicIntersection_Test.cpp
index 08bffd6..fe5679f 100644
--- a/experimental/Intersection/CubicIntersection_Test.cpp
+++ b/experimental/Intersection/CubicIntersection_Test.cpp
@@ -137,7 +137,7 @@
{{1,2},{5,6},{1,0},{1,0}},
{{0,1},{0,1},{2,1},{6,5}},
-{{0,6},{1,2},{1,0},{1,0}},
+{{0,6},{1,2},{1,0},{1,0}},
{{0,1},{0,1},{6,0},{2,1}},
{{0,2},{0,1},{3,0},{1,0}},
diff --git a/experimental/Intersection/DataTypes.h b/experimental/Intersection/DataTypes.h
index ae8d44d..8226f09 100644
--- a/experimental/Intersection/DataTypes.h
+++ b/experimental/Intersection/DataTypes.h
@@ -293,7 +293,7 @@
double lengthSquared() const {
return x * x + y * y;
}
-
+
double roughlyEqual(const _Point& a) const {
return roughly_equal(a.y, y) && roughly_equal(a.x, x);
}
diff --git a/experimental/Intersection/QuadraticImplicit.cpp b/experimental/Intersection/QuadraticImplicit.cpp
index 2aed06f..a13e39b 100644
--- a/experimental/Intersection/QuadraticImplicit.cpp
+++ b/experimental/Intersection/QuadraticImplicit.cpp
@@ -380,7 +380,7 @@
if (tStep < FLT_EPSILON_HALF) {
break;
}
- calcMask = (1 << 0) | (1 << 2) | (1 << 3) | (1 << 5);
+ calcMask = (1 << 0) | (1 << 2) | (1 << 3) | (1 << 5);
continue;
}
if (best_i == 0) {
@@ -498,7 +498,7 @@
continue;
}
SkASSERT(r1Count == 1 && r2Count == 1);
- SkDebugf("*** [%d,%d] (%1.9g,%1.9g) %s (%1.9g,%1.9g)\n", cu1, cu2,
+ SkDebugf("*** [%d,%d] (%1.9g,%1.9g) %s (%1.9g,%1.9g)\n", cu1, cu2,
pts1[0].x, pts1[0].y, pts1[0].approximatelyEqualHalf(pts2[0])
? "==" : "!=", pts2[0].x, pts2[0].y);
}
diff --git a/experimental/Intersection/Simplify.cpp b/experimental/Intersection/Simplify.cpp
index 70038e6..0db33fa 100644
--- a/experimental/Intersection/Simplify.cpp
+++ b/experimental/Intersection/Simplify.cpp
@@ -4165,7 +4165,7 @@
start, segment.xAtT(&sSpan), segment.yAtT(&sSpan), end,
segment.xAtT(&eSpan), segment.yAtT(&eSpan), angle.sign(),
mSpan.fWindValue);
- start here;
+ start here;
// create an inline to replace this conditional
if (mSpan.fWindSum == SK_MinS32) {
SkDebugf("?");
diff --git a/gm/blurrect.cpp b/gm/blurrect.cpp
index a6fc56d..056d89c 100644
--- a/gm/blurrect.cpp
+++ b/gm/blurrect.cpp
@@ -148,17 +148,17 @@
, fStyle(style)
{}
- int width() const {
- return fRectWidth;
+ int width() const {
+ return fRectWidth;
}
- int height() const {
- return fRectHeight;
+ int height() const {
+ return fRectHeight;
}
- SkScalar radius() const {
- return fRadius;
+ SkScalar radius() const {
+ return fRadius;
}
- SkBlurMask::Style style() const {
- return fStyle;
+ SkBlurMask::Style style() const {
+ return fStyle;
}
protected:
@@ -211,9 +211,9 @@
BlurRectFastGM(const char name[], unsigned int rect_width,
unsigned int rect_height, float blur_radius,
SkBlurMask::Style style) :
- INHERITED(name, rect_width, rect_height, blur_radius, style)
+ INHERITED(name, rect_width, rect_height, blur_radius, style)
{
-
+
}
protected:
virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
@@ -225,11 +225,11 @@
class BlurRectSlowGM: public BlurRectCompareGM {
public:
- BlurRectSlowGM(const char name[], unsigned int rect_width, unsigned int rect_height,
+ BlurRectSlowGM(const char name[], unsigned int rect_width, unsigned int rect_height,
float blur_radius, SkBlurMask::Style style) :
- INHERITED(name, rect_width, rect_height, blur_radius, style)
+ INHERITED(name, rect_width, rect_height, blur_radius, style)
{
-
+
}
protected:
virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
@@ -255,11 +255,11 @@
class BlurRectSlowLowGM: public BlurRectSlowGM {
public:
- BlurRectSlowLowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
+ BlurRectSlowLowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
float blurRadius, SkBlurMask::Style style) :
- INHERITED(name, rectWidth, rectHeight, blurRadius, style)
+ INHERITED(name, rectWidth, rectHeight, blurRadius, style)
{
-
+
}
protected:
virtual SkBlurMask::Quality getQuality() SK_OVERRIDE {
@@ -271,11 +271,11 @@
class BlurRectGroundTruthGM: public BlurRectCompareGM {
public:
- BlurRectGroundTruthGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
+ BlurRectGroundTruthGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
float blurRadius, SkBlurMask::Style style) :
INHERITED(name, rectWidth, rectHeight, blurRadius, style)
{
-
+
}
protected:
virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp
index d618453..413e8c0 100644
--- a/src/effects/SkBlurMask.cpp
+++ b/src/effects/SkBlurMask.cpp
@@ -966,12 +966,12 @@
if (radius < SkIntToScalar(3)) {
quality = kLow_Quality;
}
-
- // highQuality: use three box blur passes as a cheap way
+
+ // highQuality: use three box blur passes as a cheap way
// to approximate a Gaussian blur
int passCount = (kHigh_Quality == quality) ? 3 : 1;
- SkScalar passRadius = (kHigh_Quality == quality) ?
- SkScalarMul( radius, kBlurRadiusFudgeFactor):
+ SkScalar passRadius = (kHigh_Quality == quality) ?
+ SkScalarMul( radius, kBlurRadiusFudgeFactor):
radius;
int rx = SkScalarCeil(passRadius);
@@ -987,13 +987,13 @@
int padx = passCount * rx;
int pady = passCount * ry;
-
+
if (margin) {
margin->set(padx, pady);
}
dst->fBounds.set(src.fBounds.fLeft - padx, src.fBounds.fTop - pady,
src.fBounds.fRight + padx, src.fBounds.fBottom + pady);
-
+
dst->fRowBytes = dst->fBounds.width();
dst->fFormat = SkMask::kA8_Format;
dst->fImage = NULL;
@@ -1015,7 +1015,7 @@
SkAutoTMalloc<uint8_t> tmpBuffer(dstSize);
uint8_t* tp = tmpBuffer.get();
int w = sw, h = sh;
-
+
if (outerWeight == 255) {
int loRadius, hiRadius;
get_adjusted_radii(passRadius, &loRadius, &hiRadius);
@@ -1137,9 +1137,9 @@
3/4 - x^2 -.5 < x <= .5
9/8 - 3/2 x + 1/2 x^2 0.5 < x <= 1.5
0 1.5 < x
-
+
Mathematica:
-
+
g[x_] := Piecewise [ {
{9/8 + 3/2 x + 1/2 x^2 , -1.5 < x <= -.5},
{3/4 - x^2 , -.5 < x <= .5},
@@ -1154,9 +1154,9 @@
1/2 + 3/4 x - 1/3 x^3 -.5 < x <= .5
7/16 + 9/8 x - 3/4 x^2 + 1/6 x^3 .5 < x <= 1.5
1 1.5 < x
-
+
in Mathematica code:
-
+
gi[x_] := Piecewise[ {
{ 0 , x <= -1.5 },
{ 9/16 + 9/8 x + 3/4 x^2 + 1/6 x^3, -1.5 < x <= -0.5 },
@@ -1230,7 +1230,7 @@
if (ox < 0) {
ox = 0;
}
-
+
return profile[ox];
}
@@ -1241,30 +1241,30 @@
unsigned int *profile;
float radius = SkScalarToFloat( SkScalarMul( provided_radius, kBlurRadiusFudgeFactor ) );
-
+
// adjust blur radius to match interpretation from boxfilter code
radius = (radius + .5f) *2.f;
profile_size = compute_profile( radius, &profile );
-
+
SkAutoTDeleteArray<unsigned int> ada(profile);
int pad = profile_size/2;
if (margin) {
margin->set( pad, pad );
}
-
+
int shadow_left = -pad;
int shadow_top = -pad;
int shadow_right = (int)(src.width()) + pad;
int shadow_bottom = (int)(src.height()) + pad;
-
+
dst->fBounds.set(shadow_left, shadow_top, shadow_right, shadow_bottom);
dst->fRowBytes = dst->fBounds.width();
dst->fFormat = SkMask::kA8_Format;
dst->fImage = NULL;
-
+
size_t dstSize = dst->computeImageSize();
if (0 == dstSize) {
return false; // too big to allocate, abort
@@ -1288,7 +1288,7 @@
int h = sh - center;
uint8_t *outptr = dp;
-
+
SkAutoTMalloc<uint8_t> horizontalScanline(dstWidth);
for (int x = 0 ; x < dstWidth ; ++x) {
@@ -1300,7 +1300,7 @@
horizontalScanline[x] = (uint8_t) (255 * (gaussianIntegral(giX) - gaussianIntegral(giX + span)));
}
}
-
+
for (int y = 0 ; y < dstHeight ; ++y) {
unsigned int profile_y;
if (profile_size <= sh) {
@@ -1316,7 +1316,7 @@
*(outptr++) = maskval;
}
}
-
+
if (style == kInner_Style) {
// now we allocate the "real" dst, mirror the size of src
size_t srcSize = (size_t)(src.width() * src.height());
@@ -1333,7 +1333,7 @@
dst->fBounds.set(0, 0, sw, sh); // restore trimmed bounds
dst->fRowBytes = sw;
-
+
} else if (style == kOuter_Style) {
for (int y = pad ; y < dstHeight-pad ; y++) {
uint8_t *dst_scanline = dp + y*dstWidth + pad;
@@ -1350,9 +1350,9 @@
// gaussian kernel. It's "ground truth" in a sense; too slow to be used, but very
// useful for correctness comparisons.
-bool SkBlurMask::BlurGroundTruth(SkMask* dst, const SkMask& src, SkScalar provided_radius,
+bool SkBlurMask::BlurGroundTruth(SkMask* dst, const SkMask& src, SkScalar provided_radius,
Style style, SkIPoint* margin) {
-
+
if (src.fFormat != SkMask::kA8_Format) {
return false;
}
@@ -1368,9 +1368,9 @@
SkAutoTMalloc<float> gaussWindow(windowSize);
int halfWindow = windowSize >> 1;
-
+
gaussWindow[halfWindow] = 1;
-
+
float windowSum = 1;
for (int x = 1 ; x <= halfWindow ; ++x) {
float gaussian = expf(-x*x / variance);
@@ -1380,7 +1380,7 @@
// leave the filter un-normalized for now; we will divide by the normalization
// sum later;
-
+
int pad = halfWindow;
if (margin) {
margin->set( pad, pad );
@@ -1399,39 +1399,39 @@
if (0 == dstSize) {
return false; // too big to allocate, abort
}
-
+
int srcWidth = src.fBounds.width();
int srcHeight = src.fBounds.height();
int dstWidth = dst->fBounds.width();
-
+
const uint8_t* srcPixels = src.fImage;
uint8_t* dstPixels = SkMask::AllocImage(dstSize);
SkAutoTCallVProc<uint8_t, SkMask_FreeImage> autoCall(dstPixels);
// do the actual blur. First, make a padded copy of the source.
// use double pad so we never have to check if we're outside anything
-
+
int padWidth = srcWidth + 4*pad;
int padHeight = srcHeight;
int padSize = padWidth * padHeight;
-
+
SkAutoTMalloc<uint8_t> padPixels(padSize);
memset(padPixels, 0, padSize);
-
+
for (int y = 0 ; y < srcHeight; ++y) {
uint8_t* padptr = padPixels + y * padWidth + 2*pad;
const uint8_t* srcptr = srcPixels + y * srcWidth;
memcpy(padptr, srcptr, srcWidth);
}
-
+
// blur in X, transposing the result into a temporary floating point buffer.
// also double-pad the intermediate result so that the second blur doesn't
// have to do extra conditionals.
-
+
int tmpWidth = padHeight + 4*pad;
int tmpHeight = padWidth - 2*pad;
int tmpSize = tmpWidth * tmpHeight;
-
+
SkAutoTMalloc<float> tmpImage(tmpSize);
memset(tmpImage, 0, tmpSize*sizeof(tmpImage[0]));
@@ -1444,13 +1444,13 @@
*outPixel += gaussWindow[pad+i]*windowCenter[i];
}
*outPixel /= windowSum;
- }
+ }
}
-
+
// blur in Y; now filling in the actual desired destination. We have to do
- // the transpose again; these transposes guarantee that we read memory in
+ // the transpose again; these transposes guarantee that we read memory in
// linear order.
-
+
for (int y = 0 ; y < tmpHeight ; ++y) {
float *srcScanline = tmpImage + y*tmpWidth;
for (int x = pad ; x < tmpWidth - pad ; ++x) {
@@ -1465,7 +1465,7 @@
*outPixel = SkClampMax( SkClampPos(integerPixel), 255 );
}
}
-
+
dst->fImage = dstPixels;
// if need be, alloc the "real" dst (same size as src) and copy/merge
// the blur into it (applying the src)
diff --git a/src/effects/SkBlurMask.h b/src/effects/SkBlurMask.h
index 51ec8f8..5179b4b 100644
--- a/src/effects/SkBlurMask.h
+++ b/src/effects/SkBlurMask.h
@@ -37,13 +37,13 @@
static bool BlurSeparable(SkMask* dst, const SkMask& src,
SkScalar radius, Style style, Quality quality,
SkIPoint* margin = NULL);
-
+
// the "ground truth" blur does a gaussian convolution; it's slow
// but useful for comparison purposes.
- static bool BlurGroundTruth(SkMask* dst, const SkMask& src,
- SkScalar provided_radius, Style style,
+ static bool BlurGroundTruth(SkMask* dst, const SkMask& src,
+ SkScalar provided_radius, Style style,
SkIPoint* margin = NULL);
private: