aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gm/poly2poly.cpp33
-rw-r--r--include/core/SkPath.h8
-rw-r--r--src/core/SkBitmap.cpp2
-rw-r--r--src/core/SkDevice.cpp2
-rw-r--r--src/core/SkPath.cpp2
-rw-r--r--tests/PathTest.cpp2
6 files changed, 24 insertions, 25 deletions
diff --git a/gm/poly2poly.cpp b/gm/poly2poly.cpp
index fda0474d63..c36ac85483 100644
--- a/gm/poly2poly.cpp
+++ b/gm/poly2poly.cpp
@@ -14,18 +14,18 @@ public:
void save();
void restore();
-
+
double lineWidth;
void setLineWidth(double);
-
+
void beginPath();
void moveTo(double x, double y);
void lineTo(double x, double y);
void closePath();
-
+
void fill();
void stroke();
-
+
void fillText(const char text[], double x, double y);
private:
@@ -95,7 +95,7 @@ static void test_stroke(SkCanvas* canvas) {
path.reset(); path.moveTo(0, 0); path.lineTo(100, 100); path.moveTo(200, 200);
dump(path);
}
-
+
#if 0
// TEST 1 - The rectangle as it's expected to look
var canvas = document.createElement('canvas');
@@ -113,15 +113,15 @@ static void test_stroke(SkCanvas* canvas) {
ctx.lineTo(150, 15);
ctx.lineTo(10, 15);
ctx.closePath();
-
+
// no extra moveTo here
// ctx.moveTo(175, 125);
-
+
ctx.stroke();
ctx.restore();
-
+
ctx.fillText("As Expected", 10, 10);
-
+
#if 0
// TEST 2 - Includes an extra moveTo call before stroke; the rectangle appears larger
canvas = document.createElement('canvas');
@@ -139,14 +139,14 @@ static void test_stroke(SkCanvas* canvas) {
ctx.lineTo(150, 15);
ctx.lineTo(10, 15);
ctx.closePath();
-
+
ctx.moveTo(175, 125);
-
+
ctx.stroke();
ctx.restore();
-
+
ctx.fillText("Larger Rectangle", 10, 10);
-
+
#if 0
// TEST 3 - Identical to test 2 except the line width is 1
canvas = document.createElement('canvas');
@@ -164,12 +164,12 @@ static void test_stroke(SkCanvas* canvas) {
ctx.lineTo(150, 15);
ctx.lineTo(10, 15);
ctx.closePath();
-
+
ctx.moveTo(175, 125);
-
+
ctx.stroke();
ctx.restore();
-
+
ctx.fillText("As Expected - line width 1", 10, 10);
}
@@ -269,4 +269,3 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return new Poly2PolyGM; )
-
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 76aad0df0b..bc89f71f31 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -244,7 +244,7 @@ public:
/** counter-clockwise direction for adding closed contours */
kCCW_Direction,
};
-
+
/** Returns true if the path specifies a rectangle. If so, and if rect is
not null, set rect to the bounds of the path. If the path does not
specify a rectangle, return false and ignore rect.
@@ -256,7 +256,7 @@ public:
bool isRect(SkRect* rect) const {
return this->isRect(rect, NULL, NULL);
}
-
+
/**
* Returns true if the path specifies a rectangle.
*
@@ -270,14 +270,14 @@ public:
* @return true if the path specifies a rectangle
*/
bool isRect(SkRect* rect, bool* isClosed, Direction* direction) const;
-
+
/** Returns true if the path specifies a pair of nested rectangles. If so, and if
rect is not null, set rect[0] to the outer rectangle and rect[1] to the inner
rectangle. If so, and dirs is not null, set dirs[0] to the direction of
the outer rectangle and dirs[1] to the direction of the inner rectangle. If
the path does not specify a pair of nested rectangles, return
false and ignore rect and dirs.
-
+
@param rect If not null, returns the path as a pair of nested rectangles
@param dirs If not null, returns the direction of the rects
@return true if the path describes a pair of nested rectangles
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index ec64577dfd..383f0efaef 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -805,7 +805,7 @@ void SkBitmap::eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const {
case kRGB_565_Config: {
uint16_t* p = (uint16_t*)fPixels;
uint16_t v;
-
+
if (kARGB_4444_Config == fConfig) {
v = pack_8888_to_4444(a, r, g, b);
} else {
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 97d5748cdb..6290c4eb53 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -32,7 +32,7 @@ SkDevice::SkDevice(const SkBitmap& bitmap)
{
fOrigin.setZero();
fMetaData = NULL;
-
+
SkASSERT(SkBitmap::kARGB_4444_Config != bitmap.config());
}
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 2d819c168d..35f4772b54 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -592,7 +592,7 @@ bool SkPath::isRect(SkRect* rect, bool* isClosed, Direction* direction) const {
if (!this->isRectContour(false, &currVerb, &pts, isClosed, direction)) {
return false;
}
-
+
if (rect) {
rect->set(first, SkToS32(pts - first));
}
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 41151a54bc..36d7d064c3 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -2420,7 +2420,7 @@ static void TestPath(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, p.isRect(&r));
REPORTER_ASSERT(reporter, r == bounds);
}
-
+
test_isLine(reporter);
test_isRect(reporter);
test_isNestedRects(reporter);