diff options
author | senorblanco <senorblanco@chromium.org> | 2014-06-18 15:11:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-18 15:11:25 -0700 |
commit | ffa9b500d7e83e7dddf6a8902f47c4355b608c30 (patch) | |
tree | de5ca9c7362e1140ac7bc68bc175eaacbba971b8 | |
parent | c5d5cf9489977aa6fba077d1dc242029fbb4859e (diff) |
Fix external SkImageFilter caching with clips.
When the external cache is active, do not intersect the saveLayer
bounds with the clip bounds. This is so that the cache is always the
full size of the primitive's bounds, regardless of the clip active on
first draw. (Drawing of the filtered or cached result is always drawn
against the active clip, though, since it is restored before
internalDrawDevice() is called.)
This is a slightly hacky solution, but this code can all go away
(including the external cache) once all platforms have switched to
impl-side painting.
See Chromium bug http://crbug.com/379147.
BUG=skia:
R=reed@google.com
Author: senorblanco@chromium.org
Review URL: https://codereview.chromium.org/340203002
-rw-r--r-- | src/core/SkImageFilter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 6356c1a5dd..4c4b56beac 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -122,6 +122,16 @@ bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const { SkASSERT(&src); SkASSERT(dst); + if (SkImageFilter::GetExternalCache()) { + /* + * When the external cache is active, do not intersect the saveLayer + * bounds with the clip bounds. This is so that the cached result + * is always the full size of the primitive's bounds, + * regardless of the clip active on first draw. + */ + *dst = SkIRect::MakeLargest(); + return true; + } return this->onFilterBounds(src, ctm, dst); } |