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

Issue 198003008: Implement support for expanding crop rects in image filters (Closed)

Created:
6 years, 9 months ago by Stephen White
Modified:
6 years, 9 months ago
Reviewers:
bsalomon, reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Implement support for expanding crop rects in image filters NOTE: this patch set is based on https://codereview.chromium.org/189913021/, and needs that patch to land first. Until now, crop rects in Skia have only been able to reduce the size of the destination bounds, but not expand them. SVG semantics require the latter as well. The heart of the change is in applyCropRect(), which now assigns each edge, instead of doing an intersection with the crop rect. In order to support this (and still work well with tiled drawing) we need to clip the resulting crop rect to the clipping region of the filters. This uses the Context struct previously landed from https://codereview.chromium.org/189913021/. Many of the pixel loops are not yet ready to handle a destination rect larger than the source rect. So we provide a convenience version of applyCropRect() which creates an offscreen and pads it out with transparent black. Once the pixel loops and shaders have been fixed to support larger destination bounds, they should be switched back to the non-drawing version of applyCropRect(). BUG=skia: R=bsalomon@google.com, reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=13805 Committed: https://code.google.com/p/skia/source/detail?r=13809

Patch Set 1 #

Total comments: 3

Patch Set 2 : Reorder applyCropRect() params; fix 100-col issues; tweak GM #

Total comments: 4

Patch Set 3 : Fixed this-> nits #

Patch Set 4 : Fixed nits (w/correct upstream) #

Patch Set 5 : Rebase to ToT; fix Win32 #

Patch Set 6 : Fix ImageFilterTest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+306 lines, -103 lines) Patch
A gm/imagefilterscropexpand.cpp View 1 2 3 4 1 chunk +170 lines, -0 lines 0 comments Download
M gm/imagefiltersgraph.cpp View 1 3 4 1 chunk +1 line, -3 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkImageFilter.h View 1 3 4 1 chunk +19 lines, -4 lines 0 comments Download
M src/core/SkImageFilter.cpp View 1 3 4 3 chunks +52 lines, -11 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 3 4 2 chunks +6 lines, -10 lines 0 comments Download
M src/effects/SkColorFilterImageFilter.cpp View 1 3 4 1 chunk +1 line, -3 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 1 3 4 5 chunks +30 lines, -30 lines 0 comments Download
M src/effects/SkDropShadowImageFilter.cpp View 1 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 1 3 4 3 chunks +11 lines, -14 lines 0 comments Download
M src/effects/SkMatrixConvolutionImageFilter.cpp View 1 3 4 1 chunk +1 line, -3 lines 0 comments Download
M src/effects/SkMergeImageFilter.cpp View 1 3 4 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkMorphologyImageFilter.cpp View 1 3 4 2 chunks +2 lines, -6 lines 0 comments Download
M src/effects/SkOffsetImageFilter.cpp View 1 3 4 1 chunk +1 line, -4 lines 0 comments Download
M src/effects/SkRectShaderImageFilter.cpp View 1 3 4 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkXfermodeImageFilter.cpp View 1 3 4 1 chunk +5 lines, -6 lines 0 comments Download
M tests/ImageFilterTest.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
Stephen White
PTAL. This contains the applyCropRect() changes formerly part of https://codereview.chromium.org/189913021/.
6 years, 9 months ago (2014-03-13 23:36:58 UTC) #1
reed1
The impl changes look clean. A question about visibility of the helper functions. https://codereview.chromium.org/198003008/diff/1/include/core/SkImageFilter.h File ...
6 years, 9 months ago (2014-03-14 12:49:16 UTC) #2
Stephen White
https://codereview.chromium.org/198003008/diff/1/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/198003008/diff/1/include/core/SkImageFilter.h#newcode232 include/core/SkImageFilter.h:232: bool applyCropRect(const SkBitmap& src, const SkIPoint& srcOffset, On 2014/03/14 ...
6 years, 9 months ago (2014-03-14 13:38:01 UTC) #3
reed1
api lgtm https://codereview.chromium.org/198003008/diff/1/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/198003008/diff/1/include/core/SkImageFilter.h#newcode232 include/core/SkImageFilter.h:232: bool applyCropRect(const SkBitmap& src, const SkIPoint& srcOffset, ...
6 years, 9 months ago (2014-03-14 14:12:05 UTC) #4
Stephen White
New patch while waiting for the tree to open: - applyCropRect: moved the context param ...
6 years, 9 months ago (2014-03-14 15:01:59 UTC) #5
bsalomon
lgtm with two this-> nits. https://codereview.chromium.org/198003008/diff/20001/src/effects/SkXfermodeImageFilter.cpp File src/effects/SkXfermodeImageFilter.cpp (right): https://codereview.chromium.org/198003008/diff/20001/src/effects/SkXfermodeImageFilter.cpp#newcode65 src/effects/SkXfermodeImageFilter.cpp:65: if (!applyCropRect(ctx, foreground, foregroundOffset, ...
6 years, 9 months ago (2014-03-14 15:11:27 UTC) #6
Stephen White
https://codereview.chromium.org/198003008/diff/20001/src/effects/SkXfermodeImageFilter.cpp File src/effects/SkXfermodeImageFilter.cpp (right): https://codereview.chromium.org/198003008/diff/20001/src/effects/SkXfermodeImageFilter.cpp#newcode65 src/effects/SkXfermodeImageFilter.cpp:65: if (!applyCropRect(ctx, foreground, foregroundOffset, &foregroundBounds)) { On 2014/03/14 15:11:28, ...
6 years, 9 months ago (2014-03-14 16:18:07 UTC) #7
Stephen White
Committed patchset #5 manually as r13805 (presubmit successful).
6 years, 9 months ago (2014-03-14 16:35:19 UTC) #8
Stephen White
6 years, 9 months ago (2014-03-14 17:44:52 UTC) #9
Message was sent while issue was closed.
Committed patchset #6 manually as r13809 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698