Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part II of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6474054
git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/utils/SkBase64.cpp b/src/utils/SkBase64.cpp
index a8d4e87..8e1f223 100644
--- a/src/utils/SkBase64.cpp
+++ b/src/utils/SkBase64.cpp
@@ -12,7 +12,7 @@
#define DecodePad -2
#define EncodePad 64
-static const char default_encode[] =
+static const char default_encode[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/=";
@@ -55,7 +55,7 @@
signed char decoded = decodeData[srcByte - '+'];
bytes[byte] = decoded;
if (decoded < 0) {
- if (decoded == DecodePad)
+ if (decoded == DecodePad)
goto handlePad;
return kBadCharError;
} else
@@ -89,7 +89,7 @@
*dst = (unsigned char) one;
}
dst++;
- if (padTwo)
+ if (padTwo)
break;
if (writeDestination)
*dst = (unsigned char) two;
@@ -105,7 +105,7 @@
return kNoError;
}
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32 && _MSC_VER >= 1300
#pragma warning ( pop )
#endif
@@ -126,7 +126,7 @@
unsigned b = *src++;
unsigned c = *src++;
int d = c & 0x3F;
- c = (c >> 6 | b << 2) & 0x3F;
+ c = (c >> 6 | b << 2) & 0x3F;
b = (b >> 4 | a << 4) & 0x3F;
a = a >> 2;
*dst++ = encode[a];
diff --git a/src/utils/SkBoundaryPatch.cpp b/src/utils/SkBoundaryPatch.cpp
index c305c8b..afc76b5 100644
--- a/src/utils/SkBoundaryPatch.cpp
+++ b/src/utils/SkBoundaryPatch.cpp
@@ -50,7 +50,7 @@
const SkScalar invR = SkScalarInvert(SkIntToScalar(rows - 1));
const SkScalar invC = SkScalarInvert(SkIntToScalar(cols - 1));
-
+
for (int y = 0; y < cols; y++) {
SkScalar yy = y * invC;
for (int x = 0; x < rows; x++) {
diff --git a/src/utils/SkCamera.cpp b/src/utils/SkCamera.cpp
index ac6fa0f..7d6963c 100644
--- a/src/utils/SkCamera.cpp
+++ b/src/utils/SkCamera.cpp
@@ -369,7 +369,7 @@
fCamera.fLocation.set(x * SkFloatToScalar(72.0f), y * SkFloatToScalar(72.0f), lz);
fCamera.fObserver.set(0, 0, lz);
fCamera.update();
-
+
}
SkScalar Sk3DView::getCameraLocationX() {
@@ -419,7 +419,7 @@
void Sk3DView::applyToCanvas(SkCanvas* canvas) const {
SkMatrix matrix;
-
+
this->getMatrix(&matrix);
canvas->concat(matrix);
}
diff --git a/src/utils/SkCubicInterval.cpp b/src/utils/SkCubicInterval.cpp
index 6c6b0a9..904f26b 100644
--- a/src/utils/SkCubicInterval.cpp
+++ b/src/utils/SkCubicInterval.cpp
@@ -59,7 +59,7 @@
// now search for t given unitX
SkScalar t = find_cubic_t(x1, x2 - 2*x1, x1 - x2 + SK_Scalar1, unitX);
-
+
// now evaluate the cubic in Y
y1 *= 3;
y2 *= 3;
diff --git a/src/utils/SkCullPoints.cpp b/src/utils/SkCullPoints.cpp
index 3e3082f..e76679d 100644
--- a/src/utils/SkCullPoints.cpp
+++ b/src/utils/SkCullPoints.cpp
@@ -15,7 +15,7 @@
return v.fX * dy - v.fY * dx < 0;
#else
Sk64 tmp0, tmp1;
-
+
tmp0.setMul(v.fX, dy);
tmp1.setMul(dx, v.fY);
tmp0.sub(tmp1);
@@ -33,7 +33,7 @@
return false;
}
- // since the crossprod test is a little expensive, check for easy-in cases first
+ // since the crossprod test is a little expensive, check for easy-in cases first
if (r.contains(x0, y0) || r.contains(x1, y1)) {
return true;
}
@@ -41,7 +41,7 @@
// At this point we're not sure, so we do a crossprod test
SkIPoint vec;
const SkIPoint* rAsQuad = fAsQuad;
-
+
vec.set(x1 - x0, y1 - y0);
bool isNeg = cross_product_is_neg(vec, x0 - rAsQuad[0].fX, y0 - rAsQuad[0].fY);
for (int i = 1; i < 4; i++) {
@@ -89,14 +89,14 @@
LineToResult result = kNo_Result;
int x0 = fPrevPt.fX;
int y0 = fPrevPt.fY;
-
+
// need to upgrade sect_test to chop the result
// and to correctly return kLineTo_Result when the result is connected
// to the previous call-out
if (this->sect_test(x0, y0, x, y)) {
line[0].set(x0, y0);
line[1].set(x, y);
-
+
if (fPrevResult != kNo_Result && fPrevPt.equals(x0, y0)) {
result = kLineTo_Result;
} else {
@@ -133,7 +133,7 @@
void SkCullPointsPath::lineTo(int x, int y) {
SkIPoint pts[2];
-
+
switch (fCP.lineTo(x, y, pts)) {
case SkCullPoints::kMoveToLineTo_Result:
fPath->moveTo(SkIntToScalar(pts[0].fX), SkIntToScalar(pts[0].fY));
@@ -184,7 +184,7 @@
if (hires) {
const SkScalar coordLimit = SkIntToScalar(16384);
const SkRect limit = { 0, 0, coordLimit, coordLimit };
-
+
SkMatrix matrix;
matrix.setRectToRect(bounds, limit, SkMatrix::kFill_ScaleToFit);
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 661e017..81ebcbd 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -35,7 +35,7 @@
// code may need to be revised if that assumption is ever broken.
if (shader && !shader->asAGradient(NULL)) {
SkBitmap bm;
- if (shader->asABitmap(&bm, NULL, NULL) &&
+ if (shader->asABitmap(&bm, NULL, NULL) &&
NULL != bm.getTexture()) {
return true;
}
@@ -47,7 +47,7 @@
class AutoImmediateDrawIfNeeded {
public:
- AutoImmediateDrawIfNeeded(SkDeferredCanvas& canvas, const SkBitmap* bitmap,
+ AutoImmediateDrawIfNeeded(SkDeferredCanvas& canvas, const SkBitmap* bitmap,
const SkPaint* paint) {
this->init(canvas, bitmap, paint);
}
@@ -77,7 +77,7 @@
namespace {
-bool isPaintOpaque(const SkPaint* paint,
+bool isPaintOpaque(const SkPaint* paint,
const SkBitmap* bmpReplacesShader = NULL) {
// TODO: SkXfermode should have a virtual isOpaque method, which would
// make it possible to test modes that do not have a Coeff representation.
@@ -102,7 +102,7 @@
} else if (paint->getShader() && !paint->getShader()->isOpaque()) {
break;
}
- if (paint->getColorFilter() &&
+ if (paint->getColorFilter() &&
((paint->getColorFilter()->getFlags() &
SkColorFilter::kAlphaUnchanged_Flag) == 0)) {
break;
@@ -112,7 +112,7 @@
if (paint->getAlpha() != 0) {
break;
}
- if (paint->getColorFilter() &&
+ if (paint->getColorFilter() &&
((paint->getColorFilter()->getFlags() &
SkColorFilter::kAlphaUnchanged_Flag) == 0)) {
break;
@@ -203,7 +203,7 @@
}
void DeferredPipeController::playback() {
-
+
for (int currentBlock = 0; currentBlock < fBlockList.count(); currentBlock++ ) {
fReader.playback(fBlockList[currentBlock].fBlock, fBlockList[currentBlock].fSize);
}
@@ -376,10 +376,10 @@
void DeferredDevice::beginRecording() {
SkASSERT(NULL == fRecordingCanvas);
- fRecordingCanvas = fPipeWriter.startRecording(&fPipeController, 0,
+ fRecordingCanvas = fPipeWriter.startRecording(&fPipeController, 0,
fImmediateDevice->width(), fImmediateDevice->height());
}
-
+
void DeferredDevice::setNotificationClient(
SkDeferredCanvas::NotificationClient* notificationClient) {
fNotificationClient = notificationClient;
@@ -409,7 +409,7 @@
// Restore pre-purge state
if (!clipRegion.isEmpty()) {
- fRecordingCanvas->clipRegion(clipRegion,
+ fRecordingCanvas->clipRegion(clipRegion,
SkRegion::kReplace_Op);
}
if (!matrix.isIdentity()) {
@@ -475,7 +475,7 @@
storageAllocated = this->storageAllocatedForRecording();
}
- if (fNotificationClient &&
+ if (fNotificationClient &&
storageAllocated != fPreviousStorageAllocated) {
fPreviousStorageAllocated = storageAllocated;
fNotificationClient->storageAllocatedForRecordingChanged(storageAllocated);
@@ -486,16 +486,16 @@
return fRecordingCanvas;
}
-uint32_t DeferredDevice::getDeviceCapabilities() {
+uint32_t DeferredDevice::getDeviceCapabilities() {
return fImmediateDevice->getDeviceCapabilities();
}
-int DeferredDevice::width() const {
+int DeferredDevice::width() const {
return fImmediateDevice->width();
}
int DeferredDevice::height() const {
- return fImmediateDevice->height();
+ return fImmediateDevice->height();
}
SkGpuRenderTarget* DeferredDevice::accessRenderTarget() {
@@ -661,7 +661,7 @@
if (paint) {
SkPaint::Style paintStyle = paint->getStyle();
- if (!(paintStyle == SkPaint::kFill_Style ||
+ if (!(paintStyle == SkPaint::kFill_Style ||
paintStyle == SkPaint::kStrokeAndFill_Style)) {
return false;
}
@@ -673,8 +673,8 @@
// The following test holds with AA enabled, and is conservative
// by a 0.5 pixel margin with AA disabled
- if (transformedRect.fLeft > SkIntToScalar(0) ||
- transformedRect.fTop > SkIntToScalar(0) ||
+ if (transformedRect.fLeft > SkIntToScalar(0) ||
+ transformedRect.fTop > SkIntToScalar(0) ||
transformedRect.fRight < SkIntToScalar(canvasSize.fWidth) ||
transformedRect.fBottom < SkIntToScalar(canvasSize.fHeight)) {
return false;
@@ -686,8 +686,8 @@
{
SkIRect bounds;
canvas->getClipDeviceBounds(&bounds);
- if (bounds.fLeft > 0 || bounds.fTop > 0 ||
- bounds.fRight < canvasSize.fWidth ||
+ if (bounds.fLeft > 0 || bounds.fTop > 0 ||
+ bounds.fRight < canvasSize.fWidth ||
bounds.fBottom < canvasSize.fHeight)
return false;
}
@@ -808,7 +808,7 @@
}
void SkDeferredCanvas::drawPaint(const SkPaint& paint) {
- if (fDeferredDrawing && this->isFullFrame(NULL, &paint) &&
+ if (fDeferredDrawing && this->isFullFrame(NULL, &paint) &&
isPaintOpaque(&paint)) {
this->getDeferredDevice()->contentsCleared();
}
@@ -825,7 +825,7 @@
}
void SkDeferredCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
- if (fDeferredDrawing && this->isFullFrame(&rect, &paint) &&
+ if (fDeferredDrawing && this->isFullFrame(&rect, &paint) &&
isPaintOpaque(&paint)) {
this->getDeferredDevice()->contentsCleared();
}
@@ -845,7 +845,7 @@
SkScalar top, const SkPaint* paint) {
SkRect bitmapRect = SkRect::MakeXYWH(left, top,
SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()));
- if (fDeferredDrawing &&
+ if (fDeferredDrawing &&
this->isFullFrame(&bitmapRect, paint) &&
isPaintOpaque(paint, &bitmap)) {
this->getDeferredDevice()->contentsCleared();
@@ -856,11 +856,11 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawBitmapRect(const SkBitmap& bitmap,
+void SkDeferredCanvas::drawBitmapRect(const SkBitmap& bitmap,
const SkIRect* src,
const SkRect& dst,
const SkPaint* paint) {
- if (fDeferredDrawing &&
+ if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
isPaintOpaque(paint, &bitmap)) {
this->getDeferredDevice()->contentsCleared();
@@ -896,10 +896,10 @@
const SkPaint* paint) {
SkRect bitmapRect = SkRect::MakeXYWH(
SkIntToScalar(left),
- SkIntToScalar(top),
+ SkIntToScalar(top),
SkIntToScalar(bitmap.width()),
SkIntToScalar(bitmap.height()));
- if (fDeferredDrawing &&
+ if (fDeferredDrawing &&
this->isFullFrame(&bitmapRect, paint) &&
isPaintOpaque(paint, &bitmap)) {
this->getDeferredDevice()->contentsCleared();
@@ -966,10 +966,10 @@
}
SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
- this->drawingCanvas()->setDrawFilter(filter);
+ this->drawingCanvas()->setDrawFilter(filter);
this->INHERITED::setDrawFilter(filter);
this->recordedDrawCommand();
- return filter;
+ return filter;
}
SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
diff --git a/src/utils/SkInterpolator.cpp b/src/utils/SkInterpolator.cpp
index d43792f..2ef2702 100644
--- a/src/utils/SkInterpolator.cpp
+++ b/src/utils/SkInterpolator.cpp
@@ -165,7 +165,7 @@
bool SkInterpolator::setKeyFrame(int index, SkMSec time,
const SkScalar values[], const SkScalar blend[4]) {
SkASSERT(values != NULL);
-
+
if (blend == NULL) {
blend = gIdentityBlend;
}
@@ -237,13 +237,13 @@
SkScalar cx, SkScalar cy) {
// pin to the unit-square, and convert to 2.14
Dot14 x = pin_and_convert(value);
-
+
if (x == 0) return 0;
if (x == Dot14_ONE) return SK_Scalar1;
-
+
Dot14 b = pin_and_convert(bx);
Dot14 c = pin_and_convert(cx);
-
+
// Now compute our coefficients from the control points
// t -> 3b
// t^2 -> 3c - 6b
@@ -264,7 +264,7 @@
t += dt;
}
}
-
+
// Now we have t, so compute the coeff for Y and evaluate
b = pin_and_convert(by);
c = pin_and_convert(cy);
diff --git a/src/utils/SkJSON.cpp b/src/utils/SkJSON.cpp
index c55d464..06989f3 100644
--- a/src/utils/SkJSON.cpp
+++ b/src/utils/SkJSON.cpp
@@ -56,7 +56,7 @@
SkASSERT(name);
fNext = NULL;
-
+
size_t len = strlen(name);
// extra 1 for str[0] which stores the type
char* str = alloc_string(1 + len);
@@ -64,14 +64,14 @@
// str[1] skips the type, len+1 includes the terminating 0 byte.
memcpy(&str[1], name, len + 1);
fName = str;
-
+
// fValue is uninitialized
}
~Slot();
-
+
Type type() const { return (Type)fName[0]; }
const char* name() const { return &fName[1]; }
-
+
Slot* fNext;
char* fName; // fName[0] is the type, &fName[1] is the "name"
union {
@@ -378,7 +378,7 @@
void SkJSON::Object::dumpLevel(int level) const {
for (Slot* slot = fHead; slot; slot = slot->fNext) {
- Type t = slot->type();
+ Type t = slot->type();
tabForLevel(level + 1);
SkDebugf("\"%s\" : ", slot->name());
switch (slot->type()) {
@@ -507,11 +507,11 @@
};
typedef void* (*DupProc)(const void*);
-
+
static void* dup_object(const void* src) {
return SkNEW_ARGS(SkJSON::Object, (*(SkJSON::Object*)src));
}
-
+
static void* dup_array(const void* src) {
return SkNEW_ARGS(SkJSON::Array, (*(SkJSON::Array*)src));
}
@@ -561,7 +561,7 @@
SkJSON::Array::Array(const int32_t values[], int count) {
this->init(kInt, count, values);
}
-
+
SkJSON::Array::Array(const float values[], int count) {
this->init(kFloat, count, values);
}
diff --git a/src/utils/SkMeshUtils.cpp b/src/utils/SkMeshUtils.cpp
index f7af383..7970ba1 100644
--- a/src/utils/SkMeshUtils.cpp
+++ b/src/utils/SkMeshUtils.cpp
@@ -55,11 +55,11 @@
*idx++ = index;
*idx++ = index + rows + 1;
*idx++ = index + 1;
-
+
*idx++ = index + 1;
*idx++ = index + rows + 1;
*idx++ = index + rows + 2;
-
+
index += 1;
}
index += 1;
@@ -89,7 +89,7 @@
int rows, int cols, const SkPoint verts[],
const SkColor colors[], const SkPaint& paint) {
SkMeshIndices idx;
-
+
if (idx.init(bitmap.width(), bitmap.height(), rows, cols)) {
SkPaint p(paint);
p.setShader(SkShader::CreateBitmapShader(bitmap,
diff --git a/src/utils/SkNinePatch.cpp b/src/utils/SkNinePatch.cpp
index 26ae8eb..9dc8bd2 100644
--- a/src/utils/SkNinePatch.cpp
+++ b/src/utils/SkNinePatch.cpp
@@ -15,11 +15,11 @@
0, 5, 1, 0, 4, 5,
1, 6, 2, 1, 5, 6,
2, 7, 3, 2, 6, 7,
-
+
4, 9, 5, 4, 8, 9,
5, 10, 6, 5, 9, 10,
6, 11, 7, 6, 10, 11,
-
+
8, 13, 9, 8, 12, 13,
9, 14, 10, 9, 13, 14,
10, 15, 11, 10, 14, 15
@@ -27,18 +27,18 @@
static int fillIndices(uint16_t indices[], int xCount, int yCount) {
uint16_t* startIndices = indices;
-
+
int n = 0;
for (int y = 0; y < yCount; y++) {
for (int x = 0; x < xCount; x++) {
*indices++ = n;
*indices++ = n + xCount + 2;
*indices++ = n + 1;
-
+
*indices++ = n;
*indices++ = n + xCount + 1;
*indices++ = n + xCount + 2;
-
+
n += 1;
}
n += 1;
@@ -108,14 +108,14 @@
if (bounds.isEmpty() || bitmap.width() == 0 || bitmap.height() == 0) {
return;
}
-
+
// should try a quick-reject test before calling lockPixels
SkAutoLockPixels alp(bitmap);
// after the lock, it is valid to check
if (!bitmap.readyToDraw()) {
return;
}
-
+
// check for degenerate divs (just an optimization, not required)
{
int i;
@@ -129,17 +129,17 @@
numYDivs -= 1;
}
}
-
+
Mesh mesh;
-
+
const int numXStretch = (numXDivs + 1) >> 1;
const int numYStretch = (numYDivs + 1) >> 1;
-
+
if (numXStretch < 1 && numYStretch < 1) {
canvas->drawBitmapRect(bitmap, NULL, bounds, paint);
return;
}
-
+
if (false) {
int i;
for (i = 0; i < numXDivs; i++) {
@@ -149,9 +149,9 @@
SkDebugf("--- ydivs[%d] %d\n", i, yDivs[i]);
}
}
-
+
SkScalar stretchX = 0, stretchY = 0;
-
+
if (numXStretch > 0) {
int stretchSize = 0;
for (int i = 1; i < numXDivs; i += 2) {
@@ -163,7 +163,7 @@
else // reuse stretchX, but keep it negative as a signal
stretchX = SkScalarDiv(-bounds.width(), fixed);
}
-
+
if (numYStretch > 0) {
int stretchSize = 0;
for (int i = 1; i < numYDivs; i += 2) {
@@ -175,7 +175,7 @@
else // reuse stretchX, but keep it negative as a signal
stretchY = SkScalarDiv(-bounds.height(), fixed);
}
-
+
#if 0
SkDebugf("---- drawasamesh [%d %d] -> [%g %g] <%d %d> (%g %g)\n",
bitmap.width(), bitmap.height(),
@@ -193,12 +193,12 @@
SkPoint* verts = (SkPoint*)storage.get();
SkPoint* texs = verts + vCount;
uint16_t* indices = (uint16_t*)(texs + vCount);
-
+
mesh.fVerts = verts;
mesh.fTexs = texs;
mesh.fColors = NULL;
mesh.fIndices = NULL;
-
+
// we use <= for YDivs, since the prebuild indices work for 3x2 and 3x1 too
if (numXDivs == 2 && numYDivs <= 2) {
mesh.fIndices = g3x3Indices;
@@ -207,7 +207,7 @@
SkASSERT(n == indexCount);
mesh.fIndices = indices;
}
-
+
SkScalar vy = bounds.fTop;
fillRow(verts, texs, vy, 0, bounds, xDivs, numXDivs,
stretchX, bitmap.width());
@@ -235,7 +235,7 @@
}
fillRow(verts, texs, bounds.fBottom, SkIntToScalar(bitmap.height()),
bounds, xDivs, numXDivs, stretchX, bitmap.width());
-
+
SkShader* shader = SkShader::CreateBitmapShader(bitmap,
SkShader::kClamp_TileMode,
SkShader::kClamp_TileMode);
@@ -310,7 +310,7 @@
if (false /* is our canvas backed by a gpu?*/) {
int32_t xDivs[2];
int32_t yDivs[2];
-
+
xDivs[0] = margins.fLeft;
xDivs[1] = bitmap.width() - margins.fRight;
yDivs[0] = margins.fTop;
@@ -326,7 +326,7 @@
(margins.fTop + margins.fBottom);
yDivs[1] = yDivs[0];
}
-
+
SkNinePatch::DrawMesh(canvas, bounds, bitmap,
xDivs, 2, yDivs, 2, paint);
} else {
diff --git a/src/utils/SkParse.cpp b/src/utils/SkParse.cpp
index cb265c3..9609ddc 100644
--- a/src/utils/SkParse.cpp
+++ b/src/utils/SkParse.cpp
@@ -62,7 +62,7 @@
return str;
}
-int SkParse::Count(const char str[])
+int SkParse::Count(const char str[])
{
char c;
int count = 0;
@@ -83,7 +83,7 @@
return count;
}
-int SkParse::Count(const char str[], char separator)
+int SkParse::Count(const char str[], char separator)
{
char c;
int count = 0;
@@ -234,7 +234,7 @@
if (*str == '.')
{
- static const int gFractions[] = { (1 << 24) / 10, (1 << 24) / 100, (1 << 24) / 1000,
+ static const int gFractions[] = { (1 << 24) / 10, (1 << 24) / 100, (1 << 24) / 1000,
(1 << 24) / 10000, (1 << 24) / 100000 };
str += 1;
int d = 0;
@@ -330,7 +330,7 @@
}
#ifdef SK_SUPPORT_UNITTEST
-void SkParse::UnitTest()
+void SkParse::UnitTest()
{
// !!! additional parse tests go here
SkParse::TestColor();
diff --git a/src/utils/SkParsePath.cpp b/src/utils/SkParsePath.cpp
index 22433e6..18ea5e0 100644
--- a/src/utils/SkParsePath.cpp
+++ b/src/utils/SkParsePath.cpp
@@ -58,7 +58,7 @@
return str;
}
-static const char* find_scalar(const char str[], SkScalar* value,
+static const char* find_scalar(const char str[], SkScalar* value,
bool isRelative, SkScalar relative) {
str = SkParse::FindScalar(str, value);
if (isRelative) {
@@ -103,7 +103,7 @@
op = 'L';
c = points[0];
break;
- case 'L':
+ case 'L':
data = find_points(data, points, 1, relative, &c);
path.lineTo(points[0]);
c = points[0];
@@ -120,10 +120,10 @@
path.lineTo(c.fX, y);
c.fY = y;
} break;
- case 'C':
+ case 'C':
data = find_points(data, points, 3, relative, &c);
goto cubicCommon;
- case 'S':
+ case 'S':
data = find_points(data, &points[1], 2, relative, &c);
points[0] = c;
if (previousOp == 'C' || previousOp == 'S') {
@@ -191,7 +191,7 @@
#ifdef SK_SCALAR_IS_FLOAT
char buffer[64];
#ifdef SK_BUILD_FOR_WIN32
- int len = _snprintf(buffer, sizeof(buffer), "%g", value);
+ int len = _snprintf(buffer, sizeof(buffer), "%g", value);
#else
int len = snprintf(buffer, sizeof(buffer), "%g", value);
#endif
diff --git a/src/utils/SkThreadUtils.h b/src/utils/SkThreadUtils.h
index b0c5044..8963981 100644
--- a/src/utils/SkThreadUtils.h
+++ b/src/utils/SkThreadUtils.h
@@ -13,32 +13,32 @@
class SkThread : SkNoncopyable {
public:
typedef void (*entryPointProc)(void*);
-
+
SkThread(entryPointProc entryPoint, void* data = NULL);
-
+
/**
* Non-virtual, do not subclass.
*/
~SkThread();
-
+
/**
* Starts the thread. Returns false if the thread could not be started.
*/
bool start();
-
+
/**
* Waits for the thread to finish.
* If the thread has not started, returns immediately.
*/
void join();
-
+
/**
* SkThreads with an affinity for the same processor will attempt to run cache
* locally with each other. SkThreads with an affinity for different processors
* will attempt to run on different cores. Returns false if the request failed.
*/
bool setProcessorAffinity(unsigned int processor);
-
+
private:
void* fData;
};
diff --git a/src/utils/mac/SkBitmap_Mac.cpp b/src/utils/mac/SkBitmap_Mac.cpp
index a995131..1f73f0f 100644
--- a/src/utils/mac/SkBitmap_Mac.cpp
+++ b/src/utils/mac/SkBitmap_Mac.cpp
@@ -20,7 +20,7 @@
static void convertGL32_to_Mac32(uint32_t dst[], const SkBitmap& bm) {
memcpy(dst, bm.getPixels(), bm.getSize());
return;
-
+
uint32_t* stop = dst + (bm.getSize() >> 2);
const uint8_t* src = (const uint8_t*)bm.getPixels();
while (dst < stop) {
@@ -38,7 +38,7 @@
unsigned r = SkPacked16ToR32(c);
unsigned g = SkPacked16ToG32(c);
unsigned b = SkPacked16ToB32(c);
-
+
*dst++ = (b << 24) | (g << 16) | (r << 8) | 0xFF;
}
}
@@ -47,11 +47,11 @@
static void convert4444_to_555(uint16_t dst[], const uint16_t src[], int count)
{
const uint16_t* stop = src + count;
-
+
while (src < stop)
{
unsigned c = *src++;
-
+
unsigned r = SkGetPackedR4444(c);
unsigned g = SkGetPackedG4444(c);
unsigned b = SkGetPackedB4444(c);
@@ -61,7 +61,7 @@
b = (b << 1) | (b >> 3);
// build the 555
c = (r << 10) | (g << 5) | b;
-
+
#ifdef SWAP_16BIT
c = (c >> 8) | (c << 8);
#endif
@@ -111,10 +111,10 @@
}
void SkBitmap::drawToPort(WindowRef wind, CGContextRef cg) const {
- if (fPixels == NULL || fWidth == 0 || fHeight == 0) {
- return;
+ if (fPixels == NULL || fWidth == 0 || fHeight == 0) {
+ return;
}
-
+
bool useQD = false;
if (NULL == cg) {
SetPortWindowPort(wind);
@@ -136,7 +136,7 @@
rect.origin.x = rect.origin.y = 0;
rect.size.width = bm.width();
rect.size.height = bm.height();
-
+
CGContextDrawImage(cg, rect, image);
CGImageRelease(image);
}
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index e5f7c69..df20ba9 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -18,14 +18,14 @@
(SK_A32_SHIFT == (a) && SK_R32_SHIFT == (r) \
&& SK_G32_SHIFT == (g) && SK_B32_SHIFT == (b))
-static bool getBitmapInfo(const SkBitmap& bm,
+static bool getBitmapInfo(const SkBitmap& bm,
size_t* bitsPerComponent,
CGBitmapInfo* info,
bool* upscaleTo32) {
if (upscaleTo32) {
*upscaleTo32 = false;
}
-
+
switch (bm.config()) {
case SkBitmap::kRGB_565_Config:
if (upscaleTo32) {
@@ -105,11 +105,11 @@
const size_t s = bitmap->getSize();
// our provider "owns" the bitmap*, and will take care of deleting it
- // we initially lock it, so we can access the pixels. The bitmap will be deleted in the release
- // proc, which will in turn unlock the pixels
- bitmap->lockPixels();
+ // we initially lock it, so we can access the pixels. The bitmap will be deleted in the release
+ // proc, which will in turn unlock the pixels
+ bitmap->lockPixels();
CGDataProviderRef dataRef = CGDataProviderCreateWithData(bitmap, bitmap->getPixels(), s,
- SkBitmap_ReleaseInfo);
+ SkBitmap_ReleaseInfo);
bool releaseColorSpace = false;
if (NULL == colorSpace) {
@@ -177,7 +177,7 @@
if (NULL == data) {
return false;
}
-
+
CGPDFDocumentRef pdf = CGPDFDocumentCreateWithProvider(data);
CGDataProviderRelease(data);
if (NULL == pdf) {
@@ -189,12 +189,12 @@
if (NULL == page) {
return false;
}
-
+
CGRect bounds = CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
-
+
int w = (int)CGRectGetWidth(bounds);
int h = (int)CGRectGetHeight(bounds);
-
+
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config, w, h);
bitmap.allocPixels();
@@ -202,7 +202,7 @@
size_t bitsPerComponent;
CGBitmapInfo info;
- getBitmapInfo(bitmap, &bitsPerComponent, &info, NULL);
+ getBitmapInfo(bitmap, &bitsPerComponent, &info, NULL);
CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(bitmap.getPixels(), w, h,
diff --git a/src/utils/win/SkDWriteFontFileStream.h b/src/utils/win/SkDWriteFontFileStream.h
index cd5787e..b214858 100644
--- a/src/utils/win/SkDWriteFontFileStream.h
+++ b/src/utils/win/SkDWriteFontFileStream.h
@@ -23,7 +23,7 @@
public:
explicit SkDWriteFontFileStream(IDWriteFontFileStream* fontFileStream);
virtual ~SkDWriteFontFileStream();
-
+
virtual bool rewind() SK_OVERRIDE;
virtual size_t read(void* buffer, size_t size) SK_OVERRIDE;
virtual const void* getMemoryBase() SK_OVERRIDE;
diff --git a/src/utils/win/SkDWriteGeometrySink.cpp b/src/utils/win/SkDWriteGeometrySink.cpp
index 4aec3bb..5455e66 100644
--- a/src/utils/win/SkDWriteGeometrySink.cpp
+++ b/src/utils/win/SkDWriteGeometrySink.cpp
@@ -28,7 +28,7 @@
return S_OK;
} else {
*object = NULL;
- return E_NOINTERFACE;
+ return E_NOINTERFACE;
}
}
diff --git a/src/utils/win/SkHRESULT.cpp b/src/utils/win/SkHRESULT.cpp
index 3d463f8..8b6b79f 100644
--- a/src/utils/win/SkHRESULT.cpp
+++ b/src/utils/win/SkHRESULT.cpp
@@ -13,7 +13,7 @@
HRESULT hr, const char* msg) {
SkDEBUGCODE(if (NULL != msg) SkDEBUGF(("%s\n", msg)));
SkDEBUGF(("%s(%lu) : error 0x%x: ", file, line, hr));
-
+
LPSTR errorText = NULL;
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
@@ -25,7 +25,7 @@
0,
NULL
);
-
+
if (NULL == errorText) {
SkDEBUGF(("<unknown>\n"));
} else {
diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp
index fce015c..1d00611 100644
--- a/src/utils/win/SkIStream.cpp
+++ b/src/utils/win/SkIStream.cpp
@@ -34,7 +34,7 @@
return S_OK;
} else {
*ppvObject = NULL;
- return E_NOINTERFACE;
+ return E_NOINTERFACE;
}
}
@@ -62,7 +62,7 @@
{ return E_NOTIMPL; }
// IStream Interface
-HRESULT STDMETHODCALLTYPE SkBaseIStream::SetSize(ULARGE_INTEGER)
+HRESULT STDMETHODCALLTYPE SkBaseIStream::SetSize(ULARGE_INTEGER)
{ return E_NOTIMPL; }
HRESULT STDMETHODCALLTYPE SkBaseIStream::CopyTo(IStream*
@@ -190,7 +190,7 @@
hr = STG_E_INVALIDFUNCTION;
break;
}
-
+
if (NULL != lpNewFilePointer) {
lpNewFilePointer->QuadPart = this->fLocation.QuadPart;
}