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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 817853002: Remove localcoordchange functions off paint (Closed) Base URL: https://skia.googlesource.com/skia.git@local-matrix-on-gp
Patch Set: changing ignores Created 6 years 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/GrDistanceFieldTextureEffect.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index cfb1d38b6137e762feba29a9c4c87af24ae82dc6..13a14534cf42b03c8fe50f8b29b06d4bf7737605 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -378,8 +378,22 @@ void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage,
for (int t = 0; t < numTransforms; t++) {
const char* uniName = "StageMatrix";
- GrSLType varyingType = stage.isPerspectiveCoordTransform(t) ? kVec3f_GrSLType :
- kVec2f_GrSLType;
+ GrSLType varyingType;
+
+ // TODO when we have deleted the coord change matrices we can get rid of the below check
+ GrCoordSet coordType = processor->coordTransform(t).sourceCoords();
+ const SkMatrix& localMatrix = fOptState.getPrimitiveProcessor()->localMatrix();
+ if (localMatrix.isIdentity()) {
+ varyingType = stage.isPerspectiveCoordTransform(t) ? kVec3f_GrSLType :
+ kVec2f_GrSLType;
+ } else {
+ uint32_t type = processor->coordTransform(t).getMatrix().getType();
+ if (kLocal_GrCoordSet == coordType) {
+ type |= localMatrix.getType();
+ }
+ varyingType = SkToBool(SkMatrix::kPerspective_Mask & type) ? kVec3f_GrSLType :
+ kVec2f_GrSLType;
+ }
GrSLPrecision precision = processor->coordTransform(t).precision();
SkString suffixedUniName;
@@ -401,7 +415,6 @@ void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage,
varyingName = suffixedVaryingName.c_str();
}
- GrCoordSet coordType = processor->coordTransform(t).sourceCoords();
GrGLVertToFrag v(varyingType);
this->addVarying(varyingName, &v, precision);
fCoordVaryings.push_back(TransformVarying(v, uniName, coordType));
« no previous file with comments | « src/gpu/effects/GrDistanceFieldTextureEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698