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

Unified Diff: src/gpu/gl/GrGLGeometryProcessor.cpp

Issue 1243583002: Add support for transformedLocalCoords to GrDefaultGeoProc (Closed) Base URL: https://skia.googlesource.com/skia.git@pipelinetobatch2
Patch Set: tweaks Created 5 years, 4 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/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGeometryProcessor.cpp
diff --git a/src/gpu/gl/GrGLGeometryProcessor.cpp b/src/gpu/gl/GrGLGeometryProcessor.cpp
index dc4518f978f026ea4e0b714fcf81eb44ef24d5b4..4026c72098103339aeec97b07893509f549bba13 100644
--- a/src/gpu/gl/GrGLGeometryProcessor.cpp
+++ b/src/gpu/gl/GrGLGeometryProcessor.cpp
@@ -89,6 +89,35 @@ void GrGLGeometryProcessor::emitTransforms(GrGLGPBuilder* pb,
}
}
+void GrGLGeometryProcessor::emitTransforms(GrGLGPBuilder* pb,
+ const char* localCoords,
+ const TransformsIn& tin,
+ TransformsOut* tout) {
+ GrGLVertexBuilder* vb = pb->getVertexShaderBuilder();
+ tout->push_back_n(tin.count());
+ for (int i = 0; i < tin.count(); i++) {
+ const ProcCoords& coordTransforms = tin[i];
+ for (int t = 0; t < coordTransforms.count(); t++) {
+ GrSLType varyingType = kVec2f_GrSLType;
+
+ // Device coords aren't supported
+ SkASSERT(kDevice_GrCoordSet != coordTransforms[t]->sourceCoords());
+ GrSLPrecision precision = coordTransforms[t]->precision();
+
+ SkString strVaryingName("MatrixCoord");
+ strVaryingName.appendf("_%i_%i", i, t);
+
+ GrGLVertToFrag v(varyingType);
+ pb->addVarying(strVaryingName.c_str(), &v, precision);
+ vb->codeAppendf("%s = %s;", v.vsOut(), localCoords);
+
+ SkNEW_APPEND_TO_TARRAY(&(*tout)[i],
+ GrGLProcessor::TransformedCoords,
+ (SkString(v.fsIn()), varyingType));
+ }
+ }
+}
+
void GrGLGeometryProcessor::setupPosition(GrGLGPBuilder* pb,
GrGPArgs* gpArgs,
const char* posName) {
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698