Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Unified Diff: src/gpu/gl/builders/GrGLFullProgramBuilder.h

Issue 551253004: Changes to remove program effects builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLFullProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLFullProgramBuilder.h
diff --git a/src/gpu/gl/builders/GrGLFullProgramBuilder.h b/src/gpu/gl/builders/GrGLFullProgramBuilder.h
index 3ba5724578a97acd7bb620bdf9677e1ad9a3f1e7..7480ff3858b56f351fd3d136b1751e44c39645a2 100644
--- a/src/gpu/gl/builders/GrGLFullProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLFullProgramBuilder.h
@@ -10,6 +10,8 @@
#include "GrGLProgramBuilder.h"
+class GrGLVertexProgramEffects;
+
class GrGLFullProgramBuilder : public GrGLProgramBuilder {
public:
GrGLFullProgramBuilder(GrGpuGL*, const GrGLProgramDesc&);
@@ -37,39 +39,45 @@ public:
GrGLVertexShaderBuilder* getVertexShaderBuilder() { return &fVS; }
private:
- virtual void emitCodeBeforeEffects(GrGLSLExpr4* color,
- GrGLSLExpr4* coverage) SK_OVERRIDE;
-
- virtual void emitGeometryProcessor(const GrEffectStage* geometryProcessor,
- GrGLSLExpr4* coverage) SK_OVERRIDE;
-
- virtual GrGLProgramEffects* createAndEmitEffects(const GrEffectStage* effectStages[],
- int effectCnt,
- const GrGLProgramDesc::EffectKeyProvider&,
- GrGLSLExpr4* inOutFSColor) SK_OVERRIDE;
-
- /*
- * These functions are temporary and will eventually operate not on effects but on
- * geometry processors
+ virtual void createAndEmitEffects(const GrEffectStage* geometryProcessor,
+ const GrEffectStage* colorStages[],
+ const GrEffectStage* coverageStages[],
+ GrGLSLExpr4* inputColor,
+ GrGLSLExpr4* inputCoverage) SK_OVERRIDE;
+
+ GrGLProgramEffects* onCreateAndEmitEffects(const GrEffectStage* effectStages[],
+ int effectCnt,
+ const GrGLProgramDesc::EffectKeyProvider&,
+ GrGLSLExpr4* inOutFSColor);
+
+ virtual void emitEffect(const GrEffectStage& stage,
+ const GrEffectKey& key,
+ const char* outColor,
+ const char* inColor,
+ int stageIndex) SK_OVERRIDE;
+
+ /**
+ * Helper for emitEffect(). Emits code to implement an effect's coord transforms in the VS.
+ * Varyings are added as an outputs of the VS and inputs to the FS. The varyings may be either a
+ * vec2f or vec3f depending upon whether perspective interpolation is required or not. The names
+ * of the varyings in the VS and FS as well their types are appended to the
+ * TransformedCoordsArray* object, which is in turn passed to the effect's emitCode() function.
*/
- void createAndEmitEffect(GrGLProgramEffectsBuilder*,
- const GrEffectStage* effectStage,
- const GrGLProgramDesc::EffectKeyProvider&,
- GrGLSLExpr4* inOutFSColor);
-
- GrGLProgramEffects* createAndEmitEffect(const GrEffectStage* geometryProcessor,
- const GrGLProgramDesc::EffectKeyProvider&,
- GrGLSLExpr4* inOutFSColor);
-
- virtual void emitCodeAfterEffects() SK_OVERRIDE;
+ void emitTransforms(const GrEffectStage& effectStage,
+ GrGLEffect::TransformedCoordsArray* outCoords);
virtual bool compileAndAttachShaders(GrGLuint programId,
SkTDArray<GrGLuint>* shaderIds) const SK_OVERRIDE;
virtual void bindProgramLocations(GrGLuint programId) SK_OVERRIDE;
+ virtual GrGLProgramEffects* getProgramEffects() SK_OVERRIDE { return fProgramEffects.get(); }
+
+ typedef GrGLProgramDesc::EffectKeyProvider EffectKeyProvider;
+
GrGLGeometryShaderBuilder fGS;
GrGLVertexShaderBuilder fVS;
+ SkAutoTDelete<GrGLVertexProgramEffects> fProgramEffects;
typedef GrGLProgramBuilder INHERITED;
};
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLFullProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698