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

Issue 20426002: Implement crop rect for lighting image filters. (Closed)

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

Description

Implement crop rect for lighting image filters. Changes for the CPU path were fairly straightforward: use the bounds rectangle when traversing the pixels, not the source rectangle. For the GPU path, this required modifying the signature of SkImageFilter::asNewEffect() to receive the bounds offset, so that the lighting filters could offset the light position by the offset. It also required modifying the base-class implementation of SkImageFilter::filterImageGPU() (which implements single-pass filters) to intersect against the bounds rect, to pass its offset to asNewEffect(), and to modify the caller's offset (so it's drawn in the correct place). Note: this will require rebaselining the lighting GM. Six new test cases were added, to accommodate a cropped version of each lighting filter. R=bsalomon@google.com, reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=10379

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Add comment #

Total comments: 3

Patch Set 4 : Fix conversions; fix bounds checking in lighting software path #

Patch Set 5 : Bugfix: set the bitmap's width and height to the bounds's width and height, #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -119 lines) Patch
M gm/lighting.cpp View 2 chunks +23 lines, -13 lines 0 comments Download
M include/core/SkImageFilter.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M include/effects/SkLightingImageFilter.h View 1 chunk +10 lines, -7 lines 0 comments Download
M include/effects/SkMagnifierImageFilter.h View 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkMatrixConvolutionImageFilter.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkImageFilter.cpp View 1 2 3 4 3 chunks +18 lines, -10 lines 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 1 2 3 34 chunks +148 lines, -82 lines 0 comments Download
M src/effects/SkMagnifierImageFilter.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M src/effects/SkMatrixConvolutionImageFilter.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Stephen White
reed@, bsalomon@: PTAL. Thanks!
7 years, 5 months ago (2013-07-25 19:16:55 UTC) #1
reed1
https://codereview.chromium.org/20426002/diff/4001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/20426002/diff/4001/include/core/SkImageFilter.h#newcode97 include/core/SkImageFilter.h:97: virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkIPoint& offset) const; ...
7 years, 5 months ago (2013-07-25 19:51:56 UTC) #2
Stephen White
Also fixed a bounds checking issue. https://codereview.chromium.org/20426002/diff/4001/src/core/SkImageFilter.cpp File src/core/SkImageFilter.cpp (right): https://codereview.chromium.org/20426002/diff/4001/src/core/SkImageFilter.cpp#newcode123 src/core/SkImageFilter.cpp:123: SkRect dstRect = ...
7 years, 5 months ago (2013-07-25 20:39:54 UTC) #3
bsalomon
On 2013/07/25 20:39:54, Stephen White wrote: > Also fixed a bounds checking issue. > > ...
7 years, 5 months ago (2013-07-25 21:29:36 UTC) #4
reed1
lgtm
7 years, 5 months ago (2013-07-25 21:34:52 UTC) #5
Stephen White
7 years, 5 months ago (2013-07-26 00:10:14 UTC) #6
Message was sent while issue was closed.
Committed patchset #5 manually as r10379 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698