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 "SkDither.h" | 8 #include "SkDither.h" |
9 #include "SkPerlinNoiseShader.h" | 9 #include "SkPerlinNoiseShader.h" |
10 #include "SkFlattenableBuffers.h" | 10 #include "SkFlattenableBuffers.h" |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 } | 705 } |
706 | 706 |
707 SkScalar fSeed; | 707 SkScalar fSeed; |
708 | 708 |
709 typedef GrNoiseEffect INHERITED; | 709 typedef GrNoiseEffect INHERITED; |
710 }; | 710 }; |
711 | 711 |
712 ///////////////////////////////////////////////////////////////////// | 712 ///////////////////////////////////////////////////////////////////// |
713 GR_DEFINE_EFFECT_TEST(GrPerlinNoiseEffect); | 713 GR_DEFINE_EFFECT_TEST(GrPerlinNoiseEffect); |
714 | 714 |
715 GrEffectRef* GrPerlinNoiseEffect::TestCreate(SkMWCRandom* random, | 715 GrEffectRef* GrPerlinNoiseEffect::TestCreate(SkRandom* random, |
716 GrContext* context, | 716 GrContext* context, |
717 const GrDrawTargetCaps&, | 717 const GrDrawTargetCaps&, |
718 GrTexture**) { | 718 GrTexture**) { |
719 int numOctaves = random->nextRangeU(2, 10); | 719 int numOctaves = random->nextRangeU(2, 10); |
720 bool stitchTiles = random->nextBool(); | 720 bool stitchTiles = random->nextBool(); |
721 SkScalar seed = SkIntToScalar(random->nextU()); | 721 SkScalar seed = SkIntToScalar(random->nextU()); |
722 SkISize tileSize = SkISize::Make(random->nextRangeU(4, 4096), random->nextR
angeU(4, 4096)); | 722 SkISize tileSize = SkISize::Make(random->nextRangeU(4, 4096), random->nextR
angeU(4, 4096)); |
723 SkScalar baseFrequencyX = random->nextRangeScalar(SkFloatToScalar(0.01f), | 723 SkScalar baseFrequencyX = random->nextRangeScalar(SkFloatToScalar(0.01f), |
724 SkFloatToScalar(0.99f)); | 724 SkFloatToScalar(0.99f)); |
725 SkScalar baseFrequencyY = random->nextRangeScalar(SkFloatToScalar(0.01f), | 725 SkScalar baseFrequencyY = random->nextRangeScalar(SkFloatToScalar(0.01f), |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 str->append(" seed: "); | 1369 str->append(" seed: "); |
1370 str->appendScalar(fSeed); | 1370 str->appendScalar(fSeed); |
1371 str->append(" stitch tiles: "); | 1371 str->append(" stitch tiles: "); |
1372 str->append(fStitchTiles ? "true " : "false "); | 1372 str->append(fStitchTiles ? "true " : "false "); |
1373 | 1373 |
1374 this->INHERITED::toString(str); | 1374 this->INHERITED::toString(str); |
1375 | 1375 |
1376 str->append(")"); | 1376 str->append(")"); |
1377 } | 1377 } |
1378 #endif | 1378 #endif |
OLD | NEW |