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

Unified Diff: src/gpu/glsl/GrGLSLGeometryProcessor.cpp

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/glsl/GrGLSLGeometryProcessor.h ('k') | src/gpu/glsl/GrGLSLPrimitiveProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLGeometryProcessor.cpp
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
index 8a1e81a1f8ee400bc1ff15df4eb9d915d93d258a..a8bd8ac4f82b14f9757e42465b0cf5aff0498e3e 100644
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
@@ -7,9 +7,10 @@
#include "GrGLSLGeometryProcessor.h"
+#include "GrCoordTransform.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProcessorTypes.h"
-#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLUniformHandler.h"
#include "glsl/GrGLSLVarying.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
@@ -20,9 +21,9 @@ void GrGLSLGeometryProcessor::emitCode(EmitArgs& args) {
vBuilder->transformToNormalizedDeviceSpace(gpArgs.fPositionVar);
}
-void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
- GrGLSLVertexBuilder* vb,
+void GrGLSLGeometryProcessor::emitTransforms(GrGLSLVertexBuilder* vb,
GrGLSLVaryingHandler* varyingHandler,
+ GrGLSLUniformHandler* uniformHandler,
const GrShaderVar& posVar,
const char* localCoords,
const SkMatrix& localMatrix,
@@ -49,10 +50,10 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
const char* uniName;
fInstalledTransforms[i][t].fHandle =
- pb->addUniform(GrGLSLProgramBuilder::kVertex_Visibility,
- kMat33f_GrSLType, precision,
- strUniName.c_str(),
- &uniName).toIndex();
+ uniformHandler->addUniform(GrGLSLUniformHandler::kVertex_Visibility,
+ kMat33f_GrSLType, precision,
+ strUniName.c_str(),
+ &uniName).toIndex();
SkString strVaryingName("MatrixCoord");
strVaryingName.appendf("_%i_%i", i, t);
@@ -94,8 +95,7 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
}
}
-void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
- GrGLSLVertexBuilder* vb,
+void GrGLSLGeometryProcessor::emitTransforms(GrGLSLVertexBuilder* vb,
GrGLSLVaryingHandler* varyingHandler,
const char* localCoords,
const TransformsIn& tin,
@@ -124,16 +124,15 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
}
}
-void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb,
- GrGLSLVertexBuilder* vertBuilder,
+void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder,
GrGPArgs* gpArgs,
const char* posName) {
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
}
-void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb,
- GrGLSLVertexBuilder* vertBuilder,
+void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder,
+ GrGLSLUniformHandler* uniformHandler,
GrGPArgs* gpArgs,
const char* posName,
const SkMatrix& mat,
@@ -143,10 +142,10 @@ void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb,
vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
} else {
const char* viewMatrixName;
- *viewMatrixUniform = pb->addUniform(GrGLSLProgramBuilder::kVertex_Visibility,
- kMat33f_GrSLType, kHigh_GrSLPrecision,
- "uViewM",
- &viewMatrixName);
+ *viewMatrixUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kVertex_Visibility,
+ kMat33f_GrSLType, kHigh_GrSLPrecision,
+ "uViewM",
+ &viewMatrixName);
if (!mat.hasPerspective()) {
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
vertBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));",
« no previous file with comments | « src/gpu/glsl/GrGLSLGeometryProcessor.h ('k') | src/gpu/glsl/GrGLSLPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698