aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLShaderBuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLShaderBuilder.h')
-rw-r--r--src/gpu/gl/GrGLShaderBuilder.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index bf308f3fbe..5884a90f85 100644
--- a/src/gpu/gl/GrGLShaderBuilder.h
+++ b/src/gpu/gl/GrGLShaderBuilder.h
@@ -12,8 +12,7 @@
#include "gl/GrGLShaderVar.h"
#include "gl/GrGLSL.h"
-typedef GrTAllocator<GrGLShaderVar> VarArray;
-
+class GrGLContextInfo;
/**
Contains all the incremental state of a shader as it is being built,as well as helpers to
manipulate that state.
@@ -23,6 +22,7 @@ typedef GrTAllocator<GrGLShaderVar> VarArray;
class GrGLShaderBuilder {
public:
+ typedef GrTAllocator<GrGLShaderVar> VarArray;
enum ShaderType {
kVertex_ShaderType = 0x1,
@@ -30,7 +30,7 @@ public:
kFragment_ShaderType = 0x4,
};
- GrGLShaderBuilder();
+ GrGLShaderBuilder(const GrGLContextInfo&);
void computeSwizzle(uint32_t configFlags);
void computeModulate(const char* fsInColor);
@@ -56,7 +56,6 @@ public:
void emitDefaultFetch(const char* outColor,
const char* samplerName);
-
/** Add a uniform variable to the current program, that has visibilty in one or more shaders.
If stageNum is specified, it is appended to the name to guarantee uniqueness; if count is
specified, the uniform is an array. visibility is a bitfield of ShaderType values indicating
@@ -86,6 +85,9 @@ public:
const char** vsOutName = NULL,
const char** fsInName = NULL);
+ /** Called after building is complete to get the final shader string. */
+ void getShader(ShaderType, SkString*) const;
+
// TODO: Everything below here private.
SkString fHeader; // VS+FS, GLSL version, etc
@@ -122,6 +124,8 @@ public:
//@}
+private:
+ const GrGLContextInfo& fContext;
};
#endif