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 "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 523 |
524 ///////////////////////////////////////////////////////////////////// | 524 ///////////////////////////////////////////////////////////////////// |
525 | 525 |
526 class GrPerlinNoiseEffect : public GrEffect { | 526 class GrPerlinNoiseEffect : public GrEffect { |
527 public: | 527 public: |
528 static GrEffectRef* Create(SkPerlinNoiseShader::Type type, | 528 static GrEffectRef* Create(SkPerlinNoiseShader::Type type, |
529 int numOctaves, bool stitchTiles, | 529 int numOctaves, bool stitchTiles, |
530 SkPerlinNoiseShader::PaintingData* paintingData, | 530 SkPerlinNoiseShader::PaintingData* paintingData, |
531 GrTexture* permutationsTexture, GrTexture* noiseT
exture, | 531 GrTexture* permutationsTexture, GrTexture* noiseT
exture, |
532 const SkMatrix& matrix, uint8_t alpha) { | 532 const SkMatrix& matrix, uint8_t alpha) { |
533 AutoEffectUnref effect(SkNEW_ARGS(GrPerlinNoiseEffect, (type, numOctaves
, | 533 return SkNEW_ARGS(GrPerlinNoiseEffect, (type, numOctaves, stitchTiles, p
aintingData, |
534 stitchTiles, paintingData, permutationsTexture, noiseTexture, matrix
, alpha))); | 534 permutationsTexture, noiseTextur
e, matrix, alpha)); |
535 return CreateEffectRef(effect); | |
536 } | 535 } |
537 | 536 |
538 virtual ~GrPerlinNoiseEffect() { | 537 virtual ~GrPerlinNoiseEffect() { |
539 SkDELETE(fPaintingData); | 538 SkDELETE(fPaintingData); |
540 } | 539 } |
541 | 540 |
542 static const char* Name() { return "PerlinNoise"; } | 541 static const char* Name() { return "PerlinNoise"; } |
543 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { | 542 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { |
544 return GrTBackendEffectFactory<GrPerlinNoiseEffect>::getInstance(); | 543 return GrTBackendEffectFactory<GrPerlinNoiseEffect>::getInstance(); |
545 } | 544 } |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 str->append(" seed: "); | 1042 str->append(" seed: "); |
1044 str->appendScalar(fSeed); | 1043 str->appendScalar(fSeed); |
1045 str->append(" stitch tiles: "); | 1044 str->append(" stitch tiles: "); |
1046 str->append(fStitchTiles ? "true " : "false "); | 1045 str->append(fStitchTiles ? "true " : "false "); |
1047 | 1046 |
1048 this->INHERITED::toString(str); | 1047 this->INHERITED::toString(str); |
1049 | 1048 |
1050 str->append(")"); | 1049 str->append(")"); |
1051 } | 1050 } |
1052 #endif | 1051 #endif |
OLD | NEW |