aboutsummaryrefslogtreecommitdiffstats
path: root/samplecode/SampleTiling.cpp
diff options
context:
space:
mode:
authorrmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:19:56 +0000
committerrmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:19:56 +0000
commitae933ce0ea5fd9d21cb6ef2cee7e729d32690aac (patch)
tree62d80e33b16679d01454cf814977a7030d3a5462 /samplecode/SampleTiling.cpp
parentd6176b0dcacb124539e0cfd051e6d93a9782f020 (diff)
downloadplatform_external_skqp-ae933ce0ea5fd9d21cb6ef2cee7e729d32690aac.tar.gz
platform_external_skqp-ae933ce0ea5fd9d21cb6ef2cee7e729d32690aac.tar.bz2
platform_external_skqp-ae933ce0ea5fd9d21cb6ef2cee7e729d32690aac.zip
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part III of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6475053 git-svn-id: http://skia.googlecode.com/svn/trunk@5264 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleTiling.cpp')
-rw-r--r--samplecode/SampleTiling.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index d72544bafb..e7b6a7ff11 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -27,14 +27,14 @@ static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) {
bm->setConfig(config, w, h);
bm->allocPixels();
bm->eraseColor(0);
-
+
SkCanvas canvas(*bm);
SkPoint pts[] = { { 0, 0 }, { SkIntToScalar(w), SkIntToScalar(h) } };
SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE };
SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 };
SkPaint paint;
-
- SkUnitMapper* um = NULL;
+
+ SkUnitMapper* um = NULL;
um = new SkCosineMapper;
// um = new SkDiscreteMapper(12);
@@ -66,7 +66,7 @@ class TilingView : public SampleView {
SkPicture* fTextPicture;
SkBlurDrawLooper fLooper;
public:
- TilingView()
+ TilingView()
: fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2),
0x88000000) {
fTextPicture = new SkPicture();
@@ -80,7 +80,7 @@ public:
}
SkBitmap fTexture[SK_ARRAY_COUNT(gConfigs)];
-
+
protected:
// overrides from SkEventSink
virtual bool onQuery(SkEvent* evt) {
@@ -90,15 +90,15 @@ protected:
}
return this->INHERITED::onQuery(evt);
}
-
+
virtual void onDrawContent(SkCanvas* canvas) {
SkRect r = { 0, 0, SkIntToScalar(gWidth*2), SkIntToScalar(gHeight*2) };
static const char* gConfigNames[] = { "8888", "565", "4444" };
-
+
static const bool gFilters[] = { false, true };
static const char* gFilterNames[] = { "point", "bilinear" };
-
+
static const SkShader::TileMode gModes[] = { SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMirror_TileMode };
static const char* gModeNames[] = { "C", "R", "M" };
@@ -122,12 +122,12 @@ protected:
p.setTextAlign(SkPaint::kCenter_Align);
textCanvas->drawText(str.c_str(), str.size(), x + r.width()/2, y, p);
-
+
x += r.width() * 4 / 3;
}
}
}
-
+
y += SkIntToScalar(16);
for (size_t i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) {
@@ -138,12 +138,12 @@ protected:
SkPaint paint;
setup(&paint, fTexture[i], gFilters[j], gModes[kx], gModes[ky]);
paint.setDither(true);
-
+
canvas->save();
canvas->translate(x, y);
canvas->drawRect(r, paint);
canvas->restore();
-
+
x += r.width() * 4 / 3;
}
}
@@ -162,7 +162,7 @@ protected:
canvas->drawPicture(*fTextPicture);
}
-
+
private:
typedef SampleView INHERITED;
};