Index: src/gpu/effects/GrMatrixConvolutionEffect.cpp |
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp |
index cd6d7c1f862b70e699b5c5ad8d92583602dd0731..0b0a8af1944bc49d8c1824f2b23f1ddf7378ae48 100644 |
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp |
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp |
@@ -90,6 +90,7 @@ void GrGLMatrixConvolutionEffect::emitCode(GrGLFPBuilder* builder, |
fDomain.sampleTexture(fsBuilder, domain, "c", coord, samplers[0]); |
if (!fConvolveAlpha) { |
fsBuilder->codeAppend("c.rgb /= c.a;"); |
+ fsBuilder->codeAppend("c.rgb = clamp(c.rgb, 0.0, 1.0);"); |
} |
fsBuilder->codeAppend("sum += c * k;"); |
} |
@@ -152,7 +153,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture, |
fGain(SkScalarToFloat(gain)), |
fBias(SkScalarToFloat(bias) / 255.0f), |
fConvolveAlpha(convolveAlpha), |
- fDomain(GrTextureDomain::MakeTexelDomain(texture, bounds), tileMode) { |
+ fDomain(GrTextureDomain::MakeTexelDomainForMode(texture, bounds, tileMode), tileMode) { |
this->initClassID<GrMatrixConvolutionEffect>(); |
for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { |
fKernel[i] = SkScalarToFloat(kernel[i]); |