Enable use of the Skia SkImageFilter DAG for rendering SVG filters on SVG content. This will allow us to move raster rendering of SVG filters off the main thread. It'll also make it possible to accelerate filter rendering in a Ganesh-friendly way (ie., along with accelerated rendering of the rest of the page.)

The guts of the change are in RenderSVGResourceFilter, currently switched off at runtime via s_deferredFilterRendering. The SVG primitive is drawn as normal, but with an SkImageFilter DAG attached in RenderSVGResourceFilter::applyResource() via GraphicsContext::beginLayer(), with the endLayer() in RenderSVGResourceFilter::postApplyResource().

GraphicsContext::beginLayer() now has an optional ImageFilter parameter, to set an image filter when starting an offscreen. Note that ImageFilter is simply a typedef to SkImageFilter, but we continue to make no skia-specific calls from RenderSVGResourceFilter. (I'll rename SkiaImageFilterBuilder to ImageFilterBuilder in a subsequent patch.)

The SVGFEImage changes are to support referencing an SVG node as an FEImage. We do this by capturing an SkPicture (via GraphicsContext::beginRecording()/endRecording()) and wrapping it in an SkPictureImageFilter. SVGFEImage continues to be a layering violoation, since it makes both Skia calls and calls into rendering. For this reason, it's better off to remain in core/ where it is now, until the dependencies can be untangled.

Note that the new GraphicsContext parameter passed to SkiaImageFilterBuilder is only used for the beginRecording()/endRecording() calls in FEImage, not for rendering.

The rest are some fixes for FETile and filter primitive subregion that running the SVG tests with s_deferredFilterRendering=true exposed.

With s_deferredFilterRendering=true set, there are about 15 tests failing in svg/filters (3 of them true failures, the remainder minor pixel diffs). There are more failing in svg/W3C-SVG-1.1, but this change will allow me to move forward and fix those failures without the patch rotting too much.

BUG=237641

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164994 bbb929c8-8fbe-4397-9dbb-9b2b20218538