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

Unified Diff: src/gpu/effects/GrBezierEffect.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/batches/GrPLSPathRenderer.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 1894192d5888b25fb8cd7792d452e5bc815159a1..798695d4eced4bdc39484e09dd487521df5334d2 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -25,8 +25,8 @@ public:
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
- void setData(const GrGLSLProgramDataManager& pdman,
- const GrPrimitiveProcessor& primProc) override {
+ void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& primProc,
+ FPCoordTransformIter&& transformIter) override {
const GrConicEffect& ce = primProc.cast<GrConicEffect>();
if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) {
@@ -47,14 +47,7 @@ public:
pdman.set1f(fCoverageScaleUniform, GrNormalizeByteToFloat(ce.coverageScale()));
fCoverageScale = ce.coverageScale();
}
- }
-
- void setTransformData(const GrPrimitiveProcessor& primProc,
- const GrGLSLProgramDataManager& pdman,
- int index,
- const SkTArray<const GrCoordTransform*, true>& transforms) override {
- this->setTransformDataHelper(primProc.cast<GrConicEffect>().localMatrix(), pdman, index,
- transforms);
+ this->setTransformDataHelper(ce.localMatrix(), pdman, &transformIter);
}
private:
@@ -109,8 +102,7 @@ void GrGLConicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
gpArgs->fPositionVar,
gp.inPosition()->fName,
gp.localMatrix(),
- args.fTransformsIn,
- args.fTransformsOut);
+ args.fFPCoordTransformHandler);
// TODO: this precision check should actually be a check on the number of bits
// high and medium provide and the selection of the lowest level that suffices.
@@ -299,8 +291,8 @@ public:
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
- void setData(const GrGLSLProgramDataManager& pdman,
- const GrPrimitiveProcessor& primProc) override {
+ void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& primProc,
+ FPCoordTransformIter&& transformIter) override {
const GrQuadEffect& qe = primProc.cast<GrQuadEffect>();
if (!qe.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(qe.viewMatrix())) {
@@ -321,14 +313,7 @@ public:
pdman.set1f(fCoverageScaleUniform, GrNormalizeByteToFloat(qe.coverageScale()));
fCoverageScale = qe.coverageScale();
}
- }
-
- void setTransformData(const GrPrimitiveProcessor& primProc,
- const GrGLSLProgramDataManager& pdman,
- int index,
- const SkTArray<const GrCoordTransform*, true>& transforms) override {
- this->setTransformDataHelper(primProc.cast<GrQuadEffect>().localMatrix(), pdman, index,
- transforms);
+ this->setTransformDataHelper(qe.localMatrix(), pdman, &transformIter);
}
private:
@@ -383,8 +368,7 @@ void GrGLQuadEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
gpArgs->fPositionVar,
gp.inPosition()->fName,
gp.localMatrix(),
- args.fTransformsIn,
- args.fTransformsOut);
+ args.fFPCoordTransformHandler);
fragBuilder->codeAppendf("float edgeAlpha;");
@@ -516,8 +500,8 @@ public:
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
- void setData(const GrGLSLProgramDataManager& pdman,
- const GrPrimitiveProcessor& primProc) override {
+ void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& primProc,
+ FPCoordTransformIter&& transformIter) override {
const GrCubicEffect& ce = primProc.cast<GrCubicEffect>();
if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) {
@@ -533,6 +517,7 @@ public:
pdman.set4fv(fColorUniform, 1, c);
fColor = ce.color();
}
+ this->setTransformDataHelper(SkMatrix::I(), pdman, &transformIter);
}
private:
@@ -584,8 +569,7 @@ void GrGLCubicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
uniformHandler,
gpArgs->fPositionVar,
gp.inPosition()->fName,
- args.fTransformsIn,
- args.fTransformsOut);
+ args.fFPCoordTransformHandler);
GrGLSLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, kHigh_GrSLPrecision);
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/effects/GrBitmapTextGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698