From 3a5dab4e5e66545e78f0972fe3a448fab1fcca26 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Mon, 4 Jun 2012 20:21:28 +0000 Subject: Always filter gradient textures [GMs could possibly need rebaselining] Review URL: http://codereview.appspot.com/6286048/ git-svn-id: http://skia.googlecode.com/svn/trunk@4151 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/SkGpuDevice.cpp | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index d9d23495ce..7d9b4d9061 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -538,25 +538,28 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev, } GrSamplerState* sampler = grPaint->textureSampler(kShaderTextureIdx); switch (bmptype) { - case SkShader::kRadial_BitmapType: { - sampler->setCustomStage(new GrRadialGradient())->unref(); - } break; - case SkShader::kSweep_BitmapType: { - sampler->setCustomStage(new GrSweepGradient())->unref(); - } break; - case SkShader::kTwoPointRadial_BitmapType: { - sampler->setCustomStage(new - GrRadial2Gradient(twoPointParams[0], - twoPointParams[1], - twoPointParams[2] < 0))->unref(); - } break; - default: - break; - } - if (skPaint.isFilterBitmap()) { - sampler->setFilter(GrSamplerState::kBilinear_Filter); - } else { - sampler->setFilter(GrSamplerState::kNearest_Filter); + case SkShader::kRadial_BitmapType: + sampler->setCustomStage(new GrRadialGradient())->unref(); + sampler->setFilter(GrSamplerState::kBilinear_Filter); + break; + case SkShader::kSweep_BitmapType: + sampler->setCustomStage(new GrSweepGradient())->unref(); + sampler->setFilter(GrSamplerState::kBilinear_Filter); + break; + case SkShader::kTwoPointRadial_BitmapType: + sampler->setCustomStage(new + GrRadial2Gradient(twoPointParams[0], + twoPointParams[1], + twoPointParams[2] < 0))->unref(); + sampler->setFilter(GrSamplerState::kBilinear_Filter); + break; + default: + if (skPaint.isFilterBitmap()) { + sampler->setFilter(GrSamplerState::kBilinear_Filter); + } else { + sampler->setFilter(GrSamplerState::kNearest_Filter); + } + break; } sampler->setWrapX(sk_tile_mode_to_grwrap(tileModes[0])); sampler->setWrapY(sk_tile_mode_to_grwrap(tileModes[1])); -- cgit v1.2.3