diff options
author | bsalomon <bsalomon@google.com> | 2014-10-15 19:06:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-15 19:06:21 -0700 |
commit | de258cd6b402c4da78b66e88191ad02162d87916 (patch) | |
tree | 1b91ff3c8a2c58a482d8bbeb32275a820ea3611c /src | |
parent | 000f829f14a9535a005082731af5de1526284c83 (diff) |
Make GrFragmentProcessor auto-compare coord xforms.
Review URL: https://codereview.chromium.org/657923002
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 1 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 3 | ||||
-rw-r--r-- | src/gpu/GrProcessor.cpp | 13 | ||||
-rw-r--r-- | src/gpu/effects/GrSingleTextureEffect.h | 4 |
4 files changed, 15 insertions, 6 deletions
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index de1780622f..68cdcc6b11 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -579,7 +579,6 @@ private: fPaintingData->fBaseFrequency == s.fPaintingData->fBaseFrequency && fNumOctaves == s.fNumOctaves && fStitchTiles == s.fStitchTiles && - fCoordTransform.getMatrix() == s.fCoordTransform.getMatrix() && fAlpha == s.fAlpha && fPermutationsAccess.getTexture() == s.fPermutationsAccess.getTexture() && fNoiseAccess.getTexture() == s.fNoiseAccess.getTexture() && diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index b297b14fb0..f131d72f23 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -1205,8 +1205,7 @@ bool GrGradientEffect::onIsEqual(const GrFragmentProcessor& processor) const { return fTextureAccess.getTexture() == s.fTextureAccess.getTexture() && fTextureAccess.getParams().getTileModeX() == s.fTextureAccess.getParams().getTileModeX() && - this->useAtlas() == s.useAtlas() && - fCoordTransform.getMatrix().cheapEqualTo(s.fCoordTransform.getMatrix()); + this->useAtlas() == s.useAtlas(); } return false; diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp index fbcd0f334b..a0ad99efe5 100644 --- a/src/gpu/GrProcessor.cpp +++ b/src/gpu/GrProcessor.cpp @@ -175,3 +175,16 @@ void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) { fCoordTransforms.push_back(transform); SkDEBUGCODE(transform->setInProcessor();) } + +bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) const { + if (fCoordTransforms.count() != that.fCoordTransforms.count()) { + return false; + } + int count = fCoordTransforms.count(); + for (int i = 0; i < count; ++i) { + if (*fCoordTransforms[i] != *that.fCoordTransforms[i]) { + return false; + } + } + return true; +} diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h index ad13c2edeb..c16c088a18 100644 --- a/src/gpu/effects/GrSingleTextureEffect.h +++ b/src/gpu/effects/GrSingleTextureEffect.h @@ -38,9 +38,7 @@ protected: */ bool hasSameTextureParamsMatrixAndSourceCoords(const GrSingleTextureEffect& other) const { // We don't have to check the accesses' swizzles because they are inferred from the texture. - return fTextureAccess == other.fTextureAccess && - fCoordTransform.getMatrix().cheapEqualTo(other.fCoordTransform.getMatrix()) && - fCoordTransform.sourceCoords() == other.fCoordTransform.sourceCoords(); + return fTextureAccess == other.fTextureAccess; } /** |