Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(371)

Issue 7086054: Fix a problem in the matrix convolution image filter exposed by https://code.google.com/p/skia/sour… (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by Stephen White
Modified:
11 years, 10 months ago
Reviewers:
bsalomon
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

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!). Committed: https://code.google.com/p/skia/source/detail?r=7168

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M src/effects/SkMatrixConvolutionImageFilter.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 2
Stephen White
PTAL
11 years, 10 months ago (2013-01-14 21:39:01 UTC) #1
bsalomon
11 years, 10 months ago (2013-01-14 21:39:56 UTC) #2
LGTM


On Mon, Jan 14, 2013 at 4:39 PM, <senorblanco@chromium.org> wrote:

> Reviewers: bsalomon,
>
> Message:
> PTAL
>
> Description:
> Fix a problem in the matrix convolution image filter exposed by
>
https://code.google.com/p/**skia/source/detail?r=7152<https://code.google.com...:
>  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.
>
>
> Please review this at
https://codereview.appspot.**com/7086054/<https://codereview.appspot.com/7086...
>
> Affected files:
>   M src/effects/**SkMatrixConvolutionImageFilter**.cpp
>
>
> Index: src/effects/**SkMatrixConvolutionImageFilter**.cpp
> diff --git a/src/effects/**SkMatrixConvolutionImageFilter**.cpp
> b/src/effects/**SkMatrixConvolutionImageFilter**.cpp
> index 74f04bfe3b31dc78038bd88f65bd2e**81cc79c39a..**
> 657c996a40cd054f0c4e8ac1a5111f**aba1a9d391 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());
>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b