diff options
author | Brian Salomon <bsalomon@google.com> | 2016-11-17 11:38:22 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-17 17:18:53 +0000 |
commit | 0bbecb21ab82b3d742c491780bcc2e74be03efed (patch) | |
tree | 0355eca170a7cb268b27049dd158886d7f62cb87 /src/effects | |
parent | 9de097639f04e5a18da2d2b123dace9d24ab50e4 (diff) |
Rename GrTextureAccess to GrProcessor::TextureSampler.
Renames vars and methods that used the work "access" to refer to this type.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4931
Change-Id: Ibcf488fbd445c5119fc13d190544cd98981bdbee
Reviewed-on: https://skia-review.googlesource.com/4931
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/GrAlphaThresholdFragmentProcessor.cpp | 14 | ||||
-rw-r--r-- | src/effects/GrAlphaThresholdFragmentProcessor.h | 4 | ||||
-rw-r--r-- | src/effects/GrCircleBlurFragmentProcessor.cpp | 4 | ||||
-rw-r--r-- | src/effects/GrCircleBlurFragmentProcessor.h | 2 | ||||
-rw-r--r-- | src/effects/SkArithmeticMode_gpu.h | 1 | ||||
-rw-r--r-- | src/effects/SkBlurMaskFilter.cpp | 12 | ||||
-rw-r--r-- | src/effects/SkColorCubeFilter.cpp | 8 | ||||
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 14 | ||||
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 12 | ||||
-rw-r--r-- | src/effects/SkTableColorFilter.cpp | 6 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 6 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 2 |
14 files changed, 44 insertions, 45 deletions
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.cpp b/src/effects/GrAlphaThresholdFragmentProcessor.cpp index 442acd0129..9a131f8d47 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.cpp +++ b/src/effects/GrAlphaThresholdFragmentProcessor.cpp @@ -10,7 +10,6 @@ #if SK_SUPPORT_GPU #include "GrInvariantOutput.h" -#include "GrTextureAccess.h" #include "SkRefCnt.h" #include "glsl/GrGLSLColorSpaceXformHelper.h" @@ -49,17 +48,17 @@ GrAlphaThresholdFragmentProcessor::GrAlphaThresholdFragmentProcessor( , fOuterThreshold(outerThreshold) , fImageCoordTransform(GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture, GrTextureParams::kNone_FilterMode) - , fImageTextureAccess(texture) + , fImageTextureSampler(texture) , fColorSpaceXform(std::move(colorSpaceXform)) , fMaskCoordTransform(make_div_and_translate_matrix(maskTexture, -bounds.x(), -bounds.y()), maskTexture, GrTextureParams::kNone_FilterMode) - , fMaskTextureAccess(maskTexture) { + , fMaskTextureSampler(maskTexture) { this->initClassID<GrAlphaThresholdFragmentProcessor>(); this->addCoordTransform(&fImageCoordTransform); - this->addTextureAccess(&fImageTextureAccess); + this->addTextureSampler(&fImageTextureSampler); this->addCoordTransform(&fMaskCoordTransform); - this->addTextureAccess(&fMaskTextureAccess); + this->addTextureSampler(&fMaskTextureSampler); } bool GrAlphaThresholdFragmentProcessor::onIsEqual(const GrFragmentProcessor& sBase) const { @@ -69,9 +68,10 @@ bool GrAlphaThresholdFragmentProcessor::onIsEqual(const GrFragmentProcessor& sBa } void GrAlphaThresholdFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const { - if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { + GrPixelConfig config = this->textureSampler(0).getTexture()->config(); + if (GrPixelConfigIsAlphaOnly(config)) { inout->mulByUnknownSingleComponent(); - } else if (GrPixelConfigIsOpaque(this->texture(0)->config()) && fOuterThreshold >= 1.f) { + } else if (GrPixelConfigIsOpaque(config) && fOuterThreshold >= 1.f) { inout->mulByUnknownOpaqueFourComponents(); } else { inout->mulByUnknownFourComponents(); diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.h b/src/effects/GrAlphaThresholdFragmentProcessor.h index c5b8d4ede2..9805a22128 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.h +++ b/src/effects/GrAlphaThresholdFragmentProcessor.h @@ -55,11 +55,11 @@ private: float fInnerThreshold; float fOuterThreshold; GrCoordTransform fImageCoordTransform; - GrTextureAccess fImageTextureAccess; + TextureSampler fImageTextureSampler; // Color space transform is for the image (not the mask) sk_sp<GrColorSpaceXform> fColorSpaceXform; GrCoordTransform fMaskCoordTransform; - GrTextureAccess fMaskTextureAccess; + TextureSampler fMaskTextureSampler; typedef GrFragmentProcessor INHERITED; }; diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp index d5ed6b712a..b8b266045d 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.cpp +++ b/src/effects/GrCircleBlurFragmentProcessor.cpp @@ -92,9 +92,9 @@ GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl : fCircle(circle) , fSolidRadius(solidRadius) , fTextureRadius(textureRadius) - , fBlurProfileAccess(blurProfile, GrTextureParams::kBilerp_FilterMode) { + , fBlurProfileSampler(blurProfile, GrTextureParams::kBilerp_FilterMode) { this->initClassID<GrCircleBlurFragmentProcessor>(); - this->addTextureAccess(&fBlurProfileAccess); + this->addTextureSampler(&fBlurProfileSampler); this->setWillReadFragmentPosition(); } diff --git a/src/effects/GrCircleBlurFragmentProcessor.h b/src/effects/GrCircleBlurFragmentProcessor.h index 66072887da..73e5d04b05 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.h +++ b/src/effects/GrCircleBlurFragmentProcessor.h @@ -64,7 +64,7 @@ private: SkRect fCircle; SkScalar fSolidRadius; float fTextureRadius; - GrTextureAccess fBlurProfileAccess; + TextureSampler fBlurProfileSampler; GR_DECLARE_FRAGMENT_PROCESSOR_TEST; diff --git a/src/effects/SkArithmeticMode_gpu.h b/src/effects/SkArithmeticMode_gpu.h index 4704399d24..28351fc5b5 100644 --- a/src/effects/SkArithmeticMode_gpu.h +++ b/src/effects/SkArithmeticMode_gpu.h @@ -15,7 +15,6 @@ #include "GrCaps.h" #include "GrCoordTransform.h" #include "GrFragmentProcessor.h" -#include "GrTextureAccess.h" #include "GrTypes.h" #include "GrXferProcessor.h" diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 0a98fa8c3a..84cb201906 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -825,7 +825,7 @@ private: SkRect fRect; float fSigma; - GrTextureAccess fBlurProfileAccess; + TextureSampler fBlurProfileSampler; GrSLPrecision fPrecision; GR_DECLARE_FRAGMENT_PROCESSOR_TEST; @@ -975,10 +975,10 @@ GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *b GrSLPrecision precision) : fRect(rect) , fSigma(sigma) - , fBlurProfileAccess(blurProfile) + , fBlurProfileSampler(blurProfile) , fPrecision(precision) { this->initClassID<GrRectBlurEffect>(); - this->addTextureAccess(&fBlurProfileAccess); + this->addTextureSampler(&fBlurProfileSampler); this->setWillReadFragmentPosition(); } @@ -1093,7 +1093,7 @@ private: SkRRect fRRect; float fSigma; - GrTextureAccess fNinePatchAccess; + TextureSampler fNinePatchSampler; GR_DECLARE_FRAGMENT_PROCESSOR_TEST; @@ -1205,9 +1205,9 @@ void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTexture *ninePatchTexture) : fRRect(rrect), fSigma(sigma), - fNinePatchAccess(ninePatchTexture) { + fNinePatchSampler(ninePatchTexture) { this->initClassID<GrRRectBlurEffect>(); - this->addTextureAccess(&fNinePatchAccess); + this->addTextureSampler(&fNinePatchSampler); this->setWillReadFragmentPosition(); } diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp index 2c8ab6f225..24991552eb 100644 --- a/src/effects/SkColorCubeFilter.cpp +++ b/src/effects/SkColorCubeFilter.cpp @@ -170,7 +170,7 @@ public: const char* name() const override { return "ColorCube"; } - int colorCubeSize() const { return fColorCubeAccess.getTexture()->width(); } + int colorCubeSize() const { return fColorCubeSampler.getTexture()->width(); } void onComputeInvariantOutput(GrInvariantOutput*) const override; @@ -201,7 +201,7 @@ private: GrColorCubeEffect(GrTexture* colorCube); - GrTextureAccess fColorCubeAccess; + TextureSampler fColorCubeSampler; typedef GrFragmentProcessor INHERITED; }; @@ -209,9 +209,9 @@ private: /////////////////////////////////////////////////////////////////////////////// GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube) - : fColorCubeAccess(colorCube, GrTextureParams::kBilerp_FilterMode) { + : fColorCubeSampler(colorCube, GrTextureParams::kBilerp_FilterMode) { this->initClassID<GrColorCubeEffect>(); - this->addTextureAccess(&fColorCubeAccess); + this->addTextureSampler(&fColorCubeSampler); } GrColorCubeEffect::~GrColorCubeEffect() { diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 8cb610e3b1..b1f46cd914 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -259,10 +259,10 @@ private: GR_DECLARE_FRAGMENT_PROCESSOR_TEST; GrCoordTransform fDisplacementTransform; - GrTextureAccess fDisplacementAccess; + TextureSampler fDisplacementSampler; GrCoordTransform fColorTransform; GrTextureDomain fDomain; - GrTextureAccess fColorAccess; + TextureSampler fColorSampler; SkDisplacementMapEffect::ChannelSelectorType fXChannelSelector; SkDisplacementMapEffect::ChannelSelectorType fYChannelSelector; SkVector fScale; @@ -486,19 +486,19 @@ GrDisplacementMapEffect::GrDisplacementMapEffect( GrTexture* color, const SkISize& colorDimensions) : fDisplacementTransform(offsetMatrix, displacement, GrTextureParams::kNone_FilterMode) - , fDisplacementAccess(displacement) + , fDisplacementSampler(displacement) , fColorTransform(color, GrTextureParams::kNone_FilterMode) , fDomain(GrTextureDomain::MakeTexelDomain(color, SkIRect::MakeSize(colorDimensions)), GrTextureDomain::kDecal_Mode) - , fColorAccess(color) + , fColorSampler(color) , fXChannelSelector(xChannelSelector) , fYChannelSelector(yChannelSelector) , fScale(scale) { this->initClassID<GrDisplacementMapEffect>(); this->addCoordTransform(&fDisplacementTransform); - this->addTextureAccess(&fDisplacementAccess); + this->addTextureSampler(&fDisplacementSampler); this->addCoordTransform(&fColorTransform); - this->addTextureAccess(&fColorAccess); + this->addTextureSampler(&fColorSampler); } GrDisplacementMapEffect::~GrDisplacementMapEffect() { @@ -625,7 +625,7 @@ void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) { void GrGLDisplacementMapEffect::onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& proc) { const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMapEffect>(); - GrTexture* colorTex = displacementMap.texture(1); + GrTexture* colorTex = displacementMap.textureSampler(1).getTexture(); SkScalar scaleX = displacementMap.scale().fX / colorTex->width(); SkScalar scaleY = displacementMap.scale().fY / colorTex->height(); pdman.set2f(fScaleUni, SkScalarToFloat(scaleX), diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index da6210c7d1..154ebc67de 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -1900,7 +1900,7 @@ void GrGLLightingEffect::onSetData(const GrGLSLProgramDataManager& pdman, fLight = lighting.light()->createGLLight(); } - GrTexture* texture = lighting.texture(0); + GrTexture* texture = lighting.textureSampler(0).getTexture(); float ySign = texture->origin() == kTopLeft_GrSurfaceOrigin ? -1.0f : 1.0f; pdman.set2f(fImageIncrementUni, 1.0f / texture->width(), ySign / texture->height()); pdman.set1f(fSurfaceScaleUni, lighting.surfaceScale()); diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index cd35d655c4..6e581ccea4 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -294,7 +294,7 @@ void GrGLMorphologyEffect::GenKey(const GrProcessor& proc, void GrGLMorphologyEffect::onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& proc) { const GrMorphologyEffect& m = proc.cast<GrMorphologyEffect>(); - GrTexture& texture = *m.texture(0); + GrTexture& texture = *m.textureSampler(0).getTexture(); float pixelSize = 0.0f; switch (m.direction()) { diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 0b34d161b1..dc28e447ef 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -548,12 +548,12 @@ private: : fType(type) , fNumOctaves(numOctaves) , fStitchTiles(stitchTiles) - , fPermutationsAccess(permutationsTexture) - , fNoiseAccess(noiseTexture) + , fPermutationsSampler(permutationsTexture) + , fNoiseSampler(noiseTexture) , fPaintingData(paintingData) { this->initClassID<GrPerlinNoiseEffect>(); - this->addTextureAccess(&fPermutationsAccess); - this->addTextureAccess(&fNoiseAccess); + this->addTextureSampler(&fPermutationsSampler); + this->addTextureSampler(&fNoiseSampler); fCoordTransform.reset(matrix); this->addCoordTransform(&fCoordTransform); } @@ -564,8 +564,8 @@ private: GrCoordTransform fCoordTransform; int fNumOctaves; bool fStitchTiles; - GrTextureAccess fPermutationsAccess; - GrTextureAccess fNoiseAccess; + TextureSampler fPermutationsSampler; + TextureSampler fNoiseSampler; SkPerlinNoiseShader::PaintingData *fPaintingData; private: diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index cd786dfee6..90a785611b 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -365,7 +365,7 @@ private: GR_DECLARE_FRAGMENT_PROCESSOR_TEST; - GrTextureAccess fTextureAccess; + TextureSampler fTextureSampler; // currently not used in shader code, just to assist onComputeInvariantOutput(). unsigned fFlags; @@ -485,12 +485,12 @@ sk_sp<GrFragmentProcessor> ColorTableEffect::Make(GrContext* context, SkBitmap b ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atlas, int row, unsigned flags) - : fTextureAccess(texture) + : fTextureSampler(texture) , fFlags(flags) , fAtlas(atlas) , fRow(row) { this->initClassID<ColorTableEffect>(); - this->addTextureAccess(&fTextureAccess); + this->addTextureSampler(&fTextureSampler); } ColorTableEffect::~ColorTableEffect() { diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index 3bf569c888..fcd0bd3ba9 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -1659,7 +1659,7 @@ GrGradientEffect::GrGradientEffect(const CreateArgs& args) { if (-1 != fRow) { fYCoord = fAtlas->getYOffset(fRow)+SK_ScalarHalf*fAtlas->getNormalizedTexelHeight(); fCoordTransform.reset(*args.fMatrix, fAtlas->getTexture(), params.filterMode()); - fTextureAccess.reset(fAtlas->getTexture(), params); + fTextureSampler.reset(fAtlas->getTexture(), params); } else { sk_sp<GrTexture> texture(GrRefCachedBitmapTexture( args.fContext, bitmap, params, @@ -1668,11 +1668,11 @@ GrGradientEffect::GrGradientEffect(const CreateArgs& args) { return; } fCoordTransform.reset(*args.fMatrix, texture.get(), params.filterMode()); - fTextureAccess.reset(texture.get(), params); + fTextureSampler.reset(texture.get(), params); fYCoord = SK_ScalarHalf; } - this->addTextureAccess(&fTextureAccess); + this->addTextureSampler(&fTextureSampler); break; } diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index 2e447ca1d7..120832f33c 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -439,7 +439,7 @@ private: SkShader::TileMode fTileMode; GrCoordTransform fCoordTransform; - GrTextureAccess fTextureAccess; + TextureSampler fTextureSampler; SkScalar fYCoord; GrTextureStripAtlas* fAtlas; int fRow; |