diff options
author | Brian Salomon <bsalomon@google.com> | 2016-10-03 17:15:28 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-03 21:39:33 +0000 |
commit | 2ebd0c80a2a9d90a2c2c653f40a2a7205bd2d31b (patch) | |
tree | 1baafac8edfb1d5d51e9ea53b176b95506e809cd /src/effects | |
parent | 2cbcd12281ee807214df094964c584c78932e10b (diff) |
Remove option to make GrCoordTransforms apply to device positions.
Adds a device space texture decal effect to use for clipping.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2870
Change-Id: Ifcc7617ea87f5a86e301995cba9dfc30a4b0e2c5
Reviewed-on: https://skia-review.googlesource.com/2870
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/GrAlphaThresholdFragmentProcessor.cpp | 6 | ||||
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 5 | ||||
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 2 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 7 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 2 |
5 files changed, 8 insertions, 14 deletions
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.cpp b/src/effects/GrAlphaThresholdFragmentProcessor.cpp index 99f0a192fc..442acd0129 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.cpp +++ b/src/effects/GrAlphaThresholdFragmentProcessor.cpp @@ -47,13 +47,11 @@ GrAlphaThresholdFragmentProcessor::GrAlphaThresholdFragmentProcessor( const SkIRect& bounds) : fInnerThreshold(innerThreshold) , fOuterThreshold(outerThreshold) - , fImageCoordTransform(kLocal_GrCoordSet, - GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture, + , fImageCoordTransform(GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture, GrTextureParams::kNone_FilterMode) , fImageTextureAccess(texture) , fColorSpaceXform(std::move(colorSpaceXform)) - , fMaskCoordTransform(kLocal_GrCoordSet, - make_div_and_translate_matrix(maskTexture, -bounds.x(), -bounds.y()), + , fMaskCoordTransform(make_div_and_translate_matrix(maskTexture, -bounds.x(), -bounds.y()), maskTexture, GrTextureParams::kNone_FilterMode) , fMaskTextureAccess(maskTexture) { diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 4f6386d92e..283372f9a9 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -480,10 +480,9 @@ GrDisplacementMapEffect::GrDisplacementMapEffect( const SkMatrix& offsetMatrix, GrTexture* color, const SkISize& colorDimensions) - : fDisplacementTransform(kLocal_GrCoordSet, offsetMatrix, displacement, - GrTextureParams::kNone_FilterMode) + : fDisplacementTransform(offsetMatrix, displacement, GrTextureParams::kNone_FilterMode) , fDisplacementAccess(displacement) - , fColorTransform(kLocal_GrCoordSet, color, GrTextureParams::kNone_FilterMode) + , fColorTransform(color, GrTextureParams::kNone_FilterMode) , fDomain(GrTextureDomain::MakeTexelDomain(color, SkIRect::MakeSize(colorDimensions)), GrTextureDomain::kDecal_Mode) , fColorAccess(color) diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index a174bcac77..caff4958af 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -554,7 +554,7 @@ private: this->initClassID<GrPerlinNoiseEffect>(); this->addTextureAccess(&fPermutationsAccess); this->addTextureAccess(&fNoiseAccess); - fCoordTransform.reset(kLocal_GrCoordSet, matrix); + fCoordTransform.reset(matrix); this->addCoordTransform(&fCoordTransform); } diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index df230394ad..4ee82037d1 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -1605,7 +1605,7 @@ GrGradientEffect::GrGradientEffect(const CreateArgs& args) { fPremulType = kAfterInterp_PremulType; } - fCoordTransform.reset(kCoordSet, *args.fMatrix); + fCoordTransform.reset(*args.fMatrix); break; case kTexture_ColorType: @@ -1648,8 +1648,7 @@ GrGradientEffect::GrGradientEffect(const CreateArgs& args) { fRow = fAtlas->lockRow(bitmap); if (-1 != fRow) { fYCoord = fAtlas->getYOffset(fRow)+SK_ScalarHalf*fAtlas->getNormalizedTexelHeight(); - fCoordTransform.reset(kCoordSet, *args.fMatrix, fAtlas->getTexture(), - params.filterMode()); + fCoordTransform.reset(*args.fMatrix, fAtlas->getTexture(), params.filterMode()); fTextureAccess.reset(fAtlas->getTexture(), params); } else { SkAutoTUnref<GrTexture> texture( @@ -1658,7 +1657,7 @@ GrGradientEffect::GrGradientEffect(const CreateArgs& args) { if (!texture) { return; } - fCoordTransform.reset(kCoordSet, *args.fMatrix, texture, params.filterMode()); + fCoordTransform.reset(*args.fMatrix, texture, params.filterMode()); fTextureAccess.reset(texture, params); fYCoord = SK_ScalarHalf; } diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index df7ac786f4..f850994761 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -409,8 +409,6 @@ protected: const GrCoordTransform& getCoordTransform() const { return fCoordTransform; } private: - static const GrCoordSet kCoordSet = kLocal_GrCoordSet; - // If we're in legacy mode, then fColors will be populated. If we're gamma-correct, then // fColors4f and fColorSpaceXform will be populated. SkTDArray<SkColor> fColors; |