aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/tilemodes.cpp
diff options
context:
space:
mode:
authorGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:19:56 +0000
committerGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:19:56 +0000
commitae933ce0ea5fd9d21cb6ef2cee7e729d32690aac (patch)
tree62d80e33b16679d01454cf814977a7030d3a5462 /gm/tilemodes.cpp
parentd6176b0dcacb124539e0cfd051e6d93a9782f020 (diff)
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 'gm/tilemodes.cpp')
-rw-r--r--gm/tilemodes.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index 289caae831..08bcb79f65 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -25,14 +25,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);
@@ -63,7 +63,7 @@ static const int gHeight = 32;
class TilingGM : public GM {
SkBlurDrawLooper fLooper;
public:
- TilingGM()
+ TilingGM()
: fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2),
0x88000000) {
for (size_t i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) {
@@ -72,23 +72,23 @@ public:
}
SkBitmap fTexture[SK_ARRAY_COUNT(gConfigs)];
-
+
protected:
SkString onShortName() {
return SkString("tilemodes");
}
-
- SkISize onISize() { return make_isize(880, 560); }
-
+
+ SkISize onISize() { return make_isize(880, 560); }
+
virtual void onDraw(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" };
@@ -106,11 +106,11 @@ protected:
p.setTextAlign(SkPaint::kCenter_Align);
canvas->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++) {
@@ -121,12 +121,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;
}
}
@@ -143,7 +143,7 @@ protected:
}
}
}
-
+
private:
typedef GM INHERITED;
};