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

Unified Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 822423004: Move most of the transform logic into the primitive processors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 11 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 | « include/gpu/GrFragmentProcessor.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 784f685f64ee4df89ae1892516f86fee941d1217..069017515161b541efeeab0ea90af790c8a4eb0e 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -535,11 +535,14 @@ public:
const GrBatchTracker&)
: fColor(GrColor_ILLEGAL) {}
- void emitCode(const EmitArgs& args) SK_OVERRIDE {
+ void onEmitCode(EmitArgs& args) SK_OVERRIDE {
const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>();
GrGLGPBuilder* pb = args.fPB;
GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ // emit attributes
+ vsBuilder->emitAttributes(qe);
+
GrGLVertToFrag v(kVec4f_GrSLType);
args.fPB->addVarying("QuadEdge", &v);
vsBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.inQuadEdge()->fName);
@@ -550,16 +553,16 @@ public:
this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor, NULL,
&fColorUniform);
- // setup coord outputs
- vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), qe.inPosition()->fName);
- vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), qe.inPosition()->fName);
-
// setup uniform viewMatrix
this->addUniformViewMatrix(pb);
- // setup position varying
- vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(),
- this->uViewM(), qe.inPosition()->fName);
+ // Setup position
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", this->position(), this->uViewM(),
+ qe.inPosition()->fName);
+
+ // emit transforms
+ this->emitTransforms(args.fPB, this->position(), qe.inPosition()->fName,
+ qe.localMatrix(), args.fTransformsIn, args.fTransformsOut);
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
@@ -622,7 +625,8 @@ public:
GLProcessor::GenKey(*this, bt, caps, b);
}
- GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_OVERRIDE {
+ virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
+ const GrGLCaps&) const SK_OVERRIDE {
return SkNEW_ARGS(GLProcessor, (*this, bt));
}
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698