Commit 027c1020 authored by senorblanco@chromium.org's avatar senorblanco@chromium.org
Browse files

Fix a problem in the matrix convolution image filter exposed by...

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
parent a3bdc1a6
......@@ -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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment