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

Unified Diff: src/gpu/effects/GrBezierEffect.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/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrBitmapTextGeoProc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBezierEffect.cpp
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 4ab088c6a8ec497017095b6bf4afccd9776f00d6..e846b79b2512890cf9b2ce1c09ce15535759d437 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -32,8 +32,10 @@ public:
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager& pdman,
- const GrPrimitiveProcessor&,
+ const GrPrimitiveProcessor& primProc,
const GrBatchTracker& bt) SK_OVERRIDE {
+ this->setUniformViewMatrix(pdman, primProc.viewMatrix());
+
const ConicBatchTracker& local = bt.cast<ConicBatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
@@ -82,8 +84,11 @@ void GrGLConicEffect::emitCode(const EmitArgs& args) {
vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), gp.inPosition()->fName);
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), gp.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
- vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), vsBuilder->uViewM(),
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), this->uViewM(),
gp.inPosition()->fName);
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
@@ -261,8 +266,10 @@ public:
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager& pdman,
- const GrPrimitiveProcessor&,
+ const GrPrimitiveProcessor& primProc,
const GrBatchTracker& bt) SK_OVERRIDE {
+ this->setUniformViewMatrix(pdman, primProc.viewMatrix());
+
const QuadBatchTracker& local = bt.cast<QuadBatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
@@ -311,8 +318,11 @@ void GrGLQuadEffect::emitCode(const EmitArgs& args) {
vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), gp.inPosition()->fName);
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), gp.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
- vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), vsBuilder->uViewM(),
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), this->uViewM(),
gp.inPosition()->fName);
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
@@ -476,8 +486,10 @@ public:
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager& pdman,
- const GrPrimitiveProcessor&,
+ const GrPrimitiveProcessor& primProc,
const GrBatchTracker& bt) SK_OVERRIDE {
+ this->setUniformViewMatrix(pdman, primProc.viewMatrix());
+
const CubicBatchTracker& local = bt.cast<CubicBatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
@@ -519,8 +531,11 @@ void GrGLCubicEffect::emitCode(const EmitArgs& args) {
vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), gp.inPosition()->fName);
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), gp.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(args.fPB);
+
// setup position varying
- vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), vsBuilder->uViewM(),
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), this->uViewM(),
gp.inPosition()->fName);
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrBitmapTextGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698