Index: src/gpu/gl/GrGLGeometryProcessor.h |
diff --git a/src/gpu/gl/GrGLGeometryProcessor.h b/src/gpu/gl/GrGLGeometryProcessor.h |
index aa58cd3d97aa16b5a55a8f76f231f67bc09524c9..7f3ca73f6e34683d482089a6b2ff82460781c442 100644 |
--- a/src/gpu/gl/GrGLGeometryProcessor.h |
+++ b/src/gpu/gl/GrGLGeometryProcessor.h |
@@ -23,7 +23,9 @@ public: |
GrGLGeometryProcessor() {} |
virtual ~GrGLGeometryProcessor() {} |
+ typedef GrGLProgramDataManager::UniformHandle UniformHandle; |
typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray; |
+ |
struct EmitArgs { |
EmitArgs(GrGLGPBuilder* pb, |
const GrGeometryProcessor& gp, |
@@ -44,6 +46,7 @@ public: |
const char* fOutputCoverage; |
const TextureSamplerArray& fSamplers; |
}; |
+ |
/** |
* This is similar to emitCode() in the base class, except it takes a full shader builder. |
* This allows the effect subclass to emit vertex code. |
@@ -59,6 +62,22 @@ public: |
const GrGeometryProcessor&, |
const GrBatchTracker&) = 0; |
+ /* a helper for uploading uniform color */ |
bsalomon
2014/12/12 14:29:35
should these helpers be protected?
Could use some
|
+ void setUniformColorIfRequired(const GrGLProgramDataManager& pdman, GPInput output, |
bsalomon
2014/12/12 14:29:35
..., GPInput output, ...
head explodes
|
+ GrColor color, UniformHandle colorUniform) { |
+ if (kUniform_GPInput == output) { |
+ GrGLfloat c[4]; |
+ GrColorToRGBAFloat(color, c); |
+ pdman.set4fv(colorUniform, 1, c); |
+ } |
+ } |
+ |
+ /* a helper which can setup vertex, constant, or uniform color depending on outputType */ |
+ void setupColor(GrGLGPBuilder* pb, |
+ GPInput outputType, |
+ const char* outputName, |
+ const GrGeometryProcessor::GrAttribute* colorAttr, |
+ UniformHandle* colorUniform); |
private: |
typedef GrGLProcessor INHERITED; |
}; |