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

Unified Diff: src/gpu/GrDefaultGeoProcFactory.cpp

Issue 1127953003: Remove viewmatrix from GrGeometryProcessor base class (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup3
Patch Set: Created 5 years, 7 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
Index: src/gpu/GrDefaultGeoProcFactory.cpp
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index 9f5eb37319299851d17763a114a78efb229f0456..4ceeca94b667ec11a8fb7ddcb0c9d20f22190c7b 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -39,6 +39,7 @@ public:
const Attribute* inLocalCoords() const { return fInLocalCoords; }
const Attribute* inCoverage() const { return fInCoverage; }
GrColor color() const { return fColor; }
+ const SkMatrix& viewMatrix() const { return fViewMatrix; }
uint8_t coverage() const { return fCoverage; }
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override {
@@ -121,14 +122,15 @@ public:
uint32_t key = def.fFlags;
key |= local.fInputColorType << 8 | local.fInputCoverageType << 16;
key |= local.fUsesLocalCoords && gp.localMatrix().hasPerspective() ? 0x1 << 24 : 0x0;
- key |= ComputePosKey(gp.viewMatrix()) << 25;
+ key |= ComputePosKey(def.viewMatrix()) << 25;
b->add32(key);
}
virtual void setData(const GrGLProgramDataManager& pdman,
const GrPrimitiveProcessor& gp,
const GrBatchTracker& bt) override {
- this->setUniformViewMatrix(pdman, gp.viewMatrix());
+ const DefaultGeoProc& dgp = gp.cast<DefaultGeoProc>();
+ this->setUniformViewMatrix(pdman, dgp.viewMatrix());
const BatchTracker& local = bt.cast<BatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
@@ -169,12 +171,13 @@ private:
const SkMatrix& viewMatrix,
const SkMatrix& localMatrix,
uint8_t coverage)
- : INHERITED(viewMatrix, localMatrix)
+ : INHERITED(localMatrix)
, fInPosition(NULL)
, fInColor(NULL)
, fInLocalCoords(NULL)
, fInCoverage(NULL)
, fColor(color)
+ , fViewMatrix(viewMatrix)
, fCoverage(coverage)
, fFlags(gpTypeFlags) {
this->initClassID<DefaultGeoProc>();
@@ -209,6 +212,7 @@ private:
const Attribute* fInLocalCoords;
const Attribute* fInCoverage;
GrColor fColor;
robertphillips 2015/05/14 16:35:24 Can this be const?
+ SkMatrix fViewMatrix;
uint8_t fCoverage;
uint32_t fFlags;

Powered by Google App Engine
This is Rietveld 408576698