Implement inter-frame caching/partial invalidation in deferred filters.

This change brings back the partial tree invalidation which Blink uses
on the legacy filters path to only re-render nodes (and their children)
which are animated, or whose inputs change. I've applied it to the
deferred filters path by making SkImageFilters persistent across filter
draws (this is a good change in its own right, in that it avoids
invoking the filter builder except when necessary). The hash map in
the filter builder has been replaced by a simple RefPtr<SkImageFilter>
in each FilterEffect, which is cleared when the FilterEffect's
results are invalidated.

This is tied to filter caching within Skia via the
SkImageFilter::SetExternalCache() call: when the results are
invalidated, all cache entries referring to that SkImageFilter are also
removed.

While this won't help on the impl-side painting path (since we won't
have any results to invalidate for a given SkImageFilter), it allows
us to preserve performance of the legacy path across the switch to
deferred filters. In this way, we can decouple the switch to deferred
filters from the switch to impl-side painting.

This is exercised by the svg/dynamic-updates/SVGFE* layout tests --
they now have no text (repaint rect) differences when deferred filters
are enabled, only minor pixel diffs in the image results.

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

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