Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 31083002: Fix for cropped matrix convolution for BottomLeft render targets. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: matrixconvolution GM: move crop rect up, so it's not symmetric in Y Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/matrixconvolution.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 04326c6514cf4e37b35d519362a600c5bb62a7fc..a9dfecce5918f90ae80db218eb8b2d10f4bca64a 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,
« no previous file with comments | « gm/matrixconvolution.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698