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

Unified Diff: src/gpu/effects/GrDistanceFieldTextureEffect.cpp

Issue 827973002: ViewMatrix uniform upload moved to GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@vm-on-gp
Patch Set: feedback inc 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/GrDashingEffect.cpp ('k') | src/gpu/gl/GrGLGeometryProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldTextureEffect.cpp
diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
index 669a504fb1fa3f311b3f66b15f5759adb31753f3..21fbb307c1eeeec8d66323abc7a5bf94c708dc97 100755
--- a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
+++ b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
@@ -53,9 +53,12 @@ public:
this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor,
dfTexEffect.inColor(), &fColorUniform);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(),
- vsBuilder->uViewM(), dfTexEffect.inPosition()->fName);
+ this->uViewM(), dfTexEffect.inPosition()->fName);
// setup output coords
vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(),
@@ -150,6 +153,8 @@ public:
}
#endif
+ this->setUniformViewMatrix(pdman, proc.viewMatrix());
+
const DistanceFieldBatchTracker& local = bt.cast<DistanceFieldBatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
@@ -343,9 +348,12 @@ public:
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(),
dfTexEffect.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(),
- vsBuilder->uViewM(), dfTexEffect.inPosition()->fName);
+ this->uViewM(), dfTexEffect.inPosition()->fName);
const char* textureSizeUniName = NULL;
fTextureSizeUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
@@ -410,6 +418,8 @@ public:
SkIntToScalar(fTextureSize.height()));
}
+ this->setUniformViewMatrix(pdman, proc.viewMatrix());
+
const DistanceFieldNoGammaBatchTracker& local = bt.cast<DistanceFieldNoGammaBatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
@@ -573,9 +583,12 @@ public:
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(),
dfTexEffect.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
- vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(),
- vsBuilder->uViewM(), dfTexEffect.inPosition()->fName);
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), this->uViewM(),
+ dfTexEffect.inPosition()->fName);
const char* textureSizeUniName = NULL;
// width, height, 1/(3*width)
@@ -717,6 +730,8 @@ public:
fTextColor = textColor;
}
+ this->setUniformViewMatrix(pdman, processor.viewMatrix());
+
const DistanceFieldLCDBatchTracker& local = bt.cast<DistanceFieldLCDBatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
« no previous file with comments | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/gpu/gl/GrGLGeometryProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698