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

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

Issue 635533005: Revert of Cleanup of shader building system (Closed) Base URL: https://skia.googlesource.com/skia.git@solo_gp
Patch Set: Created 6 years, 2 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/GrGLShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLVertexShaderBuilder.h
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.h b/src/gpu/gl/builders/GrGLVertexShaderBuilder.h
index 0b85b84dfb6994642fff5152cbe42c3ce68b9c12..c93b3be6682c5252025a27233deb9ad3ea78f71b 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.h
@@ -7,21 +7,25 @@
#ifndef GrGLVertexShader_DEFINED
#define GrGLVertexShader_DEFINED
-
#include "GrGLShaderBuilder.h"
class GrGLProgramBuilder;
-// TODO we only actually ever need to return a GrGLShaderBuilder for this guy, none of the below
-// functions need to be part of VertexShaderBuilder's public interface
-class GrGLVertexBuilder : public GrGLShaderBuilder {
+class GrGLVertexShaderBuilder : public GrGLFullShaderBuilder {
public:
- GrGLVertexBuilder(GrGLProgramBuilder* program);
+ GrGLVertexShaderBuilder(GrGLFullProgramBuilder* program);
+
+ /*
+ * this call is only for GrGLProgramEffects' internal use
+ */
+ void emitAttributes(const GrGeometryProcessor& gp);
/**
* Are explicit local coordinates provided as input to the vertex shader.
*/
bool hasExplicitLocalCoords() const { return (fLocalCoordsVar != fPositionVar); }
+
+ const SkString* getEffectAttributeName(int attributeIndex) const;
/** Returns a vertex attribute that represents the local coords in the VS. This may be the same
as positionAttribute() or it may not be. It depends upon whether the rendering code
@@ -33,25 +37,28 @@
*/
const GrGLShaderVar& positionAttribute() const { return *fPositionVar; }
+private:
/*
- * Internal call for GrGLProgramBuilder.addVarying
+ * Add attribute will push a new attribute onto the end. It will also assert if there is
+ * a duplicate attribute
*/
- SkString* addVarying(GrSLType type, const char* name, const char** vsOutName);
+ bool addAttribute(const GrShaderVar& var);
+
+ /*
+ * Internal call for GrGLFullProgramBuilder.addVarying
+ */
+ void addVarying(GrSLType type,
+ const char* name,
+ const char** vsOutName);
/*
* private helpers for compilation by GrGLProgramBuilder
*/
- void setupLocalCoords();
- void transformGLToSkiaCoords();
- void setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr4* out);
- void emitAttributes(const GrGeometryProcessor& gp);
- void transformSkiaToGLCoords();
- void bindVertexAttributes(GrGLuint programID);
+ void bindProgramLocations(GrGLuint programId);
bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shaderIds) const;
+ void emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLExpr4* coverage);
+ void emitCodeAfterEffects();
-private:
- // an internal call which checks for uniquness of a var before adding it to the list of inputs
- bool addAttribute(const GrShaderVar& var);
struct AttributePair {
void set(int index, const SkString& name) {
fIndex = index; fName = name;
@@ -64,7 +71,9 @@
GrGLShaderVar* fLocalCoordsVar;
int fEffectAttribOffset;
- typedef GrGLShaderBuilder INHERITED;
+ friend class GrGLFullProgramBuilder;
+
+ typedef GrGLFullShaderBuilder INHERITED;
};
#endif
« no previous file with comments | « src/gpu/gl/builders/GrGLShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698