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

Unified Diff: src/gpu/GrOvalRenderer.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/GrOptDrawState.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 06b2e113f670689bf9df96f97316e03f499d809d..b43c48561fcfc4b10bd83444dbeb4f2d8933981b 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -101,9 +101,12 @@ public:
vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), ce.inPosition()->fName);
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), ce.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(),
- vsBuilder->uViewM(), ce.inPosition()->fName);
+ this->uViewM(), ce.inPosition()->fName);
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("float d = length(%s.xy);", v.fsIn());
@@ -131,6 +134,8 @@ public:
virtual void setData(const GrGLProgramDataManager& pdman,
const GrPrimitiveProcessor& gp,
const GrBatchTracker& bt) SK_OVERRIDE {
+ this->setUniformViewMatrix(pdman, gp.viewMatrix());
+
const BatchTracker& local = bt.cast<BatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
@@ -274,9 +279,12 @@ public:
vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), ee.inPosition()->fName);
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), ee.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(),
- vsBuilder->uViewM(), ee.inPosition()->fName);
+ this->uViewM(), ee.inPosition()->fName);
// for outer curve
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
@@ -319,6 +327,8 @@ public:
virtual void setData(const GrGLProgramDataManager& pdman,
const GrPrimitiveProcessor& gp,
const GrBatchTracker& bt) SK_OVERRIDE {
+ this->setUniformViewMatrix(pdman, gp.viewMatrix());
+
const BatchTracker& local = bt.cast<BatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
@@ -469,9 +479,12 @@ public:
vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), ee.inPosition()->fName);
vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), ee.inPosition()->fName);
+ // setup uniform viewMatrix
+ this->addUniformViewMatrix(pb);
+
// setup position varying
vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(),
- vsBuilder->uViewM(), ee.inPosition()->fName);
+ this->uViewM(), ee.inPosition()->fName);
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
@@ -529,6 +542,8 @@ public:
virtual void setData(const GrGLProgramDataManager& pdman,
const GrPrimitiveProcessor& gp,
const GrBatchTracker& bt) SK_OVERRIDE {
+ this->setUniformViewMatrix(pdman, gp.viewMatrix());
+
const BatchTracker& local = bt.cast<BatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
« no previous file with comments | « src/gpu/GrOptDrawState.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698