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

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

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 c9f8c7138355afe9161019dd537afc88dfc8fca5..706a8a846175a0fea6679a3ec15b9db3258f4370 100644
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
@@ -13,19 +13,19 @@
#include "glsl/GrGLSLVertexShaderBuilder.h"
void GrGLSLGeometryProcessor::emitCode(EmitArgs& args) {
- GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vBuilder = args.fVertBuilder;
GrGPArgs gpArgs;
this->onEmitCode(args, &gpArgs);
- vsBuilder->transformToNormalizedDeviceSpace(gpArgs.fPositionVar);
+ vBuilder->transformToNormalizedDeviceSpace(gpArgs.fPositionVar);
}
void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
+ GrGLSLVertexBuilder* vb,
const GrShaderVar& posVar,
const char* localCoords,
const SkMatrix& localMatrix,
const TransformsIn& tin,
TransformsOut* tout) {
- GrGLSLVertexBuilder* vb = pb->getVertexShaderBuilder();
tout->push_back_n(tin.count());
fInstalledTransforms.push_back_n(tin.count());
for (int i = 0; i < tin.count(); i++) {
@@ -93,10 +93,10 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
}
void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
+ GrGLSLVertexBuilder* vb,
const char* localCoords,
const TransformsIn& tin,
TransformsOut* tout) {
- GrGLSLVertexBuilder* vb = pb->getVertexShaderBuilder();
tout->push_back_n(tin.count());
for (int i = 0; i < tin.count(); i++) {
const ProcCoords& coordTransforms = tin[i];
@@ -122,22 +122,22 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb,
}
void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb,
+ GrGLSLVertexBuilder* vertBuilder,
GrGPArgs* gpArgs,
const char* posName) {
- GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
- vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
+ vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
}
void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb,
+ GrGLSLVertexBuilder* vertBuilder,
GrGPArgs* gpArgs,
const char* posName,
const SkMatrix& mat,
UniformHandle* viewMatrixUniform) {
- GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
if (mat.isIdentity()) {
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
- vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
+ vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
} else {
const char* viewMatrixName;
*viewMatrixUniform = pb->addUniform(GrGLSLProgramBuilder::kVertex_Visibility,
@@ -146,12 +146,12 @@ void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb,
&viewMatrixName);
if (!mat.hasPerspective()) {
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
- vsBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));",
- gpArgs->fPositionVar.c_str(), viewMatrixName, posName);
+ vertBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));",
+ gpArgs->fPositionVar.c_str(), viewMatrixName, posName);
} else {
gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3");
- vsBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);",
- gpArgs->fPositionVar.c_str(), viewMatrixName, posName);
+ vertBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);",
+ gpArgs->fPositionVar.c_str(), viewMatrixName, posName);
}
}
}
« 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