Index: src/gpu/GrDefaultGeoProcFactory.cpp |
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp |
index 85339ea9b5fedc3a413f39bd6dc57f681fb12356..25da4dcae92724485c12dda7587ce23f6fb3c034 100644 |
--- a/src/gpu/GrDefaultGeoProcFactory.cpp |
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp |
@@ -10,9 +10,9 @@ |
#include "GrInvariantOutput.h" |
#include "glsl/GrGLSLFragmentShaderBuilder.h" |
#include "glsl/GrGLSLGeometryProcessor.h" |
-#include "glsl/GrGLSLProgramBuilder.h" |
#include "glsl/GrGLSLVertexShaderBuilder.h" |
#include "glsl/GrGLSLVarying.h" |
+#include "glsl/GrGLSLUniformHandler.h" |
#include "glsl/GrGLSLUtil.h" |
/* |
@@ -64,10 +64,10 @@ public: |
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { |
const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); |
- GrGLSLGPBuilder* pb = args.fPB; |
GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder; |
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; |
GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; |
+ GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
// emit attributes |
varyingHandler->emitAttributes(gp); |
@@ -77,13 +77,14 @@ public: |
if (gp.hasVertexColor()) { |
varyingHandler->addPassThroughAttribute(gp.inColor(), args.fOutputColor); |
} else { |
- this->setupUniformColor(pb, fragBuilder, args.fOutputColor, &fColorUniform); |
+ this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, |
+ &fColorUniform); |
} |
} |
// Setup position |
- this->setupPosition(pb, |
- vertBuilder, |
+ this->setupPosition(vertBuilder, |
+ uniformHandler, |
gpArgs, |
gp.inPosition()->fName, |
gp.viewMatrix(), |
@@ -91,9 +92,9 @@ public: |
if (gp.hasExplicitLocalCoords()) { |
// emit transforms with explicit local coords |
- this->emitTransforms(pb, |
- vertBuilder, |
+ this->emitTransforms(vertBuilder, |
varyingHandler, |
+ uniformHandler, |
gpArgs->fPositionVar, |
gp.inLocalCoords()->fName, |
gp.localMatrix(), |
@@ -101,17 +102,16 @@ public: |
args.fTransformsOut); |
} else if(gp.hasTransformedLocalCoords()) { |
// transforms have already been applied to vertex attributes on the cpu |
- this->emitTransforms(pb, |
- vertBuilder, |
+ this->emitTransforms(vertBuilder, |
varyingHandler, |
gp.inLocalCoords()->fName, |
args.fTransformsIn, |
args.fTransformsOut); |
} else { |
// emit transforms with position |
- this->emitTransforms(pb, |
- vertBuilder, |
+ this->emitTransforms(vertBuilder, |
varyingHandler, |
+ uniformHandler, |
gpArgs->fPositionVar, |
gp.inPosition()->fName, |
gp.localMatrix(), |
@@ -129,11 +129,12 @@ public: |
fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage); |
} else { |
const char* fragCoverage; |
- fCoverageUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kFloat_GrSLType, |
- kDefault_GrSLPrecision, |
- "Coverage", |
- &fragCoverage); |
+ fCoverageUniform = uniformHandler->addUniform( |
+ GrGLSLUniformHandler::kFragment_Visibility, |
+ kFloat_GrSLType, |
+ kDefault_GrSLPrecision, |
+ "Coverage", |
+ &fragCoverage); |
fragBuilder->codeAppendf("%s = vec4(%s);", args.fOutputCoverage, fragCoverage); |
} |
} |