diff options
Diffstat (limited to 'src/gpu/gl/GrGLShaderBuilder.h')
-rw-r--r-- | src/gpu/gl/GrGLShaderBuilder.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h index 524a8853ca..9d64143802 100644 --- a/src/gpu/gl/GrGLShaderBuilder.h +++ b/src/gpu/gl/GrGLShaderBuilder.h @@ -17,6 +17,7 @@ #include <stdarg.h> class GrGLContextInfo; +class GrEffectStage; /** Contains all the incremental state of a shader as it is being built,as well as helpers to @@ -80,7 +81,7 @@ public: kFragment_ShaderType = 0x4, }; - GrGLShaderBuilder(const GrGLContextInfo&, GrGLUniformManager&); + GrGLShaderBuilder(const GrGLContextInfo&, GrGLUniformManager&, bool explicitLocalCoords); /** * Called by GrGLEffects to add code to one of the shaders. @@ -205,6 +206,16 @@ public: */ const GrGLShaderVar& positionAttribute() const { return *fPositionVar; } + /** Returns a vertex attribute that represents the local coords in the VS. This may be the same + as positionAttribute() or it may not be. It depends upon whether the rendering code + specified explicit local coords or not in the GrDrawState. */ + const GrGLShaderVar& localCoordsAttribute() const { return *fLocalCoordsVar; } + + /** + * Are explicit local coordinates provided as input to the vertex shader. + */ + bool hasExplicitLocalCoords() const { return (fLocalCoordsVar != fPositionVar); } + /** * Interfaces used by GrGLProgram. * TODO: Hide these from the GrEffects using friend or splitting this into two related classes. @@ -223,7 +234,6 @@ public: GrBackendEffectFactory::EffectKey key, const char* fsInColor, // NULL means no incoming color const char* fsOutColor, - const char* vsInCoord, SkTArray<GrGLUniformManager::UniformHandle, true>* samplerHandles); GrGLUniformManager::UniformHandle getRTHeightUniform() const { return fRTHeightUniform; } @@ -290,6 +300,8 @@ private: SkSTArray<10, AttributePair, true> fEffectAttributes; GrGLShaderVar* fPositionVar; + GrGLShaderVar* fLocalCoordsVar; + }; #endif |