Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / gl / GrGLProgram.h
index fb49685..ce7e6b0 100644 (file)
@@ -9,10 +9,10 @@
 #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"
@@ -20,9 +20,9 @@
 #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.
@@ -37,12 +37,13 @@ class GrGLProgram : public SkRefCnt {
 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();
 
@@ -51,11 +52,6 @@ public:
      */
     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; }
 
     /**
@@ -151,14 +147,16 @@ public:
     };
 
     /**
-     * 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*);
 
@@ -167,21 +165,21 @@ private:
 
     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;
@@ -190,6 +188,7 @@ private:
     int                                 fDstCopyTexUnit;
 
     BuiltinUniformHandles               fBuiltinUniformHandles;
+    SkAutoTUnref<GrGLProgramEffects>    fGeometryProcessor;
     SkAutoTUnref<GrGLProgramEffects>    fColorEffects;
     SkAutoTUnref<GrGLProgramEffects>    fCoverageEffects;
     GrGLuint                            fProgramID;