aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-02-15 10:09:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-16 13:39:35 +0000
commitdb78cba957889285604aeacb75e47af4600880c4 (patch)
treebd44a73a8de38497aed8319bc5b880c12d3b2a7a /src/gpu/SkGpuDevice.cpp
parentf6f7b67ac230b14a725fbdabe951c70ea5b4428f (diff)
Avoid creating MIPs until necessary when MIP bias is active
With sharpened mips, the scale at which we begin to sample level 1 is (obviously) less than 1. This change avoids creation of mips for images that are only slightly downscaled (and for which we wouldn't have sampled those MIPs anyway). Change-Id: If8ffc79c2ce2ff1f3aae7f5732d8a50aca0e26be Reviewed-on: https://skia-review.googlesource.com/107801 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7521278fac..9a01394691 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -761,8 +761,9 @@ bool SkGpuDevice::shouldTileImage(const SkImage* image, const SkRect* srcRectPtr
GrSamplerState samplerState;
bool doBicubic;
- GrSamplerState::Filter textureFilterMode =
- GrSkFilterQualityToGrFilterMode(quality, viewMatrix, srcToDstRect, &doBicubic);
+ GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
+ quality, viewMatrix, srcToDstRect, fContext->contextPriv().sharpenMipmappedTextures(),
+ &doBicubic);
int tileFilterPad;
if (doBicubic) {
@@ -812,7 +813,8 @@ void SkGpuDevice::drawBitmap(const SkBitmap& bitmap,
GrSamplerState samplerState;
bool doBicubic;
GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
- paint.getFilterQuality(), viewMatrix, SkMatrix::I(), &doBicubic);
+ paint.getFilterQuality(), viewMatrix, SkMatrix::I(),
+ fContext->contextPriv().sharpenMipmappedTextures(), &doBicubic);
int tileFilterPad;
@@ -1170,7 +1172,8 @@ void SkGpuDevice::drawBitmapRect(const SkBitmap& bitmap,
GrSamplerState sampleState;
bool doBicubic;
GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
- paint.getFilterQuality(), this->ctm(), srcToDstMatrix, &doBicubic);
+ paint.getFilterQuality(), this->ctm(), srcToDstMatrix,
+ fContext->contextPriv().sharpenMipmappedTextures(), &doBicubic);
int tileFilterPad;
@@ -1362,7 +1365,8 @@ void SkGpuDevice::drawProducerNine(GrTextureProducer* producer,
GrFSAAType::kUnifiedMSAA == fRenderTargetContext->fsaaType();
bool doBicubic;
GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
- paint.getFilterQuality(), this->ctm(), SkMatrix::I(), &doBicubic);
+ paint.getFilterQuality(), this->ctm(), SkMatrix::I(),
+ fContext->contextPriv().sharpenMipmappedTextures(), &doBicubic);
if (useFallback || doBicubic || GrSamplerState::Filter::kNearest != textureFilterMode) {
SkLatticeIter iter(producer->width(), producer->height(), center, dst);