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

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

Issue 1186113007: Refactor separable varying location info to be stored in GrGLProgram subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 6 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/GrGLPathProgramBuilder.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.h
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 4cfe0286d8f0829f7f57b7b68bdb972e97a46be2..4b784aceea0aefc90d042626ed46aeaf3e0a9b50 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -12,6 +12,7 @@
#include "GrGLGeometryShaderBuilder.h"
#include "GrGLVertexShaderBuilder.h"
#include "../GrGLProgramDataManager.h"
+#include "../GrGLPathProgramDataManager.h"
#include "../GrGLUniformHandle.h"
#include "../GrGLPrimitiveProcessor.h"
#include "../GrGLXferProcessor.h"
@@ -39,6 +40,7 @@ public:
virtual ~GrGLUniformBuilder() {}
typedef GrGLProgramDataManager::UniformHandle UniformHandle;
+ typedef GrGLPathProgramDataManager::SeparableVaryingHandle SeparableVaryingHandle;
/** Add a uniform variable to the current program, that has visibility in one or more shaders.
visibility is a bitfield of ShaderVisibility values indicating from which shaders the
@@ -154,6 +156,13 @@ public:
virtual void addPassThroughAttribute(const GrGeometryProcessor::Attribute*,
const char* output) = 0;
+ /*
+ * Creates a fragment shader varying that can be referred to.
+ * Comparable to GrGLUniformBuilder::addUniform().
+ */
+ virtual SeparableVaryingHandle addSeparableVarying(
+ const char* name, GrGLVertToFrag*, GrSLPrecision fsPrecision = kDefault_GrSLPrecision) = 0;
+
// TODO rename getFragmentBuilder
virtual GrGLFragmentBuilder* getFragmentShaderBuilder() = 0;
virtual GrGLVertexBuilder* getVertexShaderBuilder() = 0;
@@ -252,6 +261,10 @@ public:
void addPassThroughAttribute(const GrPrimitiveProcessor::Attribute*,
const char* output) override;
+ SeparableVaryingHandle addSeparableVarying(
+ const char* name,
+ GrGLVertToFrag*,
+ GrSLPrecision fsPrecision = kDefault_GrSLPrecision) override;
// Handles for program uniforms (other than per-effect uniforms)
struct BuiltinUniformHandles {
@@ -315,9 +328,9 @@ protected:
GrGLInstalledProc<Proc>*);
GrGLProgram* finalize();
- void bindUniformLocations(GrGLuint programID);
+ void bindProgramResourceLocations(GrGLuint programID);
bool checkLinkStatus(GrGLuint programID);
- void resolveUniformLocations(GrGLuint programID);
+ virtual void resolveProgramResourceLocations(GrGLuint programID);
void cleanupProgram(GrGLuint programID, const SkTDArray<GrGLuint>& shaderIDs);
void cleanupShaders(const SkTDArray<GrGLuint>& shaderIDs);
« no previous file with comments | « src/gpu/gl/builders/GrGLPathProgramBuilder.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698