From 9f876a37d8b80ef04ccbc7755cf4572aecc33981 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Tue, 9 Dec 2014 10:51:07 -0800 Subject: Use threshold of 1 texture coord value per pixel w/ nearest neighbor. Review URL: https://codereview.chromium.org/787873002 --- src/effects/SkAlphaThresholdFilter.cpp | 6 ++++-- src/effects/SkArithmeticMode.cpp | 3 ++- src/effects/SkColorCubeFilter.cpp | 2 +- src/effects/SkDisplacementMapEffect.cpp | 5 +++-- src/effects/SkGpuBlurUtils.cpp | 2 +- src/effects/gradients/SkGradientShader.cpp | 4 ++-- 6 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src/effects') diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index 8908a6a9f5..5ba41bd7f8 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -86,10 +86,12 @@ private: : fInnerThreshold(innerThreshold) , fOuterThreshold(outerThreshold) , fImageCoordTransform(kLocal_GrCoordSet, - GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture) + GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture, + GrTextureParams::kNone_FilterMode) , fImageTextureAccess(texture) , fMaskCoordTransform(kLocal_GrCoordSet, - GrCoordTransform::MakeDivByTextureWHMatrix(maskTexture), maskTexture) + GrCoordTransform::MakeDivByTextureWHMatrix(maskTexture), maskTexture, + GrTextureParams::kNone_FilterMode) , fMaskTextureAccess(maskTexture) { this->initClassID(); this->addCoordTransform(&fImageCoordTransform); diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp index a1f14ec1cb..468e9e44df 100644 --- a/src/effects/SkArithmeticMode.cpp +++ b/src/effects/SkArithmeticMode.cpp @@ -315,7 +315,8 @@ GrArithmeticEffect::GrArithmeticEffect(float k1, float k2, float k3, float k4, : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { this->initClassID(); if (background) { - fBackgroundTransform.reset(kLocal_GrCoordSet, background); + fBackgroundTransform.reset(kLocal_GrCoordSet, background, + GrTextureParams::kNone_FilterMode); this->addCoordTransform(&fBackgroundTransform); fBackgroundAccess.reset(background); this->addTextureAccess(&fBackgroundAccess); diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp index dd20a27016..9e2b08c91c 100644 --- a/src/effects/SkColorCubeFilter.cpp +++ b/src/effects/SkColorCubeFilter.cpp @@ -240,7 +240,7 @@ private: /////////////////////////////////////////////////////////////////////////////// GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube) - : fColorCubeTransform(kLocal_GrCoordSet, colorCube) + : fColorCubeTransform(kLocal_GrCoordSet, colorCube, GrTextureParams::kBilerp_FilterMode) , fColorCubeAccess(colorCube, "bgra", GrTextureParams::kBilerp_FilterMode) { this->initClassID(); this->addCoordTransform(&fColorCubeTransform); diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index f13a3494fd..f10af7079b 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -454,9 +454,10 @@ GrDisplacementMapEffect::GrDisplacementMapEffect( GrTexture* displacement, const SkMatrix& offsetMatrix, GrTexture* color) - : fDisplacementTransform(kLocal_GrCoordSet, offsetMatrix, displacement) + : fDisplacementTransform(kLocal_GrCoordSet, offsetMatrix, displacement, + GrTextureParams::kNone_FilterMode) , fDisplacementAccess(displacement) - , fColorTransform(kLocal_GrCoordSet, color) + , fColorTransform(kLocal_GrCoordSet, color, GrTextureParams::kNone_FilterMode) , fColorAccess(color) , fXChannelSelector(xChannelSelector) , fYChannelSelector(yChannelSelector) diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp index 23128e0cca..8c2e1ce433 100644 --- a/src/effects/SkGpuBlurUtils.cpp +++ b/src/effects/SkGpuBlurUtils.cpp @@ -207,7 +207,7 @@ GrTexture* GaussianBlur(GrContext* context, matrix.mapRect(&domain, rect); domain.inset(i < scaleFactorX ? SK_ScalarHalf / srcTexture->width() : 0.0f, i < scaleFactorY ? SK_ScalarHalf / srcTexture->height() : 0.0f); - SkAutoTUnref fp(GrTextureDomainEffect::Create( + SkAutoTUnref fp( GrTextureDomainEffect::Create( srcTexture, matrix, domain, diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index 815a81fe7c..dce079e9ae 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -1106,11 +1106,11 @@ GrGradientEffect::GrGradientEffect(GrContext* ctx, fRow = fAtlas->lockRow(bitmap); if (-1 != fRow) { fYCoord = fAtlas->getYOffset(fRow) + SK_ScalarHalf * fAtlas->getNormalizedTexelHeight(); - fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture()); + fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture(), params.filterMode()); fTextureAccess.reset(fAtlas->getTexture(), params); } else { SkAutoTUnref texture(GrRefCachedBitmapTexture(ctx, bitmap, ¶ms)); - fCoordTransform.reset(kCoordSet, matrix, texture); + fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode()); fTextureAccess.reset(texture, params); fYCoord = SK_ScalarHalf; } -- cgit v1.2.3