epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 7 | #include "gm.h" |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 8 | #include "SkColorFilter.h" |
| 9 | #include "SkMaskFilter.h" |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 10 | #include "SkPath.h" |
| 11 | #include "SkRegion.h" |
| 12 | #include "SkShader.h" |
| 13 | #include "SkUtils.h" |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 14 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 15 | |
| 16 | // effects |
| 17 | #include "SkGradientShader.h" |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 18 | #include "SkBlurDrawLooper.h" |
| 19 | |
commit-bot@chromium.org | dac5225 | 2014-02-17 21:21:46 +0000 | [diff] [blame] | 20 | static void makebm(SkBitmap* bm, SkColorType ct, int w, int h) { |
| 21 | bm->allocPixels(SkImageInfo::Make(w, h, ct, kPremul_SkAlphaType)); |
junov@google.com | dbfac8a | 2012-12-06 21:47:40 +0000 | [diff] [blame] | 22 | bm->eraseColor(SK_ColorTRANSPARENT); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 23 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 24 | SkCanvas canvas(*bm); |
| 25 | SkPoint pts[] = { { 0, 0 }, { SkIntToScalar(w), SkIntToScalar(h)} }; |
| 26 | SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE }; |
| 27 | SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 }; |
| 28 | SkPaint paint; |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 29 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 30 | paint.setDither(true); |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 31 | paint.setShader(SkGradientShader::MakeLinear(pts, colors, pos, SK_ARRAY_COUNT(colors), |
| 32 | SkShader::kClamp_TileMode)); |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 33 | canvas.drawPaint(paint); |
| 34 | } |
| 35 | |
| 36 | static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, |
| 37 | SkShader::TileMode tmx, SkShader::TileMode tmy) { |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 38 | paint->setShader(SkShader::MakeBitmapShader(bm, tmx, tmy)); |
reed | 93a1215 | 2015-03-16 10:08:34 -0700 | [diff] [blame] | 39 | paint->setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 40 | } |
| 41 | |
commit-bot@chromium.org | dac5225 | 2014-02-17 21:21:46 +0000 | [diff] [blame] | 42 | static const SkColorType gColorTypes[] = { |
commit-bot@chromium.org | 28fcae2 | 2014-04-11 17:15:40 +0000 | [diff] [blame] | 43 | kN32_SkColorType, |
commit-bot@chromium.org | dac5225 | 2014-02-17 21:21:46 +0000 | [diff] [blame] | 44 | kRGB_565_SkColorType, |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 45 | }; |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 46 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 47 | class TilingGM : public skiagm::GM { |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 48 | public: |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 49 | TilingGM(bool powerOfTwoSize) |
robertphillips@google.com | 6db2ae2 | 2013-08-30 12:41:42 +0000 | [diff] [blame] | 50 | : fPowerOfTwoSize(powerOfTwoSize) { |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 51 | } |
| 52 | |
commit-bot@chromium.org | dac5225 | 2014-02-17 21:21:46 +0000 | [diff] [blame] | 53 | SkBitmap fTexture[SK_ARRAY_COUNT(gColorTypes)]; |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 54 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 55 | protected: |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 56 | |
| 57 | enum { |
| 58 | kPOTSize = 32, |
| 59 | kNPOTSize = 21, |
| 60 | }; |
| 61 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 62 | SkString onShortName() override { |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 63 | SkString name("tilemodes"); |
| 64 | if (!fPowerOfTwoSize) { |
| 65 | name.append("_npot"); |
| 66 | } |
| 67 | return name; |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 68 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 69 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 70 | SkISize onISize() override { return SkISize::Make(880, 560); } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 71 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 72 | void onOnceBeforeDraw() override { |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 73 | int size = fPowerOfTwoSize ? kPOTSize : kNPOTSize; |
commit-bot@chromium.org | dac5225 | 2014-02-17 21:21:46 +0000 | [diff] [blame] | 74 | for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) { |
| 75 | makebm(&fTexture[i], gColorTypes[i], size, size); |
reed@google.com | 7775d66 | 2012-11-27 15:15:58 +0000 | [diff] [blame] | 76 | } |
| 77 | } |
| 78 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 79 | void onDraw(SkCanvas* canvas) override { |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 80 | |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 81 | int size = fPowerOfTwoSize ? kPOTSize : kNPOTSize; |
| 82 | |
| 83 | SkRect r = { 0, 0, SkIntToScalar(size*2), SkIntToScalar(size*2) }; |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 84 | |
| 85 | static const char* gConfigNames[] = { "8888", "565", "4444" }; |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 86 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 87 | static const bool gFilters[] = { false, true }; |
| 88 | static const char* gFilterNames[] = { "point", "bilinear" }; |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 89 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 90 | static const SkShader::TileMode gModes[] = { SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMirror_TileMode }; |
| 91 | static const char* gModeNames[] = { "C", "R", "M" }; |
| 92 | |
| 93 | SkScalar y = SkIntToScalar(24); |
| 94 | SkScalar x = SkIntToScalar(10); |
| 95 | |
| 96 | for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { |
| 97 | for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) { |
| 98 | SkPaint p; |
| 99 | SkString str; |
| 100 | p.setAntiAlias(true); |
caryclark | 1818acb | 2015-07-24 12:09:25 -0700 | [diff] [blame] | 101 | sk_tool_utils::set_portable_typeface(&p); |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 102 | p.setDither(true); |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 103 | str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]); |
| 104 | |
| 105 | p.setTextAlign(SkPaint::kCenter_Align); |
| 106 | canvas->drawText(str.c_str(), str.size(), x + r.width()/2, y, p); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 107 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 108 | x += r.width() * 4 / 3; |
| 109 | } |
| 110 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 111 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 112 | y += SkIntToScalar(16); |
| 113 | |
commit-bot@chromium.org | dac5225 | 2014-02-17 21:21:46 +0000 | [diff] [blame] | 114 | for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) { |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 115 | for (size_t j = 0; j < SK_ARRAY_COUNT(gFilters); j++) { |
| 116 | x = SkIntToScalar(10); |
| 117 | for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { |
| 118 | for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) { |
| 119 | SkPaint paint; |
bsalomon@google.com | ab3c678 | 2013-08-06 20:47:52 +0000 | [diff] [blame] | 120 | #if 1 // Temporary change to regen bitmap before each draw. This may help tracking down an issue |
| 121 | // on SGX where resizing NPOT textures to POT textures exhibits a driver bug. |
| 122 | if (!fPowerOfTwoSize) { |
commit-bot@chromium.org | dac5225 | 2014-02-17 21:21:46 +0000 | [diff] [blame] | 123 | makebm(&fTexture[i], gColorTypes[i], size, size); |
bsalomon@google.com | ab3c678 | 2013-08-06 20:47:52 +0000 | [diff] [blame] | 124 | } |
| 125 | #endif |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 126 | setup(&paint, fTexture[i], gFilters[j], gModes[kx], gModes[ky]); |
| 127 | paint.setDither(true); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 128 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 129 | canvas->save(); |
| 130 | canvas->translate(x, y); |
| 131 | canvas->drawRect(r, paint); |
| 132 | canvas->restore(); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 133 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 134 | x += r.width() * 4 / 3; |
| 135 | } |
| 136 | } |
| 137 | { |
| 138 | SkPaint p; |
| 139 | SkString str; |
| 140 | p.setAntiAlias(true); |
caryclark | 1818acb | 2015-07-24 12:09:25 -0700 | [diff] [blame] | 141 | sk_tool_utils::set_portable_typeface(&p); |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 142 | str.printf("%s, %s", gConfigNames[i], gFilterNames[j]); |
| 143 | canvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p); |
| 144 | } |
| 145 | |
| 146 | y += r.height() * 4 / 3; |
| 147 | } |
| 148 | } |
| 149 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 150 | |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 151 | private: |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 152 | bool fPowerOfTwoSize; |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 153 | typedef skiagm::GM INHERITED; |
| 154 | }; |
| 155 | |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 156 | static const int gWidth = 32; |
| 157 | static const int gHeight = 32; |
| 158 | |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 159 | static sk_sp<SkShader> make_bm(SkShader::TileMode tx, SkShader::TileMode ty) { |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 160 | SkBitmap bm; |
commit-bot@chromium.org | 28fcae2 | 2014-04-11 17:15:40 +0000 | [diff] [blame] | 161 | makebm(&bm, kN32_SkColorType, gWidth, gHeight); |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 162 | return SkShader::MakeBitmapShader(bm, tx, ty); |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 163 | } |
| 164 | |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 165 | static sk_sp<SkShader> make_grad(SkShader::TileMode tx, SkShader::TileMode ty) { |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 166 | SkPoint pts[] = { { 0, 0 }, { SkIntToScalar(gWidth), SkIntToScalar(gHeight)} }; |
| 167 | SkPoint center = { SkIntToScalar(gWidth)/2, SkIntToScalar(gHeight)/2 }; |
| 168 | SkScalar rad = SkIntToScalar(gWidth)/2; |
caryclark | 1e545b6 | 2015-07-13 08:19:58 -0700 | [diff] [blame] | 169 | SkColor colors[] = { 0xFFFF0000, sk_tool_utils::color_to_565(0xFF0044FF) }; |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 170 | |
| 171 | int index = (int)ty; |
| 172 | switch (index % 3) { |
| 173 | case 0: |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 174 | return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors), tx); |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 175 | case 1: |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 176 | return SkGradientShader::MakeRadial(center, rad, colors, nullptr, SK_ARRAY_COUNT(colors), tx); |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 177 | case 2: |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 178 | return SkGradientShader::MakeSweep(center.fX, center.fY, colors, nullptr, SK_ARRAY_COUNT(colors)); |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 179 | } |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 180 | return nullptr; |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 181 | } |
| 182 | |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 183 | typedef sk_sp<SkShader> (*ShaderProc)(SkShader::TileMode, SkShader::TileMode); |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 184 | |
| 185 | class Tiling2GM : public skiagm::GM { |
| 186 | ShaderProc fProc; |
| 187 | SkString fName; |
| 188 | public: |
| 189 | Tiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { |
| 190 | fName.printf("tilemode_%s", name); |
| 191 | } |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 192 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 193 | protected: |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 194 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 195 | SkString onShortName() override { |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 196 | return fName; |
| 197 | } |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 198 | |
reed | 6dc14aa | 2016-04-11 07:46:38 -0700 | [diff] [blame] | 199 | SkISize onISize() override { return SkISize::Make(650, 610); } |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 200 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 201 | void onDraw(SkCanvas* canvas) override { |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 202 | canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); |
| 203 | |
| 204 | const SkScalar w = SkIntToScalar(gWidth); |
| 205 | const SkScalar h = SkIntToScalar(gHeight); |
| 206 | SkRect r = { -w, -h, w*2, h*2 }; |
| 207 | |
| 208 | static const SkShader::TileMode gModes[] = { |
| 209 | SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMirror_TileMode |
| 210 | }; |
| 211 | static const char* gModeNames[] = { |
| 212 | "Clamp", "Repeat", "Mirror" |
| 213 | }; |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 214 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 215 | SkScalar y = SkIntToScalar(24); |
| 216 | SkScalar x = SkIntToScalar(66); |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 217 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 218 | SkPaint p; |
| 219 | p.setAntiAlias(true); |
caryclark | 1818acb | 2015-07-24 12:09:25 -0700 | [diff] [blame] | 220 | sk_tool_utils::set_portable_typeface(&p); |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 221 | p.setTextAlign(SkPaint::kCenter_Align); |
| 222 | |
| 223 | for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { |
| 224 | SkString str(gModeNames[kx]); |
| 225 | canvas->drawText(str.c_str(), str.size(), x + r.width()/2, y, p); |
| 226 | x += r.width() * 4 / 3; |
| 227 | } |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 228 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 229 | y += SkIntToScalar(16) + h; |
| 230 | p.setTextAlign(SkPaint::kRight_Align); |
| 231 | |
| 232 | for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) { |
| 233 | x = SkIntToScalar(16) + w; |
| 234 | |
| 235 | SkString str(gModeNames[ky]); |
| 236 | canvas->drawText(str.c_str(), str.size(), x, y + h/2, p); |
| 237 | |
| 238 | x += SkIntToScalar(50); |
| 239 | for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { |
| 240 | SkPaint paint; |
reed | 1a9b964 | 2016-03-13 14:13:58 -0700 | [diff] [blame] | 241 | paint.setShader(fProc(gModes[kx], gModes[ky])); |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 242 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 243 | canvas->save(); |
| 244 | canvas->translate(x, y); |
| 245 | canvas->drawRect(r, paint); |
| 246 | canvas->restore(); |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 247 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 248 | x += r.width() * 4 / 3; |
| 249 | } |
| 250 | y += r.height() * 4 / 3; |
| 251 | } |
| 252 | } |
skia.committer@gmail.com | 6a748ad | 2012-10-19 02:01:19 +0000 | [diff] [blame] | 253 | |
mike@reedtribe.org | a059169 | 2012-10-18 02:01:59 +0000 | [diff] [blame] | 254 | private: |
| 255 | typedef skiagm::GM INHERITED; |
reed@android.com | 1a2fec5 | 2009-06-22 02:17:34 +0000 | [diff] [blame] | 256 | }; |
| 257 | |
| 258 | ////////////////////////////////////////////////////////////////////////////// |
| 259 | |
commit-bot@chromium.org | 37799e1 | 2013-07-25 17:52:32 +0000 | [diff] [blame] | 260 | DEF_GM( return new TilingGM(true); ) |
| 261 | DEF_GM( return new TilingGM(false); ) |
reed@google.com | 3934200 | 2013-02-22 17:28:16 +0000 | [diff] [blame] | 262 | DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) |
| 263 | DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) |