aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SamplePathUtils.cpp
diff options
context:
space:
mode:
authorGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-02 07:00:59 +0000
committerGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-02 07:00:59 +0000
commit0d55dd7d2c07a77b22478bed9b30ff44ceecad68 (patch)
tree30ce0d58c2a233bd89ef66d04bf605c9ccdbc0f1 /samplecode/SamplePathUtils.cpp
parentd3976a1bc06b6a8d019fdbc9edeff99acf81b838 (diff)
Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@9856 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SamplePathUtils.cpp')
-rw-r--r--samplecode/SamplePathUtils.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/samplecode/SamplePathUtils.cpp b/samplecode/SamplePathUtils.cpp
index cc560589fa..c5ed0e9724 100644
--- a/samplecode/SamplePathUtils.cpp
+++ b/samplecode/SamplePathUtils.cpp
@@ -11,13 +11,13 @@
#include "SkView.h"
//#include "SkPathOps.h" // loads fine here, won't in PathUtils src files
#include "SkRandom.h"
-//#include "SkTime.h"
+//#include "SkTime.h"
class samplePathUtils : public SampleView {
public:
samplePathUtils() {
bmp_paint.setAntiAlias(true); // Black paint for bitmap
- bmp_paint.setStyle(SkPaint::kFill_Style);
+ bmp_paint.setStyle(SkPaint::kFill_Style);
bmp_paint.setColor(SK_ColorBLACK);
}
@@ -27,7 +27,7 @@ protected:
static const int numChars = h * stride; // number of chars in entire array
SkPaint bmp_paint;
-
+
// overrides from SkEventSink
virtual bool onQuery(SkEvent* evt) {
if (SampleCode::TitleQ(*evt)) {
@@ -38,13 +38,13 @@ protected:
}
/////////////////////////////////////////////////////////////
-
+
virtual void onDrawContent(SkCanvas* canvas) {
// bitmap definitions
const uint8_t bits[numModes][numChars] = {
{ 0x18, 0x00, 0x3c, 0x00, 0x7e, 0x00, 0xdb, 0x00,
0xff, 0x00, 0x24, 0x00, 0x5a, 0x00, 0xa5, 0x00 },
-
+
{ 0x20, 0x80, 0x91, 0x20, 0xbf, 0xa0, 0xee, 0xe0,
0xff, 0xe0, 0x7f, 0xc0, 0x20, 0x80, 0x40, 0x40 },
@@ -57,17 +57,17 @@ protected:
for (int i = 0; i < numModes; ++i) {
SkPath path; // generate and simplify each path
SkPathUtils::BitsToPath_Path(&path, (char*) &bits[i], h, w, stride);
-
+
canvas->save(); // DRAWING
canvas->scale(kScale, kScale); // scales up each bitmap
canvas->translate(0, 1.5f * h * i);
canvas->drawPath(path, bmp_paint); // draw bitmap
canvas->restore();
-
+
// use the SkRegion method
SkPath pathR;
SkPathUtils::BitsToPath_Region(&pathR, (char*) &bits[i], h, w, stride);
-
+
canvas->save();
canvas->scale(kScale, kScale); // scales up each bitmap
@@ -76,7 +76,7 @@ protected:
canvas->restore();
}
}
-
+
private:
typedef SkView INHERITED;
};