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

Issue 19775006: Implement crop rect for SkImageFilter (Closed)

Created:
7 years, 5 months ago by Stephen White
Modified:
7 years, 5 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

This patch implements a crop rect for SkImageFilter. It has been implemented for SkColorFilterImageFilter and SkBlurImageFilter as examples. In order to preserve the immutability of SkImageFilters, the crop rect is passed as a constructor parameter. If NULL (the default), the bounds of the input image are used, as before. This also tightens up the boundary handling for SkImageBlurFilter on the GPU backend. Where we were previously using clamping semantics, we now respect decal semantics (so we don't oversaturate the edges). This brings the GPU and raster backends into closer alignment, but will require some new baselines for the GPU tests. At a minimum, the following tests will need new baselines: imageblur, imagefiltersbase, imagefilterscropped, spritebitmap. R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=10251 Committed: https://code.google.com/p/skia/source/detail?r=10338

Patch Set 1 #

Patch Set 2 : Add comments; fix texture domain; tweak shader; fix color matrix optimization #

Patch Set 3 : Revert unnecessary changes #

Patch Set 4 : Revert more unnecessary changes #

Total comments: 10

Patch Set 5 : Fix line wrapping #

Patch Set 6 : Handle zero intersection crop rect; add test cases to GM; transpose and simplify GM samples #

Total comments: 4

Patch Set 7 : Update to ToT; add comments. #

Patch Set 8 : Fixed SkColorFilterImageFilter::asColorFilter(); added unit test. #

Patch Set 9 : Revert unrelated changes. #

Patch Set 10 : Expose cropping as a parameter on GaussianBlur; plumb it through to GrConvolutionEffect. #

Patch Set 11 : Fix comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+382 lines, -164 lines) Patch
A + gm/imagefilterscropped.cpp View 1 2 3 4 5 6 7 7 chunks +35 lines, -84 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M gyp/tests.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkImageFilter.h View 1 2 3 4 5 6 3 chunks +20 lines, -4 lines 0 comments Download
M include/core/SkRect.h View 2 chunks +11 lines, -0 lines 0 comments Download
M include/effects/SkBlurImageFilter.h View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M include/effects/SkColorFilterImageFilter.h View 1 2 3 4 2 chunks +6 lines, -2 lines 0 comments Download
M src/core/SkImageFilter.cpp View 1 2 3 4 5 4 chunks +17 lines, -6 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 2 3 4 5 6 7 8 9 8 chunks +48 lines, -27 lines 0 comments Download
M src/effects/SkBlurMaskFilter.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkColorFilterImageFilter.cpp View 1 2 3 4 5 6 7 3 chunks +23 lines, -10 lines 0 comments Download
M src/effects/SkGpuBlurUtils.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -0 lines 0 comments Download
M src/effects/SkGpuBlurUtils.cpp View 1 2 3 4 5 6 7 8 9 6 chunks +46 lines, -10 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 4 chunks +9 lines, -5 lines 0 comments Download
M src/gpu/effects/GrConvolutionEffect.h View 1 2 3 4 5 6 7 8 9 4 chunks +27 lines, -6 lines 0 comments Download
M src/gpu/effects/GrConvolutionEffect.cpp View 1 2 3 4 5 6 7 8 9 10 chunks +52 lines, -8 lines 0 comments Download
A tests/ImageFilterTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +78 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Stephen White
PTAL. This is a work-in-progress, but I welcome feedback on the API.
7 years, 5 months ago (2013-07-18 21:49:55 UTC) #1
bsalomon
On 2013/07/18 21:49:55, Stephen White wrote: > PTAL. This is a work-in-progress, but I welcome ...
7 years, 5 months ago (2013-07-19 13:16:58 UTC) #2
Stephen White
On 2013/07/19 13:16:58, bsalomon wrote: > On 2013/07/18 21:49:55, Stephen White wrote: > > PTAL. ...
7 years, 5 months ago (2013-07-19 20:54:02 UTC) #3
reed1
https://codereview.chromium.org/19775006/diff/8001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/19775006/diff/8001/include/core/SkImageFilter.h#newcode157 include/core/SkImageFilter.h:157: explicit SkImageFilter(SkImageFilter* input, const SkIRect* cropRect = NULL); is ...
7 years, 5 months ago (2013-07-19 21:34:03 UTC) #4
Stephen White
https://codereview.chromium.org/19775006/diff/8001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/19775006/diff/8001/include/core/SkImageFilter.h#newcode157 include/core/SkImageFilter.h:157: explicit SkImageFilter(SkImageFilter* input, const SkIRect* cropRect = NULL); On ...
7 years, 5 months ago (2013-07-19 22:11:50 UTC) #5
Stephen White
OK, I've made applyCropRect() return a bool, and have the filtering code abort on zero ...
7 years, 5 months ago (2013-07-22 17:40:36 UTC) #6
reed1
lgtm w/ request for dox https://codereview.chromium.org/19775006/diff/20001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/19775006/diff/20001/include/core/SkImageFilter.h#newcode157 include/core/SkImageFilter.h:157: explicit SkImageFilter(SkImageFilter* input, const ...
7 years, 5 months ago (2013-07-22 19:11:23 UTC) #7
Stephen White
https://codereview.chromium.org/19775006/diff/20001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/19775006/diff/20001/include/core/SkImageFilter.h#newcode157 include/core/SkImageFilter.h:157: explicit SkImageFilter(SkImageFilter* input, const SkIRect* cropRect = NULL); On ...
7 years, 5 months ago (2013-07-22 19:46:27 UTC) #8
Stephen White
Committed patchset #7 manually as r10251 (presubmit successful).
7 years, 5 months ago (2013-07-22 20:03:30 UTC) #9
robertphillips
This was reverted in r10304 due to some Chromium-side unit test failures (https://codereview.chromium.org/19664010/)
7 years, 5 months ago (2013-07-24 13:18:55 UTC) #10
Stephen White
reed@, bsalomon@: PTAL. This version fixes the webkit_unit_tests failures from the last landing (fixed SkColorFilterImageFilter::asColorFilter). ...
7 years, 5 months ago (2013-07-24 20:52:34 UTC) #11
reed1
lgtm
7 years, 5 months ago (2013-07-24 20:58:50 UTC) #12
robertphillips
Will this still require the rebaseline for the other unit test?
7 years, 5 months ago (2013-07-24 20:59:22 UTC) #13
robertphillips
... and, if so, do you have the new image lying around somewhere?
7 years, 5 months ago (2013-07-24 21:00:29 UTC) #14
Stephen White
> Will this still require the rebaseline for the other unit test? Yes, I think ...
7 years, 5 months ago (2013-07-24 21:02:15 UTC) #15
Stephen White
On 2013/07/24 21:02:15, Stephen White wrote: > > Will this still require the rebaseline for ...
7 years, 5 months ago (2013-07-24 21:36:41 UTC) #16
Stephen White
7 years, 5 months ago (2013-07-24 22:19:33 UTC) #17
Message was sent while issue was closed.
Committed patchset #11 manually as r10338 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698