From bccac6cbf128147587bfc2bc1bdeb46c08175bca Mon Sep 17 00:00:00 2001 From: senorblanco Date: Fri, 20 Jun 2014 15:41:59 -0700 Subject: [PATCH] Re-land "Fix external SkImageFilter caching with clips." This reverts commit 9efd66b8451f25465abd1027e09a3bcfa7b9c554. R=reed@google.com TBR=reed@google.com BUG=skia: Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/348903004 --- src/core/SkImageFilter.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); }