diff options
author | 2013-10-20 20:21:19 +0000 | |
---|---|---|
committer | 2013-10-20 20:21:19 +0000 | |
commit | 2a4223c783e35f1c6095c4736a9246884e51a48d (patch) | |
tree | dcddb6f94674b467fc7962aadc88f1508ab05633 /src | |
parent | b5e391025e9859937fd6b4b3f4b8204d0bb73859 (diff) |
Fix for cropped matrix convolution for BottomLeft render targets.
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/31083002
git-svn-id: http://skia.googlecode.com/svn/trunk@11872 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkMatrixConvolutionImageFilter.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index 04326c6514..a9dfecce59 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -515,11 +515,15 @@ void GrGLMatrixConvolutionEffect::setData(const GrGLUniformManager& uman, uman.set1f(fGainUni, conv.gain()); uman.set1f(fBiasUni, conv.bias()); const SkIRect& bounds = conv.bounds(); - uman.set4f(fBoundsUni, - (float) bounds.left() / texture.width(), - (float) bounds.top() / texture.height(), - (float) bounds.right() / texture.width(), - (float) bounds.bottom() / texture.height()); + float left = (float) bounds.left() / texture.width(); + float top = (float) bounds.top() / texture.height(); + float right = (float) bounds.right() / texture.width(); + float bottom = (float) bounds.bottom() / texture.height(); + if (texture.origin() == kBottomLeft_GrSurfaceOrigin) { + uman.set4f(fBoundsUni, left, 1.0f - bottom, right, 1.0f - top); + } else { + uman.set4f(fBoundsUni, left, top, right, bottom); + } } GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture, |