skia2/gm
senorblanco@chromium.org 118252962f Implement support for expanding crop rects in image filters
NOTE: this patch set is based on https://codereview.chromium.org/189913021/,
and needs that patch to land first.

Until now, crop rects in Skia have only been able to reduce
the size of the destination bounds, but not expand them.
SVG semantics require the latter as well. The heart of
the change is in applyCropRect(), which now assigns each
edge, instead of doing an intersection with the crop rect.

In order to support this (and still work well with tiled
drawing) we need to clip the resulting crop rect to the
clipping region of the filters. This uses the Context struct
previously landed from https://codereview.chromium.org/189913021/.

Many of the pixel loops are not yet ready to handle a
destination rect larger than the source rect. So we provide
a convenience version of applyCropRect() which creates an
offscreen and pads it out with transparent black. Once the
pixel loops and shaders have been fixed to support larger
destination bounds, they should be switched back to the
non-drawing version of applyCropRect().

BUG=skia:
R=bsalomon@google.com, reed@google.com

Committed: https://code.google.com/p/skia/source/detail?r=13805

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13809 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-14 17:44:41 +00:00
..
rebaseline_server make rebaseline_server client check schema version number 2014-03-13 17:44:01 +00:00
tests gm self-test: stop checking stdout and stderr 2014-02-05 18:44:31 +00:00
viewer Create AJAX live-viewer of expected-vs-actual GM results 2013-08-02 19:08:52 +00:00
__init__.py rebaseline.py: if --tests is not specified, get test list from actual-results.json 2013-06-05 15:43:37 +00:00
aaclip.cpp add peekPixels to SkCanvas and SkSurface 2014-02-13 17:14:46 +00:00
aarectmodes.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
alphagradients.cpp Sanitizing source files in Housekeeper-Nightly 2013-05-25 07:01:12 +00:00
androidfallback.cpp skip android_paint GM in pipe mode 2013-10-28 20:40:41 +00:00
arcofzorro.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
arithmode.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
beziereffects.cpp support direct writing to top layer, and hide getTopLayer() 2014-03-12 18:28:35 +00:00
bicubicfilter.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
bigblurs.cpp Sanitizing source files in Housekeeper-Nightly 2013-11-08 07:01:56 +00:00
bigmatrix.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
bigtext.cpp Sanitizing source files in Housekeeper-Nightly 2013-06-06 07:01:37 +00:00
bitmapcopy.cpp add new copyTo version to SkBitmap, which takes SkColorType 2014-02-23 03:59:35 +00:00
bitmapfilters.cpp add new copyTo version to SkBitmap, which takes SkColorType 2014-02-23 03:59:35 +00:00
bitmapmatrix.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
bitmappremul.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
bitmaprect.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
bitmaprecttest.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
bitmapscroll.cpp add new copyTo version to SkBitmap, which takes SkColorType 2014-02-23 03:59:35 +00:00
bitmapshader.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
bitmapsource.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
bleed.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
blurquickreject.cpp Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"" 2013-10-31 17:28:30 +00:00
blurrect.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
blurroundrect.cpp try to deprecate fFlagsMask from SkLayerDrawLooper 2014-02-27 14:27:44 +00:00
blurs.cpp remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats 2013-12-17 16:44:46 +00:00
canvasstate.cpp flag to make kClipToLayer_SaveFlag the default behavior 2014-03-10 19:47:58 +00:00
circles.cpp Sanitizing source files in Housekeeper-Nightly 2013-09-10 07:01:44 +00:00
circularclips.cpp Use Path Ops to generate PDF clips 2013-08-08 02:52:05 +00:00
clippedbitmapshaders.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
cmykjpeg.cpp Sanitizing source files in Housekeeper-Nightly 2013-05-30 07:01:29 +00:00
coloremoji.cpp improve bitmap font support (FreeType only) 2013-12-10 18:09:36 +00:00
colorfilterimagefilter.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
colorfilters.cpp Revert of Revert "Serialization of SkPictureImageFilter" (https://codereview.chromium.org/153583007/) 2014-02-07 12:20:04 +00:00
colormatrix.cpp Factory methods for heap-allocated SkColorFilter objects. 2014-02-21 18:46:30 +00:00
colortype.cpp if we can't load Times, use default font 2013-06-03 17:45:29 +00:00
complexclip2.cpp Store SkRRects in SkClipStack 2014-02-16 13:25:24 +00:00
complexclip.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
composeshader.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
conicpaths.cpp Sanitizing source files in Housekeeper-Nightly 2013-06-21 07:00:53 +00:00
convexpaths.cpp Make leak counters thread-safe and turn them on by default for Debug 2014-01-17 17:55:02 +00:00
convexpolyclip.cpp Make GMs aware of what tool they're being run in. 2014-02-07 21:13:11 +00:00
convexpolyeffect.cpp support direct writing to top layer, and hide getTopLayer() 2014-03-12 18:28:35 +00:00
copyTo4444.cpp add new copyTo version to SkBitmap, which takes SkColorType 2014-02-23 03:59:35 +00:00
cubicpaths.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
dashcubics.cpp Factory methods for heap-allocated SkPathEffect and SkXfermode objects. 2014-02-20 20:40:19 +00:00
dashing.cpp Factory methods for heap-allocated SkPathEffect and SkXfermode objects. 2014-02-20 20:40:19 +00:00
degeneratesegments.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
deviceproperties.cpp add peekPixels to SkCanvas and SkSurface 2014-02-13 17:14:46 +00:00
displacement.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
display_json_results.py gm_json.py: add ability to load JSON file from a string, not just a local file 2013-06-04 17:50:36 +00:00
distantclip.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-09-18 02:01:09 +00:00
downsamplebitmap.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
drawbitmaprect.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
drawlooper.cpp try to deprecate fFlagsMask from SkLayerDrawLooper 2014-02-27 14:27:44 +00:00
dropshadowimagefilter.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
drrect.cpp Sanitizing source files in Housekeeper-Nightly 2014-02-21 03:02:02 +00:00
emptypath.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
extractbitmap.cpp remove SkCanvas::createCompatibleDevice, and add SkCanvas::newSurface 2014-02-05 15:32:21 +00:00
factory.cpp Add Options to SkDecodingImageGenerator, simplify API. 2014-01-02 13:15:13 +00:00
fatpathfill.cpp promote SkImage::AlphaType to SkAlphaType 2013-09-20 19:33:52 +00:00
filltypes.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
filltypespersp.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
filterbitmap.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
fontcache.cpp Sanitizing source files in Housekeeper-Nightly 2013-10-10 07:01:40 +00:00
fontmgr.cpp Fix leak detected in FontMgrMatchGM::onDraw by Valgrind. 2013-11-12 15:25:29 +00:00
fontscaler.cpp Reduce number of glyphs drawn by fontscaler GM to avoid N4 MSAA4 crash 2013-09-09 16:19:40 +00:00
gammatext.cpp add peekPixels to SkCanvas and SkSurface 2014-02-13 17:14:46 +00:00
getpostextpath.cpp fix more 64bit warnings 2014-01-27 13:42:58 +00:00
giantbitmap.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
gm_error.h Add SkPDFDeviceFlatenner which extends SkPDFDevice to add support to flatten the path and the text when we have perspective. 2013-10-14 13:42:12 +00:00
gm_expectations.cpp replace gm_fprintf() calls with SkDebugf() 2014-02-27 18:45:26 +00:00
gm_expectations.h replace gm_fprintf() calls with SkDebugf() 2014-02-27 18:45:26 +00:00
gm_json.py rebaseline_server: use new intermediate JSON format as described in https://goto.google.com/ChangingRbsJson 2014-02-26 19:05:20 +00:00
gm.cpp DM: also run benches once. 2014-02-26 23:01:57 +00:00
gm.h DM: also run benches once. 2014-02-26 23:01:57 +00:00
gmmain.cpp --dryRun flag for gm 2014-03-13 16:16:36 +00:00
gradient_matrix.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
gradientDirtyLaundry.cpp Sanitizing source files in Housekeeper-Nightly 2013-07-10 07:00:58 +00:00
gradients_no_texture.cpp Two and three color GPU gradients without textures. 2013-09-09 15:36:26 +00:00
gradients.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
gradtext.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
hairlines.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
hairmodes.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
hittestpath.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
image.cpp use some helper Make functions to initialize SkImageInfo 2014-01-15 02:38:22 +00:00
image.h check-point for image/surface work 2012-07-29 20:38:16 +00:00
imagealphathreshold.cpp Sanitizing source files in Housekeeper-Nightly 2014-01-08 07:01:49 +00:00
imageblur.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
imageblurtiled.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
imagefiltersbase.cpp Implement support for a Context parameter in image filters 2014-03-14 15:44:01 +00:00
imagefiltersclipped.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
imagefilterscropexpand.cpp Implement support for expanding crop rects in image filters 2014-03-14 17:44:41 +00:00
imagefilterscropped.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
imagefiltersgraph.cpp Implement support for expanding crop rects in image filters 2014-03-14 17:44:41 +00:00
imagefiltersscaled.cpp Added Z scale when X and Y scale to spot lights and point lights 2014-03-13 19:45:41 +00:00
imagemagnifier.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
imageresizetiled.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
internal_links.cpp Fix pipe/annotation. 2013-10-29 19:23:26 +00:00
inversepaths.cpp Inverse fill support in PDF 2013-07-31 22:54:31 +00:00
lcdtext.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
lerpmode.cpp Sanitizing source files in Housekeeper-Nightly 2013-05-22 07:01:13 +00:00
lighting.cpp add peekPixels to SkCanvas and SkSurface 2014-02-13 17:14:46 +00:00
linepaths.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
lumafilter.cpp Align SkLumaColorFilter with the spec. 2013-10-10 20:13:51 +00:00
matrixconvolution.cpp Clean up SkImageFilter. 2014-03-12 16:36:08 +00:00
megalooper.cpp try to deprecate fFlagsMask from SkLayerDrawLooper 2014-02-27 14:27:44 +00:00
mixedxfermodes.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
modecolorfilters.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
morphology.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
nested.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
ninepatchstretch.cpp add peekPixels to SkCanvas and SkSurface 2014-02-13 17:14:46 +00:00
nonclosedpaths.cpp fix more 64bit warnings 2014-01-27 13:42:58 +00:00
offsetimagefilter.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
optimizations.cpp The motivation for this CL is to de-clutter SkPicture's beginRecording method. 2014-03-04 19:08:57 +00:00
ovals.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
patheffects.cpp Factory methods for heap-allocated SkPathEffect and SkXfermode objects. 2014-02-20 20:40:19 +00:00
pathfill.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
pathinterior.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
pathopsinverse.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
pathopsskpclip.cpp path ops : make it real 2013-04-25 13:34:40 +00:00
pathreverse.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
peekpixels.cpp Sanitizing source files in Housekeeper-Nightly 2014-02-14 03:02:05 +00:00
perlinnoise.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
pictureimagefilter.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
points.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
poly2poly.cpp Sanitizing source files in Housekeeper-Nightly 2013-06-22 07:00:58 +00:00
polygons.cpp fix more 64bit warnings 2014-01-27 13:42:58 +00:00
quadpaths.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
rects.cpp add some GM tests for rects 2013-11-01 11:54:29 +00:00
resizeimagefilter.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
roundrects.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
rrect.cpp GM : Unused parameters cleanup 2013-02-27 15:41:12 +00:00
rrects.cpp Add effect-based clip for nine-patch SkRRects. 2014-03-13 18:01:05 +00:00
samplerstress.cpp Factory methods for heap-allocated SkMaskFilter objects. 2014-02-21 10:13:32 +00:00
scalebitmap.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
selftest.cpp gm: record IntentionallySkipped tests 2013-04-10 12:17:34 +00:00
shaderbounds.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
shadertext2.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
shadertext3.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
shadertext.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
shadows.cpp Push sigma-based blur interface into our GMs/benches/tests/samplecode 2013-09-06 14:16:12 +00:00
shallowgradient.cpp Fix minor memory leaks 2013-03-27 21:31:21 +00:00
simpleaaclip.cpp Offer single-param version of deepCopyTo -- much easier to migrate to colortypes 2014-02-20 19:08:07 +00:00
skbug1719.cpp detach blur result texture when it is the same texture used to render path mask 2013-10-16 13:53:54 +00:00
spritebitmap.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
srcmode.cpp use some helper Make functions to initialize SkImageInfo 2014-01-15 02:38:22 +00:00
stringart.cpp One more try at fixing warnings 2013-09-19 17:21:39 +00:00
strokefill.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:19:56 +00:00
strokerect.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
strokerects.cpp Just a typo. Rename StrokeRect to StrokeRects in strokerects.cpp, making it different from the class name in strokerect.cpp for debugging. 2013-12-09 09:14:59 +00:00
strokes.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
stroketext.cpp check for null-device pixels in onWritePixels, so we don't crash 2014-03-14 14:02:58 +00:00
system_preferences_default.cpp Set LCD font smoothing to "medium" for gm on Mac, regardless of system settings 2012-02-14 14:53:59 +00:00
system_preferences_mac.mm gm: Include system_preferences.h in mac file. 2012-09-26 15:41:42 +00:00
system_preferences.h Set LCD font smoothing to "medium" for gm on Mac, regardless of system settings 2012-02-14 14:53:59 +00:00
tablecolorfilter.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
techtalk1.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
testimagefilters.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
texdata.cpp support direct writing to top layer, and hide getTopLayer() 2014-03-12 18:28:35 +00:00
texteffects.cpp Builder class for SkLayerRasterizer. 2014-02-26 13:27:37 +00:00
thinrects.cpp Sanitizing source files in Housekeeper-Nightly 2013-05-15 07:01:09 +00:00
thinstrokedrects.cpp Add a new GM for very thin stroke widths 2013-06-26 17:06:45 +00:00
tileimagefilter.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
tilemodes_scaled.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
tilemodes.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
tinybitmap.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
twopointradial.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
typeface.cpp fix more 64bit warnings 2014-01-27 13:42:58 +00:00
valgrind.supp Fix valgrind suppressions (again) 2014-02-14 14:08:05 +00:00
vertices.cpp Remove GPU-only flag for vertices GM 2014-01-08 21:19:12 +00:00
verttext2.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:19:56 +00:00
verttext.cpp Revert unwanted change to verttext.cpp. 2013-10-24 22:38:48 +00:00
verylargebitmap.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
xfermodeimagefilter.cpp Factory methods for heap-allocated SkImageFilter objects. 2014-03-10 10:51:58 +00:00
xfermodes2.cpp add legacy/helper allocN32Pixels, and convert gm to use it 2014-01-25 16:46:20 +00:00
xfermodes3.cpp add peekPixels to SkCanvas and SkSurface 2014-02-13 17:14:46 +00:00
xfermodes.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00