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

Unified Diff: src/gpu/effects/GrBitmapTextGeoProc.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 | « src/gpu/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBitmapTextGeoProc.cpp
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 1cfb64414bed22846674a7e4b23389a8601d2dc7..0818fc0d8cff51ded070e6d6d46286108dba885b 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -25,13 +25,16 @@ public:
GrGLBitmapTextGeoProc(const GrGeometryProcessor&, const GrBatchTracker&)
: fColor(GrColor_ILLEGAL) {}
- void emitCode(const EmitArgs& args) SK_OVERRIDE {
+ void onEmitCode(EmitArgs& args) SK_OVERRIDE {
const GrBitmapTextGeoProc& cte = args.fGP.cast<GrBitmapTextGeoProc>();
const BitmapTextBatchTracker& local = args.fBT.cast<BitmapTextBatchTracker>();
GrGLGPBuilder* pb = args.fPB;
GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ // emit attributes
+ vsBuilder->emitAttributes(cte);
+
GrGLVertToFrag v(kVec2f_GrSLType);
pb->addVarying("TextureCoords", &v);
vsBuilder->codeAppendf("%s = %s;", v.vsOut(), cte.inTextureCoords()->fName);
@@ -40,17 +43,17 @@ public:
this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor, cte.inColor(),
&fColorUniform);
- // setup output coords
- vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), cte.inPosition()->fName);
- vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), cte.inPosition()->fName);
-
// setup uniform viewMatrix
this->addUniformViewMatrix(pb);
- // setup position varying
- vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), this->uViewM(),
+ // Setup position
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", this->position(), this->uViewM(),
cte.inPosition()->fName);
+ // emit transforms
+ this->emitTransforms(args.fPB, this->position(), cte.inPosition()->fName,
+ cte.localMatrix(), args.fTransformsIn, args.fTransformsOut);
+
GrGLGPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
fsBuilder->codeAppendf("%s = ", args.fOutputCoverage);
fsBuilder->appendTextureLookup(args.fSamplers[0], v.fsIn(), kVec2f_GrSLType);
@@ -135,8 +138,9 @@ void GrBitmapTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
GrGLBitmapTextGeoProc::GenKey(*this, bt, caps, b);
}
-GrGLGeometryProcessor*
-GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt) const {
+GrGLPrimitiveProcessor*
+GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt,
+ const GrGLCaps& caps) const {
return SkNEW_ARGS(GrGLBitmapTextGeoProc, (*this, bt));
}
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698