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

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

Issue 2339203002: Stop flattening GrCoordTransforms in parent GrFragmentProcessors. (Closed)
Patch Set: Fix issue of taking ref to a temporary Created 4 years, 3 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
« no previous file with comments | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldGeoProc.cpp
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index c74c5cec8048d31362d11ff00f33f018471cebe0..5404b0c80570cecf5255132f23c0edfdd7f3fd28 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -73,8 +73,7 @@ public:
uniformHandler,
gpArgs->fPositionVar,
dfTexEffect.inPosition()->fName,
- args.fTransformsIn,
- args.fTransformsOut);
+ args.fFPCoordTransformHandler);
// add varyings
GrGLSLVertToFrag recipScale(kFloat_GrSLType);
@@ -179,7 +178,8 @@ public:
fragBuilder->codeAppendf("%s = vec4(val);", args.fOutputCoverage);
}
- void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& proc) override {
+ void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& proc,
+ FPCoordTransformIter&& transformIter) override {
#ifdef SK_GAMMA_APPLY_TO_A8
const GrDistanceFieldA8TextGeoProc& dfTexEffect = proc.cast<GrDistanceFieldA8TextGeoProc>();
float distanceAdjust = dfTexEffect.getDistanceAdjust();
@@ -196,6 +196,7 @@ public:
GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
+ this->setTransformDataHelper(SkMatrix::I(), pdman, &transformIter);
}
static inline void GenKey(const GrGeometryProcessor& gp,
@@ -345,8 +346,7 @@ public:
uniformHandler,
gpArgs->fPositionVar,
dfTexEffect.inPosition()->fName,
- args.fTransformsIn,
- args.fTransformsOut);
+ args.fFPCoordTransformHandler);
const char* textureSizeUniName = nullptr;
fTextureSizeUni = uniformHandler->addUniform(kFragment_GrShaderFlag,
@@ -433,7 +433,8 @@ public:
fragBuilder->codeAppendf("%s = vec4(val);", args.fOutputCoverage);
}
- void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& proc) override {
+ void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& proc,
+ FPCoordTransformIter&& transformIter) override {
SkASSERT(fTextureSizeUni.isValid());
GrTexture* texture = proc.texture(0);
@@ -453,6 +454,7 @@ public:
GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
+ this->setTransformDataHelper(SkMatrix::I(), pdman, &transformIter);
}
static inline void GenKey(const GrGeometryProcessor& gp,
@@ -582,8 +584,7 @@ public:
uniformHandler,
gpArgs->fPositionVar,
dfTexEffect.inPosition()->fName,
- args.fTransformsIn,
- args.fTransformsOut);
+ args.fFPCoordTransformHandler);
// set up varyings
bool isUniformScale = (dfTexEffect.getFlags() & kUniformScale_DistanceFieldEffectMask) ==
@@ -732,8 +733,8 @@ public:
fragBuilder->codeAppendf("%s = val;", args.fOutputCoverage);
}
- void setData(const GrGLSLProgramDataManager& pdman,
- const GrPrimitiveProcessor& processor) override {
+ void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& processor,
+ FPCoordTransformIter&& transformIter) override {
SkASSERT(fDistanceAdjustUni.isValid());
const GrDistanceFieldLCDTextGeoProc& dflcd = processor.cast<GrDistanceFieldLCDTextGeoProc>();
@@ -752,6 +753,7 @@ public:
GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
+ this->setTransformDataHelper(SkMatrix::I(), pdman, &transformIter);
}
static inline void GenKey(const GrGeometryProcessor& gp,
« no previous file with comments | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698