Index: experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp |
diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp |
index 83599d950d8c21c05465256d1f4f64dc523df099..a7750a8d856020158c351458c37072cb26eda3fc 100644 |
--- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp |
+++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp |
@@ -22,8 +22,8 @@ |
#include "effects/GrConstColorProcessor.h" |
#include "glsl/GrGLSLFragmentProcessor.h" |
#include "glsl/GrGLSLFragmentShaderBuilder.h" |
-#include "glsl/GrGLSLProgramBuilder.h" |
#include "glsl/GrGLSLProgramDataManager.h" |
+#include "glsl/GrGLSLUniformHandler.h" |
#endif |
static const int kBlockSize = 256; |
@@ -758,19 +758,20 @@ GrGLPerlinNoise2::GrGLPerlinNoise2(const GrProcessor& processor) |
void GrGLPerlinNoise2::emitCode(EmitArgs& args) { |
GrGLSLFragmentBuilder* fsBuilder = args.fFragBuilder; |
+ GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
SkString vCoords = fsBuilder->ensureFSCoords2D(args.fCoords, 0); |
- fBaseFrequencyUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kVec2f_GrSLType, kDefault_GrSLPrecision, |
- "baseFrequency"); |
- const char* baseFrequencyUni = args.fBuilder->getUniformCStr(fBaseFrequencyUni); |
+ fBaseFrequencyUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kVec2f_GrSLType, kDefault_GrSLPrecision, |
+ "baseFrequency"); |
+ const char* baseFrequencyUni = uniformHandler->getUniformCStr(fBaseFrequencyUni); |
const char* stitchDataUni = nullptr; |
if (fStitchTiles) { |
- fStitchDataUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kVec2f_GrSLType, kDefault_GrSLPrecision, |
- "stitchData"); |
- stitchDataUni = args.fBuilder->getUniformCStr(fStitchDataUni); |
+ fStitchDataUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kVec2f_GrSLType, kDefault_GrSLPrecision, |
+ "stitchData"); |
+ stitchDataUni = uniformHandler->getUniformCStr(fStitchDataUni); |
} |
// There are 4 lines, so the center of each line is 1/8, 3/8, 5/8 and 7/8 |
@@ -1171,22 +1172,23 @@ GrGLImprovedPerlinNoise::GrGLImprovedPerlinNoise(const GrProcessor& processor) |
void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) { |
GrGLSLFragmentBuilder* fsBuilder = args.fFragBuilder; |
+ GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
SkString vCoords = fsBuilder->ensureFSCoords2D(args.fCoords, 0); |
- fBaseFrequencyUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kVec2f_GrSLType, kDefault_GrSLPrecision, |
- "baseFrequency"); |
- const char* baseFrequencyUni = args.fBuilder->getUniformCStr(fBaseFrequencyUni); |
+ fBaseFrequencyUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kVec2f_GrSLType, kDefault_GrSLPrecision, |
+ "baseFrequency"); |
+ const char* baseFrequencyUni = uniformHandler->getUniformCStr(fBaseFrequencyUni); |
- fOctavesUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kFloat_GrSLType, kDefault_GrSLPrecision, |
- "octaves"); |
- const char* octavesUni = args.fBuilder->getUniformCStr(fOctavesUni); |
+ fOctavesUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kFloat_GrSLType, kDefault_GrSLPrecision, |
+ "octaves"); |
+ const char* octavesUni = uniformHandler->getUniformCStr(fOctavesUni); |
- fZUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kFloat_GrSLType, kDefault_GrSLPrecision, |
- "z"); |
- const char* zUni = args.fBuilder->getUniformCStr(fZUni); |
+ fZUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kFloat_GrSLType, kDefault_GrSLPrecision, |
+ "z"); |
+ const char* zUni = uniformHandler->getUniformCStr(fZUni); |
// fade function |
static const GrGLSLShaderVar fadeArgs[] = { |