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

Unified Diff: src/gpu/gl/GrGLProgramDataManager.cpp

Issue 611653002: 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/GrGLProgramDataManager.h ('k') | src/gpu/gl/GrGLProgramDesc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDataManager.cpp
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index c53abd79abe3a3774129c8aff17b75201e556a19..f8d996b542e0cd8c11f33dd27bebb5fc73f67a4e 100644
--- a/src/gpu/gl/GrGLProgramDataManager.cpp
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp
@@ -5,9 +5,7 @@
* found in the LICENSE file.
*/
-#include "gl/builders/GrGLProgramBuilder.h"
#include "gl/GrGLPathRendering.h"
-#include "gl/GrGLProgram.h"
#include "gl/GrGLUniformHandle.h"
#include "gl/GrGpuGL.h"
#include "SkMatrix.h"
@@ -16,16 +14,13 @@
SkASSERT(arrayCount <= uni.fArrayCount || \
(1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
-GrGLProgramDataManager::GrGLProgramDataManager(GrGpuGL* gpu,
- GrGLProgram* program,
- const GrGLProgramBuilder& builder)
- : fGpu(gpu),
- fProgram(program) {
- int count = builder.getUniformInfos().count();
+GrGLProgramDataManager::GrGLProgramDataManager(GrGpuGL* gpu, const UniformInfoArray& uniforms)
+ : fGpu(gpu) {
+ int count = uniforms.count();
fUniforms.push_back_n(count);
for (int i = 0; i < count; i++) {
Uniform& uniform = fUniforms[i];
- const GrGLProgramBuilder::UniformInfo& builderUniform = builder.getUniformInfos()[i];
+ const UniformInfo& builderUniform = uniforms[i];
SkASSERT(GrGLShaderVar::kNonArray == builderUniform.fVariable.getArrayCount() ||
builderUniform.fVariable.getArrayCount() > 0);
SkDEBUGCODE(
@@ -38,26 +33,13 @@ GrGLProgramDataManager::GrGLProgramDataManager(GrGpuGL* gpu,
uniform.fVSLocation = builderUniform.fLocation;
} else {
uniform.fVSLocation = kUnusedUniform;
- }
+ }
if (GrGLProgramBuilder::kFragment_Visibility & builderUniform.fVisibility) {
uniform.fFSLocation = builderUniform.fLocation;
} else {
uniform.fFSLocation = kUnusedUniform;
}
}
-
- count = builder.getSeparableVaryingInfos().count();
- fVaryings.push_back_n(count);
- for (int i = 0; i < count; i++) {
- Varying& varying = fVaryings[i];
- const GrGLProgramBuilder::SeparableVaryingInfo& builderVarying =
- builder.getSeparableVaryingInfos()[i];
- SkASSERT(GrGLShaderVar::kNonArray == builderVarying.fVariable.getArrayCount());
- SkDEBUGCODE(
- varying.fType = builderVarying.fVariable.getType();
- );
- varying.fLocation = builderVarying.fLocation;
- }
}
void GrGLProgramDataManager::setSampler(UniformHandle u, GrGLint texUnit) const {
@@ -276,14 +258,3 @@ void GrGLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix
};
this->setMatrix3f(u, mt);
}
-
-void GrGLProgramDataManager::setProgramPathFragmentInputTransform(VaryingHandle i,
- unsigned components,
- const SkMatrix& matrix) const {
- const Varying& fragmentInput = fVaryings[i.toProgramDataIndex()];
- fGpu->glPathRendering()->setProgramPathFragmentInputTransform(fProgram->programID(),
- fragmentInput.fLocation,
- GR_GL_OBJECT_LINEAR,
- components,
- matrix);
-}
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.h ('k') | src/gpu/gl/GrGLProgramDesc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698