skia2/include/effects
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
..
Sk1DPathEffect.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
Sk2DPathEffect.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
SkAlphaThresholdFilter.h SkAlphaThresholdFilter.h allow flattening 2015-12-07 10:29:54 -08:00
SkArcToPathEffect.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
SkArithmeticMode.h Arithmetic mode now has the option of not validating the output color, which will allow multiple arithmetic operations to be done sequentially, without intermediate clamping. This is required for mimicking blink's current behavior. 2014-04-02 19:32:15 +00:00
SkBlurDrawLooper.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
SkBlurImageFilter.h Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
SkBlurMaskFilter.h remove SK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE 2014-05-31 21:47:03 +00:00
SkColorCubeFilter.h Bye bye processor data manager. 2015-10-06 08:40:51 -07:00
SkColorFilterImageFilter.h Matrix convolution bounds fix; affectsTransparentBlack fixes. 2015-12-07 07:48:34 -08:00
SkColorMatrix.h Revert "Revert of impl colormatrix w/ floats (patchset #7 id:120001 of https://codereview.chromium.org/967943002/)" 2015-03-24 04:13:45 -07:00
SkColorMatrixFilter.h Bye bye processor data manager. 2015-10-06 08:40:51 -07:00
SkComposeImageFilter.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
SkCornerPathEffect.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
SkDashPathEffect.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
SkDiscretePathEffect.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
SkDisplacementMapEffect.h Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
SkDrawExtraPathEffect.h Export effects classes with SK_API. 2012-10-12 14:41:39 +00:00
SkDropShadowImageFilter.h Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
SkEmbossMaskFilter.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
SkGradientShader.h remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical 2015-05-04 08:32:51 -07:00
SkImageSource.h SkImageSource 2015-09-14 13:31:18 -07:00
SkLayerDrawLooper.h Eliminate some clutter in SkFlattenable 2015-09-24 15:04:45 -07:00
SkLayerRasterizer.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
SkLerpXfermode.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
SkLightingImageFilter.h Matrix convolution bounds fix; affectsTransparentBlack fixes. 2015-12-07 07:48:34 -08:00
SkLumaColorFilter.h Bye bye processor data manager. 2015-10-06 08:40:51 -07:00
SkMagnifierImageFilter.h Bye bye processor data manager. 2015-10-06 08:40:51 -07:00
SkMatrixConvolutionImageFilter.h Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
SkMergeImageFilter.h Revert "Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )" 2015-10-06 14:05:32 -07:00
SkModeColorFilter.h change more effects to only expose factories 2015-10-12 11:10:10 -07:00
SkMorphologyImageFilter.h Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
SkOffsetImageFilter.h Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
SkPaintFlagsDrawFilter.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
SkPerlinNoiseShader.h Bye bye processor data manager. 2015-10-06 08:40:51 -07:00
SkPictureImageFilter.h Revert "Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )" 2015-10-06 14:05:32 -07:00
SkPixelXorXfermode.h Revert "Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )" 2015-10-06 14:05:32 -07:00
SkRectShaderImageFilter.h Matrix convolution bounds fix; affectsTransparentBlack fixes. 2015-12-07 07:48:34 -08:00
SkTableColorFilter.h Use GLSLCaps for creating processor keys and GLSL-specific programs 2015-04-28 08:48:20 -07:00
SkTableMaskFilter.h Revert "Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )" 2015-10-06 14:05:32 -07:00
SkTestImageFilters.h Revert "Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )" 2015-10-06 14:05:32 -07:00
SkTileImageFilter.h Fix filter primitive bounds computations. 2015-12-09 10:11:43 -08:00
SkXfermodeImageFilter.h Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00