Implement crop rect for lighting image filters. Changes for the CPU path were fairly...
authorsenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 26 Jul 2013 00:10:07 +0000 (00:10 +0000)
committersenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 26 Jul 2013 00:10:07 +0000 (00:10 +0000)
commit4e16bb2a322f2bd16cb1afd2f78c27e420a4b9db
tree01816c055ea7a369be49f367a89d35ddc1fa724c
parent4d24b747e272355395f456e088a2d0177c00ddb5
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

Review URL: https://codereview.chromium.org/20426002

git-svn-id: http://skia.googlecode.com/svn/trunk@10379 2bbb7eff-a529-9590-31e7-b0007b416f81
gm/lighting.cpp
include/core/SkImageFilter.h
include/effects/SkLightingImageFilter.h
include/effects/SkMagnifierImageFilter.h
include/effects/SkMatrixConvolutionImageFilter.h
src/core/SkImageFilter.cpp
src/effects/SkLightingImageFilter.cpp
src/effects/SkMagnifierImageFilter.cpp
src/effects/SkMatrixConvolutionImageFilter.cpp