diff options
author | 2013-07-25 18:49:07 +0000 | |
---|---|---|
committer | 2013-07-25 18:49:07 +0000 | |
commit | b86add1ad37776818e1f730359ec587c9fdbff5f (patch) | |
tree | 60ffaf791a016466b521853c13fa98c99d101000 /src | |
parent | 7168ecc363f4f205c81c777e44cc6659f36e2821 (diff) |
make the filter mode for GrTextureAccess an enum so we can plumb down
the paint's filter modes to the GPU
BUG=
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/20362002
git-svn-id: http://skia.googlecode.com/svn/trunk@10368 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmapProcShader.cpp | 23 | ||||
-rw-r--r-- | src/effects/SkGpuBlurUtils.cpp | 6 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 5 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 7 | ||||
-rw-r--r-- | src/gpu/GrSWMaskHelper.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrTextContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrTexture.cpp | 19 | ||||
-rw-r--r-- | src/gpu/GrTextureAccess.cpp | 16 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 28 | ||||
-rw-r--r-- | src/gpu/effects/GrSimpleTextureEffect.cpp | 3 | ||||
-rw-r--r-- | src/gpu/effects/GrSimpleTextureEffect.h | 10 | ||||
-rw-r--r-- | src/gpu/effects/GrSingleTextureEffect.cpp | 4 | ||||
-rw-r--r-- | src/gpu/effects/GrSingleTextureEffect.h | 3 | ||||
-rw-r--r-- | src/gpu/effects/GrTextureDomainEffect.cpp | 12 | ||||
-rw-r--r-- | src/gpu/effects/GrTextureDomainEffect.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 2 |
17 files changed, 100 insertions, 48 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index 76ccb512b4..7fff799c11 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -9,6 +9,7 @@ #include "SkColorPriv.h" #include "SkFlattenableBuffers.h" #include "SkPixelRef.h" +#include "SkErrorInternals.h" bool SkBitmapProcShader::CanDo(const SkBitmap& bm, TileMode tx, TileMode ty) { switch (bm.config()) { @@ -353,7 +354,27 @@ GrEffectRef* SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& }; // Must set wrap and filter on the sampler before requesting a texture. - GrTextureParams params(tm, paint.isFilterBitmap()); + SkPaint::FilterLevel paintFilterLevel = paint.getFilterLevel(); + GrTextureParams::FilterMode textureFilterMode; + switch(paintFilterLevel) { + case SkPaint::kNone_FilterLevel: + textureFilterMode = GrTextureParams::kNone_FilterMode; + break; + case SkPaint::kLow_FilterLevel: + textureFilterMode = GrTextureParams::kBilerp_FilterMode; + break; + case SkPaint::kMedium_FilterLevel: + textureFilterMode = GrTextureParams::kMipMap_FilterMode; + break; + case SkPaint::kHigh_FilterLevel: + SkErrorInternals::SetError( kInvalidPaint_SkError, + "Sorry, I don't yet support high quality " + "filtering on the GPU; falling back to " + "MIPMaps."); + textureFilterMode = GrTextureParams::kMipMap_FilterMode; + break; + } + GrTextureParams params(tm, textureFilterMode); GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, fRawBitmap, ¶ms); if (NULL == texture) { diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp index 260b2e2855..0769237353 100644 --- a/src/effects/SkGpuBlurUtils.cpp +++ b/src/effects/SkGpuBlurUtils.cpp @@ -132,10 +132,10 @@ GrTexture* GaussianBlur(GrContext* context, matrix, domain, GrTextureDomainEffect::kDecal_WrapMode, - true)); + GrTextureParams::kBilerp_FilterMode)); paint.addColorEffect(effect); } else { - GrTextureParams params(SkShader::kClamp_TileMode, true); + GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode); paint.addColorTextureEffect(srcTexture, matrix, params); } scale_rect(&dstRect, i < scaleFactorX ? 0.5f : 1.0f, @@ -199,7 +199,7 @@ GrTexture* GaussianBlur(GrContext* context, GrPaint paint; // FIXME: this should be mitchell, not bilinear. - GrTextureParams params(SkShader::kClamp_TileMode, true); + GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode); paint.addColorTextureEffect(srcTexture, matrix, params); SkRect dstRect(srcRect); diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index 6dcbb05f7e..de43b69a2f 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -914,7 +914,7 @@ GrGradientEffect::GrGradientEffect(GrContext* ctx, // We always filter the gradient table. Each table is one row of a texture, so always y-clamp. GrTextureParams params; - params.setBilerp(true); + params.setFilterMode(GrTextureParams::kBilerp_FilterMode); params.setTileModeX(tileMode); fRow = fAtlas->lockRow(bitmap); diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index 7465283c38..9831f1d77c 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -53,7 +53,7 @@ void setup_drawstate_aaclip(GrGpu* gpu, mat, GrTextureDomainEffect::MakeTexelDomain(result, domainTexels), GrTextureDomainEffect::kDecal_WrapMode, - false, + GrTextureParams::kNone_FilterMode, GrEffect::kPosition_CoordsType))->unref(); } @@ -358,12 +358,13 @@ void GrClipMaskManager::mergeMask(GrTexture* dstMask, SkMatrix sampleM; sampleM.setIDiv(srcMask->width(), srcMask->height()); + drawState->addColorEffect( GrTextureDomainEffect::Create(srcMask, sampleM, GrTextureDomainEffect::MakeTexelDomain(srcMask, srcBound), GrTextureDomainEffect::kDecal_WrapMode, - false))->unref(); + GrTextureParams::kNone_FilterMode))->unref(); fGpu->drawSimpleRect(SkRect::MakeFromIRect(dstBound), NULL); } diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 3951d919e6..0d98ecd320 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -306,7 +306,7 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc, const GrCacheID& cacheID, void* srcData, size_t rowBytes, - bool needsFiltering) { + bool filter) { SkAutoTUnref<GrTexture> clampedTexture(this->findAndRefTexture(desc, cacheID, NULL)); if (NULL == clampedTexture) { clampedTexture.reset(this->createTexture(NULL, desc, cacheID, srcData, rowBytes)); @@ -333,7 +333,8 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc, // if filtering is not desired then we want to ensure all // texels in the resampled image are copies of texels from // the original. - GrTextureParams params(SkShader::kClamp_TileMode, needsFiltering); + GrTextureParams params(SkShader::kClamp_TileMode, filter ? GrTextureParams::kBilerp_FilterMode : + GrTextureParams::kNone_FilterMode); drawState->addColorTextureEffect(clampedTexture, SkMatrix::I(), params); drawState->setVertexAttribs<gVertexAttribs>(SK_ARRAY_COUNT(gVertexAttribs)); @@ -384,7 +385,7 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params, if (GrTexture::NeedsResizing(resourceKey)) { texture = this->createResizedTexture(desc, cacheID, srcData, rowBytes, - GrTexture::NeedsFiltering(resourceKey)); + GrTexture::NeedsBilerp(resourceKey)); } else { texture= fGpu->createTexture(desc, srcData, rowBytes); } diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index eb5c555a1f..f6e6c3127d 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -197,7 +197,7 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture, drawState->addCoverageEffect( GrSimpleTextureEffect::Create(texture, maskMatrix, - false, + GrTextureParams::kNone_FilterMode, GrEffect::kPosition_CoordsType))->unref(); target->drawSimpleRect(dstRect); diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp index c9e6d17ba3..5af0851f4c 100644 --- a/src/gpu/GrTextContext.cpp +++ b/src/gpu/GrTextContext.cpp @@ -33,7 +33,7 @@ void GrTextContext::flushGlyphs() { // setup our sampler state for our text texture/atlas GrAssert(GrIsALIGN4(fCurrVertex)); GrAssert(fCurrTexture); - GrTextureParams params(SkShader::kRepeat_TileMode, false); + GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kNone_FilterMode); // This effect could be stored with one of the cache objects (atlas?) drawState->addCoverageEffect( diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index 6452aae9b1..c05f35d9e3 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -113,10 +113,10 @@ enum TextureFlags { */ kStretchToPOT_TextureFlag = 0x1, /** - * The kFilter bit can only be set when the kStretchToPOT flag is set and indicates whether the - * stretched texture should be bilerp filtered or point sampled. + * The kBilerp bit can only be set when the kStretchToPOT flag is set and indicates whether the + * stretched texture should be bilerped. */ - kFilter_TextureFlag = 0x2, + kBilerp_TextureFlag = 0x2, }; namespace { @@ -128,8 +128,13 @@ GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, if (tiled && !gpu->caps()->npotTextureTileSupport()) { if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) { flags |= kStretchToPOT_TextureFlag; - if (params->isBilerp()) { - flags |= kFilter_TextureFlag; + switch(params->filterMode()) { + case GrTextureParams::kNone_FilterMode: + break; + case GrTextureParams::kBilerp_FilterMode: + case GrTextureParams::kMipMap_FilterMode: + flags |= kBilerp_TextureFlag; + break; } } } @@ -186,6 +191,6 @@ bool GrTexture::NeedsResizing(const GrResourceKey& key) { return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); } -bool GrTexture::NeedsFiltering(const GrResourceKey& key) { - return SkToBool(key.getResourceFlags() & kFilter_TextureFlag); +bool GrTexture::NeedsBilerp(const GrResourceKey& key) { + return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); } diff --git a/src/gpu/GrTextureAccess.cpp b/src/gpu/GrTextureAccess.cpp index 499b1f237f..ae6c04222f 100644 --- a/src/gpu/GrTextureAccess.cpp +++ b/src/gpu/GrTextureAccess.cpp @@ -21,9 +21,9 @@ GrTextureAccess::GrTextureAccess(GrTexture* texture, const GrTextureParams& para } GrTextureAccess::GrTextureAccess(GrTexture* texture, - bool bilerp, + GrTextureParams::FilterMode filterMode, SkShader::TileMode tileXAndY) { - this->reset(texture, bilerp, tileXAndY); + this->reset(texture, filterMode, tileXAndY); } GrTextureAccess::GrTextureAccess(GrTexture* texture, @@ -34,9 +34,9 @@ GrTextureAccess::GrTextureAccess(GrTexture* texture, GrTextureAccess::GrTextureAccess(GrTexture* texture, const char* swizzle, - bool bilerp, + GrTextureParams::FilterMode filterMode, SkShader::TileMode tileXAndY) { - this->reset(texture, swizzle, bilerp, tileXAndY); + this->reset(texture, swizzle, filterMode, tileXAndY); } void GrTextureAccess::reset(GrTexture* texture, @@ -52,12 +52,12 @@ void GrTextureAccess::reset(GrTexture* texture, void GrTextureAccess::reset(GrTexture* texture, const char* swizzle, - bool bilerp, + GrTextureParams::FilterMode filterMode, SkShader::TileMode tileXAndY) { GrAssert(NULL != texture); GrAssert(strlen(swizzle) >= 1 && strlen(swizzle) <= 4); - fParams.reset(tileXAndY, bilerp); + fParams.reset(tileXAndY, filterMode); fTexture.reset(SkRef(texture)); this->setSwizzle(swizzle); } @@ -72,11 +72,11 @@ void GrTextureAccess::reset(GrTexture* texture, } void GrTextureAccess::reset(GrTexture* texture, - bool bilerp, + GrTextureParams::FilterMode filterMode, SkShader::TileMode tileXAndY) { GrAssert(NULL != texture); fTexture.reset(SkRef(texture)); - fParams.reset(tileXAndY, bilerp); + fParams.reset(tileXAndY, filterMode); memcpy(fSwizzle, "rgba", 5); fSwizzleMask = kRGBA_GrColorComponentFlags; } diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 000efee84b..e79801c982 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -24,6 +24,7 @@ #include "SkRRect.h" #include "SkStroke.h" #include "SkUtils.h" +#include "SkErrorInternals.h" #define CACHE_COMPATIBLE_DEVICE_TEXTURES 1 @@ -1134,7 +1135,28 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, } GrTextureParams params; - params.setBilerp(paint.isFilterBitmap()); + SkPaint::FilterLevel paintFilterLevel = paint.getFilterLevel(); + GrTextureParams::FilterMode textureFilterMode; + switch(paintFilterLevel) { + case SkPaint::kNone_FilterLevel: + textureFilterMode = GrTextureParams::kNone_FilterMode; + break; + case SkPaint::kLow_FilterLevel: + textureFilterMode = GrTextureParams::kBilerp_FilterMode; + break; + case SkPaint::kMedium_FilterLevel: + textureFilterMode = GrTextureParams::kMipMap_FilterMode; + break; + case SkPaint::kHigh_FilterLevel: + SkErrorInternals::SetError( kInvalidPaint_SkError, + "Sorry, I don't yet support high quality " + "filtering on the GPU. Falling back to " + "MIPMaps."); + textureFilterMode = GrTextureParams::kMipMap_FilterMode; + break; + } + + params.setFilterMode(textureFilterMode); if (!this->shouldTileBitmap(bitmap, params, srcRectPtr)) { // take the simple case @@ -1278,7 +1300,7 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, SkScalarMul(srcRect.fBottom, hInv)); bool needsTextureDomain = false; - if (params.isBilerp()) { + if (params.filterMode() != GrTextureParams::kNone_FilterMode) { // Need texture domain if drawing a sub rect. needsTextureDomain = srcRect.width() < bitmap.width() || srcRect.height() < bitmap.height(); @@ -1323,7 +1345,7 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, SkMatrix::I(), textureDomain, GrTextureDomainEffect::kClamp_WrapMode, - params.isBilerp())); + params.filterMode())); } else { effect.reset(GrSimpleTextureEffect::Create(texture, SkMatrix::I(), params)); } diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp index c2dc360e28..06615d296b 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.cpp +++ b/src/gpu/effects/GrSimpleTextureEffect.cpp @@ -110,7 +110,8 @@ GrEffectRef* GrSimpleTextureEffect::TestCreate(SkMWCRandom* random, kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], }; - GrTextureParams params(tileModes, random->nextBool()); + GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode : + GrTextureParams::kNone_FilterMode); static const CoordsType kCoordsTypes[] = { kLocal_CoordsType, diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h index 661f40f037..f80ff8da86 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.h +++ b/src/gpu/effects/GrSimpleTextureEffect.h @@ -27,18 +27,18 @@ public: const SkMatrix& matrix, CoordsType coordsType = kLocal_CoordsType) { GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType); - AutoEffectUnref effect(SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, false, coordsType))); + AutoEffectUnref effect(SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, GrTextureParams::kNone_FilterMode, coordsType))); return CreateEffectRef(effect); } /* clamp mode */ static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, - bool bilerp, + GrTextureParams::FilterMode filterMode, CoordsType coordsType = kLocal_CoordsType) { GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType); AutoEffectUnref effect( - SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, bilerp, coordsType))); + SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, filterMode, coordsType))); return CreateEffectRef(effect); } @@ -74,9 +74,9 @@ public: private: GrSimpleTextureEffect(GrTexture* texture, const SkMatrix& matrix, - bool bilerp, + GrTextureParams::FilterMode filterMode, CoordsType coordsType) - : GrSingleTextureEffect(texture, matrix, bilerp, coordsType) { + : GrSingleTextureEffect(texture, matrix, filterMode, coordsType) { GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType); } diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp index 0c671f16d0..532ce04217 100644 --- a/src/gpu/effects/GrSingleTextureEffect.cpp +++ b/src/gpu/effects/GrSingleTextureEffect.cpp @@ -18,9 +18,9 @@ GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, const SkMatrix& m, - bool bilerp, + GrTextureParams::FilterMode filterMode, CoordsType coordsType) - : fTextureAccess(texture, bilerp) + : fTextureAccess(texture, filterMode) , fMatrix(m) , fCoordsType(coordsType) { this->addTextureAccess(&fTextureAccess); diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h index 3e0af65fcb..74ca9f94cf 100644 --- a/src/gpu/effects/GrSingleTextureEffect.h +++ b/src/gpu/effects/GrSingleTextureEffect.h @@ -30,7 +30,8 @@ protected: /** unfiltered, clamp mode */ GrSingleTextureEffect(GrTexture*, const SkMatrix&, CoordsType = kLocal_CoordsType); /** clamp mode */ - GrSingleTextureEffect(GrTexture*, const SkMatrix&, bool bilerp, CoordsType = kLocal_CoordsType); + GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMode filterMode, + CoordsType = kLocal_CoordsType); GrSingleTextureEffect(GrTexture*, const SkMatrix&, const GrTextureParams&, diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp index 96372d926f..eb4001d949 100644 --- a/src/gpu/effects/GrTextureDomainEffect.cpp +++ b/src/gpu/effects/GrTextureDomainEffect.cpp @@ -153,11 +153,11 @@ GrEffectRef* GrTextureDomainEffect::Create(GrTexture* texture, const SkMatrix& matrix, const SkRect& domain, WrapMode wrapMode, - bool bilerp, + GrTextureParams::FilterMode filterMode, CoordsType coordsType) { static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1}; if (kClamp_WrapMode == wrapMode && domain.contains(kFullRect)) { - return GrSimpleTextureEffect::Create(texture, matrix, bilerp); + return GrSimpleTextureEffect::Create(texture, matrix, filterMode); } else { SkRect clippedDomain; // We don't currently handle domains that are empty or don't intersect the texture. @@ -176,7 +176,7 @@ GrEffectRef* GrTextureDomainEffect::Create(GrTexture* texture, matrix, clippedDomain, wrapMode, - bilerp, + filterMode, coordsType))); return CreateEffectRef(effect); @@ -187,9 +187,9 @@ GrTextureDomainEffect::GrTextureDomainEffect(GrTexture* texture, const SkMatrix& matrix, const SkRect& domain, WrapMode wrapMode, - bool bilerp, + GrTextureParams::FilterMode filterMode, CoordsType coordsType) - : GrSingleTextureEffect(texture, matrix, bilerp, coordsType) + : GrSingleTextureEffect(texture, matrix, filterMode, coordsType) , fWrapMode(wrapMode) , fTextureDomain(domain) { } @@ -239,6 +239,6 @@ GrEffectRef* GrTextureDomainEffect::TestCreate(SkMWCRandom* random, matrix, domain, wrapMode, - bilerp, + bilerp ? GrTextureParams::kBilerp_FilterMode : GrTextureParams::kNone_FilterMode, coords); } diff --git a/src/gpu/effects/GrTextureDomainEffect.h b/src/gpu/effects/GrTextureDomainEffect.h index a4017c1881..d07f2fc006 100644 --- a/src/gpu/effects/GrTextureDomainEffect.h +++ b/src/gpu/effects/GrTextureDomainEffect.h @@ -38,7 +38,7 @@ public: const SkMatrix&, const SkRect& domain, WrapMode, - bool bilerp, + GrTextureParams::FilterMode filterMode, CoordsType = kLocal_CoordsType); virtual ~GrTextureDomainEffect(); @@ -76,7 +76,7 @@ private: const SkMatrix&, const SkRect& domain, WrapMode, - bool bilerp, + GrTextureParams::FilterMode filterMode, CoordsType type); virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index cf6cf413e7..4102c8c48b 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -2006,7 +2006,7 @@ void GrGpuGL::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur bool setAll = timestamp < this->getResetTimestamp(); GrGLTexture::TexParams newTexParams; - newTexParams.fFilter = params.isBilerp() ? GR_GL_LINEAR : GR_GL_NEAREST; + newTexParams.fFilter = (params.filterMode() == GrTextureParams::kNone_FilterMode) ? GR_GL_LINEAR : GR_GL_NEAREST; newTexParams.fWrapS = tile_to_gl_wrap(params.getTileModeX()); newTexParams.fWrapT = tile_to_gl_wrap(params.getTileModeY()); |