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
This commit is contained in:
bsalomon@google.com 2012-06-04 20:21:28 +00:00
parent e287c1b49d
commit 3a5dab4e5e

View File

@ -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]));