#ifndef GrGLProgram_DEFINED
#define GrGLProgram_DEFINED
+#include "builders/GrGLProgramBuilder.h"
#include "GrDrawState.h"
#include "GrGLContext.h"
#include "GrGLProgramDesc.h"
-#include "GrGLShaderBuilder.h"
#include "GrGLSL.h"
#include "GrGLTexture.h"
#include "GrGLProgramDataManager.h"
#include "SkString.h"
#include "SkXfermode.h"
-class GrGLEffect;
+class GrGLProcessor;
class GrGLProgramEffects;
-class GrGLShaderBuilder;
+class GrGLProgramBuilder;
/**
* This class manages a GPU program and records per-program information.
public:
SK_DECLARE_INST_COUNT(GrGLProgram)
- typedef GrGLShaderBuilder::BuiltinUniformHandles BuiltinUniformHandles;
+ typedef GrGLProgramBuilder::BuiltinUniformHandles BuiltinUniformHandles;
static GrGLProgram* Create(GrGpuGL* gpu,
const GrGLProgramDesc& desc,
- const GrEffectStage* colorStages[],
- const GrEffectStage* coverageStages[]);
+ const GrGeometryStage* geometryProcessor,
+ const GrFragmentStage* colorStages[],
+ const GrFragmentStage* coverageStages[]);
virtual ~GrGLProgram();
*/
void abandon();
- /**
- * The shader may modify the blend coefficients. Params are in/out.
- */
- void overrideBlend(GrBlendCoeff* srcCoeff, GrBlendCoeff* dstCoeff) const;
-
const GrGLProgramDesc& getDesc() { return fDesc; }
/**
};
/**
- * This function uploads uniforms and calls each GrGLEffect's setData. It is called before a
+ * This function uploads uniforms and calls each GrGLProcessor's setData. It is called before a
* draw occurs using the program after the program has already been bound. It also uses the
- * GrGpuGL object to bind the textures required by the GrGLEffects. The color and coverage
+ * GrGpuGL object to bind the textures required by the GrGLProcessors. The color and coverage
* stages come from GrGLProgramDesc::Build().
*/
- void setData(GrDrawState::BlendOptFlags,
- const GrEffectStage* colorStages[],
- const GrEffectStage* coverageStages[],
+ void setData(const GrOptDrawState&,
+ GrGpu::DrawType,
+ const GrGeometryStage* geometryProcessor,
+ const GrFragmentStage* colorStages[],
+ const GrFragmentStage* coverageStages[],
const GrDeviceCoordTexture* dstCopy, // can be NULL
SharedGLState*);
GrGLProgram(GrGpuGL*,
const GrGLProgramDesc&,
- const GrGLShaderBuilder&);
+ const GrGLProgramBuilder&);
// Sets the texture units for samplers.
void initSamplerUniforms();
// Helper for setData(). Makes GL calls to specify the initial color when there is not
// per-vertex colors.
- void setColor(const GrDrawState&, GrColor color, SharedGLState*);
+ void setColor(const GrOptDrawState&, GrColor color, SharedGLState*);
// Helper for setData(). Makes GL calls to specify the initial coverage when there is not
// per-vertex coverages.
- void setCoverage(const GrDrawState&, GrColor coverage, SharedGLState*);
+ void setCoverage(const GrOptDrawState&, GrColor coverage, SharedGLState*);
// Helper for setData() that sets the view matrix and loads the render target height uniform
- void setMatrixAndRenderTargetHeight(const GrDrawState&);
+ void setMatrixAndRenderTargetHeight(GrGpu::DrawType drawType, const GrOptDrawState&);
// these reflect the current values of uniforms (GL uniform values travel with program)
MatrixState fMatrixState;
int fDstCopyTexUnit;
BuiltinUniformHandles fBuiltinUniformHandles;
+ SkAutoTUnref<GrGLProgramEffects> fGeometryProcessor;
SkAutoTUnref<GrGLProgramEffects> fColorEffects;
SkAutoTUnref<GrGLProgramEffects> fCoverageEffects;
GrGLuint fProgramID;