Expose vertex position to GrGLEffect via GrGLShaderBuilder.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6814054
git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6195 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index 8f5d695..6fdec63 100644
--- a/src/gpu/gl/GrGLShaderBuilder.h
+++ b/src/gpu/gl/GrGLShaderBuilder.h
@@ -170,6 +170,11 @@
is in device space (e.g. 0,0 is the top left and pixel centers are at half-integers). */
const char* fragmentPosition();
+ /** Returns a vertex attribute that represents the vertex position in the VS. This is the
+ pre-matrix position and is commonly used by effects to compute texture coords via a matrix.
+ */
+ const GrGLShaderVar& positionAttribute() const { return *fPositionVar; }
+
/** Called after building is complete to get the final shader string. */
void getShader(ShaderType, SkString*) const;
@@ -227,6 +232,8 @@
bool fSetupFragPosition;
GrGLUniformManager::UniformHandle fRTHeightUniform;
+ GrGLShaderVar* fPositionVar;
+
/// Per-stage settings - only valid while we're inside GrGLProgram::genStageCode().
//@{
GrSLType fTexCoordVaryingType; // the type, either Vec2f or Vec3f, of the coords passed