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

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

Issue 576543005: Breaking out full program and frag only (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/gpu/gl/builders/GrGLFullProgramBuilder.h
diff --git a/src/gpu/gl/builders/GrGLFullProgramBuilder.h b/src/gpu/gl/builders/GrGLFullProgramBuilder.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ba5724578a97acd7bb620bdf9677e1ad9a3f1e7
--- /dev/null
+++ b/src/gpu/gl/builders/GrGLFullProgramBuilder.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLFullProgramBuilder_DEFINED
+#define GrGLFullProgramBuilder_DEFINED
+
+#include "GrGLProgramBuilder.h"
+
+class GrGLFullProgramBuilder : public GrGLProgramBuilder {
+public:
+ GrGLFullProgramBuilder(GrGpuGL*, const GrGLProgramDesc&);
+
+ /** Add a varying variable to the current program to pass values between vertex and fragment
+ shaders. If the last two parameters are non-NULL, they are filled in with the name
+ generated. */
+ void addVarying(GrSLType type,
+ const char* name,
+ const char** vsOutName = NULL,
+ const char** fsInName = NULL,
+ GrGLShaderVar::Precision fsPrecision=GrGLShaderVar::kDefault_Precision);
+
+ /** Add a separable varying input variable to the current program.
+ * A separable varying (fragment shader input) is a varying that can be used also when vertex
+ * shaders are not used. With a vertex shader, the operation is same as with other
+ * varyings. Without a vertex shader, such as with NV_path_rendering, GL APIs are used to
+ * populate the variable. The APIs can refer to the variable through the returned handle.
+ */
+ VaryingHandle addSeparableVarying(GrSLType type,
+ const char* name,
+ const char** vsOutName,
+ const char** fsInName);
+
+ 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
+ */
+ 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;
+
+ virtual bool compileAndAttachShaders(GrGLuint programId,
+ SkTDArray<GrGLuint>* shaderIds) const SK_OVERRIDE;
+
+ virtual void bindProgramLocations(GrGLuint programId) SK_OVERRIDE;
+
+ GrGLGeometryShaderBuilder fGS;
+ GrGLVertexShaderBuilder fVS;
+
+ typedef GrGLProgramBuilder INHERITED;
+};
+
+#endif
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentOnlyProgramBuilder.cpp ('k') | src/gpu/gl/builders/GrGLFullProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698