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

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

Issue 1490283004: Create GLSLUniformHandler class for gpu backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up public api of uniformhandler Created 5 years 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/GrGLVaryingHandler.h ('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 329e5d7d08158221e68ebd481e6411bb54e791c8..cbec5a9863539b125b75560ed6de8e5f55647782 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -10,6 +10,7 @@
#include "GrPipeline.h"
#include "gl/GrGLProgramDataManager.h"
+#include "gl/GrGLUniformHandler.h"
#include "gl/GrGLVaryingHandler.h"
#include "glsl/GrGLSLPrimitiveProcessor.h"
#include "glsl/GrGLSLProgramBuilder.h"
@@ -58,32 +59,13 @@ public:
*/
static GrGLProgram* CreateProgram(const DrawArgs&, GrGLGpu*);
- const GrGLSLShaderVar& getUniformVariable(UniformHandle u) const override {
- return fUniforms[u.toIndex()].fVariable;
- }
-
- const char* getUniformCStr(UniformHandle u) const override {
- return this->getUniformVariable(u).c_str();
- }
-
const GrGLSLCaps* glslCaps() const override;
GrGLGpu* gpu() const { return fGpu; }
private:
- typedef GrGLProgramDataManager::UniformInfo UniformInfo;
- typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray;
-
GrGLProgramBuilder(GrGLGpu*, const DrawArgs&);
- UniformHandle internalAddUniformArray(uint32_t visibility,
- GrSLType type,
- GrSLPrecision precision,
- const char* name,
- bool mangleName,
- int arrayCount,
- const char** outName) override;
-
// Generates a possibly mangled name for a stage variable and writes it to the fragment shader.
// If GrGLSLExpr4 has a valid name then it will use that instead
void nameExpression(GrGLSLExpr4*, const char* baseName);
@@ -133,8 +115,8 @@ private:
// Subclasses create different programs
GrGLProgram* createProgram(GrGLuint programID);
- void onAppendUniformDecls(ShaderVisibility visibility, SkString* out) const override;
-
+ GrGLSLUniformHandler* uniformHandler() override { return &fUniformHandler; }
+ const GrGLSLUniformHandler* uniformHandler() const override { return &fUniformHandler; }
GrGLSLVaryingHandler* varyingHandler() override { return &fVaryingHandler; }
// reset is called by program creator between each processor's emit code. It increments the
@@ -164,14 +146,13 @@ private:
SkAutoTUnref<GrGLInstalledFragProcs> fFragmentProcessors;
GrGLGpu* fGpu;
- UniformInfoArray fUniforms;
GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms;
GrGLSLPrimitiveProcessor::TransformsOut fOutCoords;
+ typedef GrGLSLUniformHandler::UniformHandle UniformHandle;
SkTArray<UniformHandle> fSamplerUniforms;
GrGLVaryingHandler fVaryingHandler;
-
- friend class GrGLVaryingHandler;
+ GrGLUniformHandler fUniformHandler;
typedef GrGLSLProgramBuilder INHERITED;
};
« no previous file with comments | « src/gpu/gl/GrGLVaryingHandler.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698