| 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 const char* outputColor, | 644 const char* outputColor, |
| 645 const char* inputColor, | 645 const char* inputColor, |
| 646 const TransformedCoordsArray& coords, | 646 const TransformedCoordsArray& coords, |
| 647 const TextureSamplerArray& samplers) { | 647 const TextureSamplerArray& samplers) { |
| 648 sk_ignore_unused_variable(inputColor); | 648 sk_ignore_unused_variable(inputColor); |
| 649 | 649 |
| 650 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); | 650 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
| 651 SkString vCoords = fsBuilder->ensureFSCoords2D(coords, 0); | 651 SkString vCoords = fsBuilder->ensureFSCoords2D(coords, 0); |
| 652 | 652 |
| 653 fBaseFrequencyUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibi
lity, | 653 fBaseFrequencyUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibi
lity, |
| 654 kVec2f_GrSLType, "baseFrequency"); | 654 kVec2f_GrSLType, kDefault_GrSLPrecis
ion, |
| 655 "baseFrequency"); |
| 655 const char* baseFrequencyUni = builder->getUniformCStr(fBaseFrequencyUni); | 656 const char* baseFrequencyUni = builder->getUniformCStr(fBaseFrequencyUni); |
| 656 fAlphaUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, | 657 fAlphaUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
| 657 kFloat_GrSLType, "alpha"); | 658 kFloat_GrSLType, kDefault_GrSLPrecision, |
| 659 "alpha"); |
| 658 const char* alphaUni = builder->getUniformCStr(fAlphaUni); | 660 const char* alphaUni = builder->getUniformCStr(fAlphaUni); |
| 659 | 661 |
| 660 const char* stitchDataUni = NULL; | 662 const char* stitchDataUni = NULL; |
| 661 if (fStitchTiles) { | 663 if (fStitchTiles) { |
| 662 fStitchDataUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib
ility, | 664 fStitchDataUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib
ility, |
| 663 kVec2f_GrSLType, "stitchData"); | 665 kVec2f_GrSLType, kDefault_GrSLPreci
sion, |
| 666 "stitchData"); |
| 664 stitchDataUni = builder->getUniformCStr(fStitchDataUni); | 667 stitchDataUni = builder->getUniformCStr(fStitchDataUni); |
| 665 } | 668 } |
| 666 | 669 |
| 667 // There are 4 lines, so the center of each line is 1/8, 3/8, 5/8 and 7/8 | 670 // There are 4 lines, so the center of each line is 1/8, 3/8, 5/8 and 7/8 |
| 668 const char* chanCoordR = "0.125"; | 671 const char* chanCoordR = "0.125"; |
| 669 const char* chanCoordG = "0.375"; | 672 const char* chanCoordG = "0.375"; |
| 670 const char* chanCoordB = "0.625"; | 673 const char* chanCoordB = "0.625"; |
| 671 const char* chanCoordA = "0.875"; | 674 const char* chanCoordA = "0.875"; |
| 672 const char* chanCoord = "chanCoord"; | 675 const char* chanCoord = "chanCoord"; |
| 673 const char* stitchData = "stitchData"; | 676 const char* stitchData = "stitchData"; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 str->append(" seed: "); | 1030 str->append(" seed: "); |
| 1028 str->appendScalar(fSeed); | 1031 str->appendScalar(fSeed); |
| 1029 str->append(" stitch tiles: "); | 1032 str->append(" stitch tiles: "); |
| 1030 str->append(fStitchTiles ? "true " : "false "); | 1033 str->append(fStitchTiles ? "true " : "false "); |
| 1031 | 1034 |
| 1032 this->INHERITED::toString(str); | 1035 this->INHERITED::toString(str); |
| 1033 | 1036 |
| 1034 str->append(")"); | 1037 str->append(")"); |
| 1035 } | 1038 } |
| 1036 #endif | 1039 #endif |
| OLD | NEW |