| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkPerlinNoiseShader.h" | 9 #include "SkPerlinNoiseShader.h" |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 y += tileSize.width(); | 51 y += tileSize.width(); |
| 52 drawRect(canvas, x, y, paint, tileSize); | 52 drawRect(canvas, x, y, paint, tileSize); |
| 53 x -= tileSize.width(); | 53 x -= tileSize.width(); |
| 54 drawRect(canvas, x, y, paint, tileSize); | 54 drawRect(canvas, x, y, paint, tileSize); |
| 55 } else { | 55 } else { |
| 56 drawRect(canvas, x, y, paint, fSize); | 56 drawRect(canvas, x, y, paint, fSize); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual void onDraw(SkCanvas* canvas) { | 60 virtual void onDraw(SkCanvas* canvas) { |
| 61 canvas->clear(0x00000000); | 61 canvas->clear(SK_ColorBLACK); |
| 62 test(canvas, 0, 0, SkPerlinNoiseShader::kFractalNoise_Type, | 62 test(canvas, 0, 0, SkPerlinNoiseShader::kFractalNoise_Type, |
| 63 0.1f, 0.1f, 0, 0, false); | 63 0.1f, 0.1f, 0, 0, false); |
| 64 test(canvas, 100, 0, SkPerlinNoiseShader::kTurbulence_Type, | 64 test(canvas, 100, 0, SkPerlinNoiseShader::kTurbulence_Type, |
| 65 0.1f, 0.1f, 0, 0, false); | 65 0.1f, 0.1f, 0, 0, false); |
| 66 | 66 |
| 67 test(canvas, 0, 100, SkPerlinNoiseShader::kFractalNoise_Type, | 67 test(canvas, 0, 100, SkPerlinNoiseShader::kFractalNoise_Type, |
| 68 0.1f, 0.1f, 2, 0, false); | 68 0.1f, 0.1f, 2, 0, false); |
| 69 test(canvas, 100, 100, SkPerlinNoiseShader::kFractalNoise_Type, | 69 test(canvas, 100, 100, SkPerlinNoiseShader::kFractalNoise_Type, |
| 70 0.05f, 0.1f, 1, 0, true); | 70 0.05f, 0.1f, 1, 0, true); |
| 71 | 71 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 typedef GM INHERITED; | 173 typedef GM INHERITED; |
| 174 SkISize fSize; | 174 SkISize fSize; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 ////////////////////////////////////////////////////////////////////////////// | 177 ////////////////////////////////////////////////////////////////////////////// |
| 178 | 178 |
| 179 DEF_GM( return new PerlinNoiseGM; ) | 179 DEF_GM( return new PerlinNoiseGM; ) |
| 180 DEF_GM( return new PerlinNoiseGM2; ) | 180 DEF_GM( return new PerlinNoiseGM2; ) |
| OLD | NEW |