| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkPath.h" | 9 #include "SkPath.h" |
| 10 #include "SkRegion.h" | 10 #include "SkRegion.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, | 46 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, |
| 47 SkShader::TileMode tmx, SkShader::TileMode tmy) { | 47 SkShader::TileMode tmx, SkShader::TileMode tmy) { |
| 48 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy); | 48 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy); |
| 49 paint->setShader(shader)->unref(); | 49 paint->setShader(shader)->unref(); |
| 50 paint->setFilterBitmap(filter); | 50 paint->setFilterBitmap(filter); |
| 51 } | 51 } |
| 52 | 52 |
| 53 static const SkBitmap::Config gConfigs[] = { | 53 static const SkBitmap::Config gConfigs[] = { |
| 54 SkBitmap::kARGB_8888_Config, | 54 SkBitmap::kARGB_8888_Config, |
| 55 SkBitmap::kRGB_565_Config, | 55 SkBitmap::kRGB_565_Config, |
| 56 SkBitmap::kARGB_4444_Config | |
| 57 }; | 56 }; |
| 58 static const int gWidth = 32; | 57 static const int gWidth = 32; |
| 59 static const int gHeight = 32; | 58 static const int gHeight = 32; |
| 60 | 59 |
| 61 class TilingGM : public skiagm::GM { | 60 class TilingGM : public skiagm::GM { |
| 62 SkBlurDrawLooper fLooper; | 61 SkBlurDrawLooper fLooper; |
| 63 public: | 62 public: |
| 64 TilingGM() | 63 TilingGM() |
| 65 : fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2), | 64 : fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2), |
| 66 0x88000000) { | 65 0x88000000) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 244 |
| 246 private: | 245 private: |
| 247 typedef skiagm::GM INHERITED; | 246 typedef skiagm::GM INHERITED; |
| 248 }; | 247 }; |
| 249 | 248 |
| 250 ////////////////////////////////////////////////////////////////////////////// | 249 ////////////////////////////////////////////////////////////////////////////// |
| 251 | 250 |
| 252 DEF_GM( return new TilingGM; ) | 251 DEF_GM( return new TilingGM; ) |
| 253 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) | 252 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) |
| 254 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) | 253 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) |
| OLD | NEW |