skia2/include
senorblanco db64af3b17 Fix filter primitive bounds computations.
Make each filter responsible for expanding its destination
bounds. Previously, we were using a union of all
intermediate bounds sizes via join() calls in many image
filters' computeFastBounds(), due to the fact that those
filters could only produce bitmaps the same size as their
inputs. Now, we compute optimal bounds for each filter as
follows:

1) Pass the (unmodified) clip bounds to the root node
of the DAG in the first recursive call to onFilterImage()
as the Context's fClipBounds.

2) Reverse-map the clip: when recursing up the DAG in
filterInput[GPU](), apply filter-specific expansion to the
clip by calling calling onFilterNodeBounds(... kReverse).
This allows upstream nodes to have a clip that respects the
current node's requirements. This is done via helper
function mapContext().

3) Forward-map the source bitmap: just prior to applying
the crop rect in applyCropRect(), we determine the filter's
preferred bounds by mapping the source bitmap bounds
forwards via onFilterNodeBounds(..., kForward).

NOTE: GMs affected by this change:
fast_slow_blurimagefilter: fast and slow paths now produce the same result
spritebitmap: drawSprite() and drawBitmap() paths now produce the same result
filterfastbounds: fast bounds are optimized; all drop-shadow results now appear
apply-filter: snug and not-snug cases give same results
dropshadowimagefilter: drawSprite() results now show shadows
draw-with-filter: no artifacts on erode edges; blur edges no longer clipped
displacement, imagefiltersbase, imagefiltersclipped, imagefilterscropexpand, imagefiltersscaled, matriximagefilter,
resizeimagefilter, localmatriximagefilter, testimagefilters: fixed incorrect clipping
imagefilterstransformed, morphology: no artifacts on erode edges

BUG=skia:1062,skia:3194,skia:3939,skia:4337,skia:4526

Review URL: https://codereview.chromium.org/1308703007
2015-12-09 10:11:43 -08:00
..
android Move SkBitmapRegionDecoder to include/android and src/android 2015-11-13 06:11:09 -08:00
animator Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
c Documentation: C API comments 2015-09-01 10:45:09 -07:00
codec Make SkCodec support peek() and read() 2015-12-08 18:54:13 -08:00
config remove SkInstCnt 2015-06-26 11:45:03 -07:00
core Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
device/xps CMake, include/: changes to make fiddle 2.0 better 2015-12-01 09:02:49 -08:00
effects Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
gpu Move texture drawing utility method to SkGpuDevice 2015-12-08 18:53:44 -08:00
images remove SkInstCnt 2015-06-26 11:45:03 -07:00
pathops Revert of Revert of remove SK_SUPPORT_LEGACY_PATHOP_ENUMS (patchset #1 id:1 of https://codereview.chromium.org/1203983003/) 2015-06-26 10:23:07 -07:00
pipe Fixing leaky handling of SkImage in SkDeferredCanvas. 2015-06-02 11:47:45 -07:00
ports Update documentation for SkFontMgr methods. 2015-12-03 12:12:13 -08:00
private Revert of skstd -> std for unique_ptr (patchset #17 id:320001 of https://codereview.chromium.org/1436033003/ ) 2015-12-02 12:32:02 -08:00
svg Remove SK_OFFSETOF from SkTypes, clean up offsetof usage. 2015-08-25 12:05:55 -07:00
utils clang/win: Let SK_TRACEHR not produce -Wunused-value warnings in release builds. 2015-12-07 10:41:36 -08:00
views Replace SkFunction with std::function 2015-11-12 10:41:05 -08:00
xml Move SkTemplates.h to private. 2015-08-19 11:56:48 -07:00