Reland r6330 thru r6333 but do without enabling GL_ARB_fragment_coord_conventions on Intel GPUs.
git-svn-id: http://skia.googlecode.com/svn/trunk@6048 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index f143af3..aa88cf2 100644
--- a/src/gpu/gl/GrGLShaderBuilder.h
+++ b/src/gpu/gl/GrGLShaderBuilder.h
@@ -129,7 +129,7 @@
the generated shader code. This potentially allows greater reuse of cached shaders. */
static const GrGLenum* GetTexParamSwizzle(GrPixelConfig config, const GrGLCaps& caps);
- /** Add a uniform variable to the current program, that has visibilty in one or more shaders.
+ /** Add a uniform variable to the current program, that has visibility in one or more shaders.
visibility is a bitfield of ShaderType values indicating from which shaders the uniform
should be accessible. At least one bit must be set. Geometry shader uniforms are not
supported at this time. The actual uniform name will be mangled. If outName is not NULL then
@@ -151,7 +151,7 @@
const GrGLShaderVar& getUniformVariable(GrGLUniformManager::UniformHandle) const;
/**
- * Shorcut for getUniformVariable(u).c_str()
+ * Shortcut for getUniformVariable(u).c_str()
*/
const char* getUniformCStr(GrGLUniformManager::UniformHandle u) const {
return this->getUniformVariable(u).c_str();
@@ -165,6 +165,10 @@
const char** vsOutName = NULL,
const char** fsInName = NULL);
+ /** Returns a variable name that represents the position of the fragment in the FS. The position
+ is in device space (e.g. 0,0 is the top left and pixel centers are at half-integers). */
+ const char* fragmentPosition();
+
/** Called after building is complete to get the final shader string. */
void getShader(ShaderType, SkString*) const;
@@ -180,6 +184,8 @@
void setCurrentStage(int stage) { fCurrentStage = stage; }
void setNonStage() { fCurrentStage = kNonStageIdx; }
+ GrGLUniformManager::UniformHandle getRTHeightUniform() const { return fRTHeightUniform; }
+
private:
typedef GrTAllocator<GrGLShaderVar> VarArray;
@@ -211,10 +217,14 @@
kNonStageIdx = -1,
};
- const GrGLContextInfo& fContext;
- GrGLUniformManager& fUniformManager;
- int fCurrentStage;
- SkString fFSFunctions;
+ const GrGLContextInfo& fContext;
+ GrGLUniformManager& fUniformManager;
+ int fCurrentStage;
+ SkString fFSFunctions;
+ SkString fFSHeader;
+
+ bool fSetupFragPosition;
+ GrGLUniformManager::UniformHandle fRTHeightUniform;
/// Per-stage settings - only valid while we're inside GrGLProgram::genStageCode().
//@{