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

Unified Diff: src/gpu/GrDefaultGeoProcFactory.cpp

Issue 1462123003: Create GrGLSLVaryingHandler class for program building (Closed) Base URL: https://skia.googlesource.com/skia.git@putCapsOnArgs
Patch Set: fix release builder 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 | « gyp/gpu.gypi ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultGeoProcFactory.cpp
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index 7b9213315d5cc869079b454dc02df01a4af69f73..85339ea9b5fedc3a413f39bd6dc57f681fb12356 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -12,6 +12,7 @@
#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
+#include "glsl/GrGLSLVarying.h"
#include "glsl/GrGLSLUtil.h"
/*
@@ -66,14 +67,15 @@ public:
GrGLSLGPBuilder* pb = args.fPB;
GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder;
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
+ GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
// emit attributes
- vertBuilder->emitAttributes(gp);
+ varyingHandler->emitAttributes(gp);
// Setup pass through color
if (!gp.colorIgnored()) {
if (gp.hasVertexColor()) {
- pb->addPassThroughAttribute(gp.inColor(), args.fOutputColor);
+ varyingHandler->addPassThroughAttribute(gp.inColor(), args.fOutputColor);
} else {
this->setupUniformColor(pb, fragBuilder, args.fOutputColor, &fColorUniform);
}
@@ -91,6 +93,7 @@ public:
// emit transforms with explicit local coords
this->emitTransforms(pb,
vertBuilder,
+ varyingHandler,
gpArgs->fPositionVar,
gp.inLocalCoords()->fName,
gp.localMatrix(),
@@ -100,6 +103,7 @@ public:
// transforms have already been applied to vertex attributes on the cpu
this->emitTransforms(pb,
vertBuilder,
+ varyingHandler,
gp.inLocalCoords()->fName,
args.fTransformsIn,
args.fTransformsOut);
@@ -107,6 +111,7 @@ public:
// emit transforms with position
this->emitTransforms(pb,
vertBuilder,
+ varyingHandler,
gpArgs->fPositionVar,
gp.inPosition()->fName,
gp.localMatrix(),
@@ -118,7 +123,7 @@ public:
if (!gp.coverageWillBeIgnored()) {
if (gp.hasVertexCoverage()) {
fragBuilder->codeAppendf("float alpha = 1.0;");
- args.fPB->addPassThroughAttribute(gp.inCoverage(), "alpha");
+ varyingHandler->addPassThroughAttribute(gp.inCoverage(), "alpha");
fragBuilder->codeAppendf("%s = vec4(alpha);", args.fOutputCoverage);
} else if (gp.coverage() == 0xff) {
fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage);
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698