Image filters: fix srcOffset handling in asFragmentProcessor() path.
authorsenorblanco <senorblanco@chromium.org>
Tue, 26 Jan 2016 16:41:02 +0000 (08:41 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 26 Jan 2016 16:41:03 +0000 (08:41 -0800)
commiteae84c2e0e2126374cd488a1c8a3e18169145635
tree768f4953e9c7f31a10bfcbb61e6d98309800c4d0
parent978d08a4a90d69961bd53811ed3ab222b88e2d30
Image filters: fix srcOffset handling in asFragmentProcessor() path.

Filters such as SkMatrixConvolutionImageFilter which use the
asFragmentProcessor() path were not correctly handling srcOffset.
It is correctly applied to the bounds, but the srcRect and dstRect
were computed from the pre-offset bounds.

The fix is to move them to just above where they're used in drawing.

Note: this change adds a new test case to the imagefiltersgraph GM,
so it will have to be rebaselined post-landing.

BUG=skia:4855
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1637443003

Review URL: https://codereview.chromium.org/1637443003
gm/imagefiltersgraph.cpp
src/core/SkImageFilter.cpp