Have GrRectBlurEffect use Linear filtering (rather than Nearest Neighbor)

Committed: https://skia.googlesource.com/skia/+/2d70bcccc9ba8f3898a7ae506ba7410ed8e9c9db

Review URL: https://codereview.chromium.org/1378023004
This commit is contained in:
robertphillips 2015-10-04 08:36:51 -07:00 committed by Commit bot
parent 1f7e7ec195
commit 5175b95630
2 changed files with 3 additions and 3 deletions

View File

@ -681,7 +681,7 @@ static float gaussianIntegral(float x) {
uint8_t* SkBlurMask::ComputeBlurProfile(SkScalar sigma) {
int size = SkScalarCeilToInt(6*sigma);
int center = size >> 1;
float center = 0.5f * size;
uint8_t* profile = new uint8_t[size];
float invr = 1.f/(2*sigma);

View File

@ -677,7 +677,7 @@ void OutputRectBlurProfileLookup(GrGLFragmentBuilder* fsBuilder,
const char *sharp_width) {
fsBuilder->codeAppendf("\tfloat %s;\n", output);
fsBuilder->codeAppendf("\t\t{\n");
fsBuilder->codeAppendf("\t\t\tfloat coord = (0.5 * (abs(2.0*%s - %s) - %s))/%s;\n",
fsBuilder->codeAppendf("\t\t\tfloat coord = (0.5 * (abs(2.0*%s - %s) - %s) + 0.5)/%s;\n",
loc, blurred_width, sharp_width, profileSize);
fsBuilder->codeAppendf("\t\t\t%s = ", output);
fsBuilder->appendTextureLookup(sampler, "vec2(coord,0.5)");
@ -769,7 +769,7 @@ GrTexture* GrRectBlurEffect::CreateBlurProfileTexture(GrTextureProvider* texture
GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blurProfile)
: fRect(rect)
, fSigma(sigma)
, fBlurProfileAccess(blurProfile) {
, fBlurProfileAccess(blurProfile, GrTextureParams::kBilerp_FilterMode) {
this->initClassID<GrRectBlurEffect>();
this->addTextureAccess(&fBlurProfileAccess);
this->setWillReadFragmentPosition();