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

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

Issue 1431433003: Move shader compiling to ProgramBuilder and various ShaderBuilder cleanups. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 5 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/GrGLProgramBuilder.cpp ('k') | src/gpu/gl/builders/GrGLShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLShaderBuilder.h
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.h b/src/gpu/gl/builders/GrGLShaderBuilder.h
index b5efbf4f893fabf891fbedca7c02579daab7a6f7..2daea1515b622af2f34fe8a412b472e9bea279ee 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.h
@@ -8,16 +8,12 @@
#ifndef GrGLShaderBuilder_DEFINED
#define GrGLShaderBuilder_DEFINED
-#include "SkTArray.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLProgramDesc.h"
-#include "gl/GrGLProgramDataManager.h"
-#include "gl/GrGLTypes.h"
+#include "GrAllocator.h"
+#include "glsl/GrGLSLShaderVar.h"
+#include "SkTDArray.h"
#include <stdarg.h>
-class GrGLCaps;
-class GrGLContextInfo;
class GrGLProgramBuilder;
class GrGLSLTextureSampler;
@@ -27,6 +23,7 @@ class GrGLSLTextureSampler;
class GrGLShaderBuilder {
public:
GrGLShaderBuilder(GrGLProgramBuilder* program);
+ virtual ~GrGLShaderBuilder() {}
void addInput(const GrGLSLShaderVar& input) { fInputs.push_back(input); }
void addOutput(const GrGLSLShaderVar& output) { fOutputs.push_back(output); }
@@ -65,10 +62,6 @@ public:
const char* coordName,
GrSLType coordType = kVec2f_GrSLType);
- /** If texture swizzling is available using tex parameters then it is preferred over mangling
- the generated shader code. This potentially allows greater reuse of cached shaders. */
- static const GrGLenum* GetTexParamSwizzle(GrPixelConfig config, const GrGLCaps& caps);
-
/**
* Called by GrGLProcessors to add code to one of the shaders.
*/
@@ -102,6 +95,11 @@ public:
SkString* outName);
/*
+ * Combines the various parts of the shader to create a single finalized shader string.
+ */
+ void finalize(uint32_t visibility);
+
+ /*
* Get parent builder for adding uniforms
*/
GrGLProgramBuilder* getProgramBuilder() { return fProgramBuilder; }
@@ -173,7 +171,8 @@ protected:
SkString& functions() { return fShaderStrings[kFunctions]; }
SkString& main() { return fShaderStrings[kMain]; }
SkString& code() { return fShaderStrings[fCodeIndex]; }
- bool finalize(GrGLuint programId, GrGLenum type, SkTDArray<GrGLuint>* shaderIds);
+
+ virtual void onFinalize() = 0;
enum {
kVersionDecl,
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | src/gpu/gl/builders/GrGLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698