| 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 "SkPerlinNoiseShader2.h" | 9 #include "SkPerlinNoiseShader2.h" |
| 10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 } | 676 } |
| 677 | 677 |
| 678 GrPerlinNoise2Effect(SkPerlinNoiseShader2::Type type, | 678 GrPerlinNoise2Effect(SkPerlinNoiseShader2::Type type, |
| 679 int numOctaves, bool stitchTiles, | 679 int numOctaves, bool stitchTiles, |
| 680 SkPerlinNoiseShader2::PaintingData* paintingData, | 680 SkPerlinNoiseShader2::PaintingData* paintingData, |
| 681 GrTexture* permutationsTexture, GrTexture* noiseTexture, | 681 GrTexture* permutationsTexture, GrTexture* noiseTexture, |
| 682 const SkMatrix& matrix) | 682 const SkMatrix& matrix) |
| 683 : fType(type) | 683 : fType(type) |
| 684 , fNumOctaves(numOctaves) | 684 , fNumOctaves(numOctaves) |
| 685 , fStitchTiles(stitchTiles) | 685 , fStitchTiles(stitchTiles) |
| 686 , fPermutationsAccess(permutationsTexture) | 686 , fPermutationsAccess(permutationsTexture, nullptr) |
| 687 , fNoiseAccess(noiseTexture) | 687 , fNoiseAccess(noiseTexture, nullptr) |
| 688 , fPaintingData(paintingData) { | 688 , fPaintingData(paintingData) { |
| 689 this->initClassID<GrPerlinNoise2Effect>(); | 689 this->initClassID<GrPerlinNoise2Effect>(); |
| 690 this->addTextureAccess(&fPermutationsAccess); | 690 this->addTextureAccess(&fPermutationsAccess); |
| 691 this->addTextureAccess(&fNoiseAccess); | 691 this->addTextureAccess(&fNoiseAccess); |
| 692 fCoordTransform.reset(kLocal_GrCoordSet, matrix); | 692 fCoordTransform.reset(kLocal_GrCoordSet, matrix); |
| 693 this->addCoordTransform(&fCoordTransform); | 693 this->addCoordTransform(&fCoordTransform); |
| 694 } | 694 } |
| 695 | 695 |
| 696 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 696 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 697 | 697 |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { | 1088 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { |
| 1089 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput); | 1089 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 GrImprovedPerlinNoiseEffect(int octaves, SkScalar z, | 1092 GrImprovedPerlinNoiseEffect(int octaves, SkScalar z, |
| 1093 SkPerlinNoiseShader2::PaintingData* paintingData
, | 1093 SkPerlinNoiseShader2::PaintingData* paintingData
, |
| 1094 GrTexture* permutationsTexture, GrTexture* gradi
entTexture, | 1094 GrTexture* permutationsTexture, GrTexture* gradi
entTexture, |
| 1095 const SkMatrix& matrix) | 1095 const SkMatrix& matrix) |
| 1096 : fOctaves(octaves) | 1096 : fOctaves(octaves) |
| 1097 , fZ(z) | 1097 , fZ(z) |
| 1098 , fPermutationsAccess(permutationsTexture) | 1098 , fPermutationsAccess(permutationsTexture, nullptr) |
| 1099 , fGradientAccess(gradientTexture) | 1099 , fGradientAccess(gradientTexture, nullptr) |
| 1100 , fPaintingData(paintingData) { | 1100 , fPaintingData(paintingData) { |
| 1101 this->initClassID<GrImprovedPerlinNoiseEffect>(); | 1101 this->initClassID<GrImprovedPerlinNoiseEffect>(); |
| 1102 this->addTextureAccess(&fPermutationsAccess); | 1102 this->addTextureAccess(&fPermutationsAccess); |
| 1103 this->addTextureAccess(&fGradientAccess); | 1103 this->addTextureAccess(&fGradientAccess); |
| 1104 fCoordTransform.reset(kLocal_GrCoordSet, matrix); | 1104 fCoordTransform.reset(kLocal_GrCoordSet, matrix); |
| 1105 this->addCoordTransform(&fCoordTransform); | 1105 this->addCoordTransform(&fCoordTransform); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 1108 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 1109 | 1109 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 str->append(" seed: "); | 1400 str->append(" seed: "); |
| 1401 str->appendScalar(fSeed); | 1401 str->appendScalar(fSeed); |
| 1402 str->append(" stitch tiles: "); | 1402 str->append(" stitch tiles: "); |
| 1403 str->append(fStitchTiles ? "true " : "false "); | 1403 str->append(fStitchTiles ? "true " : "false "); |
| 1404 | 1404 |
| 1405 this->INHERITED::toString(str); | 1405 this->INHERITED::toString(str); |
| 1406 | 1406 |
| 1407 str->append(")"); | 1407 str->append(")"); |
| 1408 } | 1408 } |
| 1409 #endif | 1409 #endif |
| OLD | NEW |