aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 21:53:45 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 21:53:45 +0000
commit027c10207a45a9b754047136ea5403b764d9a751 (patch)
tree67ba42539f290a95bf4857edf146e2b51ebac227 /src
parenta3bdc1a6cd1ce9630df43a28fffef17a12c41f32 (diff)
Fix a problem in the matrix convolution image filter exposed by https://code.google.com/p/skia/source/detail?r=7152: when offsetting texture coordinates in a GrEffect, take the origin of the source bitmap origin into account, and flip Y coordinates when we need to.
NOTE: this will cause the matrixconvolution GM's to need to be rebaselined (again!). Review URL: https://codereview.appspot.com/7086054 git-svn-id: http://skia.googlecode.com/svn/trunk@7168 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 74f04bfe3b..657c996a40 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -455,8 +455,9 @@ void GrGLMatrixConvolutionEffect::setData(const GrGLUniformManager& uman,
GrAssert(effect.kernelSize() == fKernelSize);
GrAssert(effect.tileMode() == fTileMode);
float imageIncrement[2];
+ float ySign = texture.origin() == GrSurface::kTopLeft_Origin ? 1.0f : -1.0f;
imageIncrement[0] = 1.0f / texture.width();
- imageIncrement[1] = 1.0f / texture.height();
+ imageIncrement[1] = ySign / texture.height();
uman.set2fv(fImageIncrementUni, 0, 1, imageIncrement);
uman.set2fv(fTargetUni, 0, 1, effect.target());
uman.set1fv(fKernelUni, 0, fKernelSize.width() * fKernelSize.height(), effect.kernel());