DescriptionImplement 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, #
Messages
Total messages: 6 (0 generated)
|