aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-04 20:21:28 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-04 20:21:28 +0000
commit3a5dab4e5e66545e78f0972fe3a448fab1fcca26 (patch)
tree886ca5f0dfc18624ca48c84b0a621f35c7120c94
parente287c1b49db7045f37fbe9d837fbbb896ca01b88 (diff)
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
-rw-r--r--src/gpu/SkGpuDevice.cpp41
1 files 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]));