Create GLSLUniformHandler class for gpu backend
BUG=skia:
Review URL: https://codereview.chromium.org/1490283004
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index fe91858..3370a76 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -19,8 +19,8 @@
#include "effects/GrTextureDomain.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
-#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLUniformHandler.h"
#endif
namespace {
@@ -549,9 +549,9 @@
void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) {
const GrTextureDomain& domain = args.fFp.cast<GrDisplacementMapEffect>().domain();
- fScaleUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kVec2f_GrSLType, kDefault_GrSLPrecision, "Scale");
- const char* scaleUni = args.fBuilder->getUniformCStr(fScaleUni);
+ fScaleUni = args.fUniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kVec2f_GrSLType, kDefault_GrSLPrecision, "Scale");
+ const char* scaleUni = args.fUniformHandler->getUniformCStr(fScaleUni);
const char* dColor = "dColor";
const char* cCoords = "cCoords";
const char* nearZero = "1e-6"; // Since 6.10352e−5 is the smallest half float, use
@@ -610,6 +610,7 @@
fragBuilder->codeAppend("-vec2(0.5));\t\t");
fGLDomain.sampleTexture(fragBuilder,
+ args.fUniformHandler,
args.fGLSLCaps,
domain,
args.fOutputColor,