From 74ec8d47b551ff57dbfd10596abdaae9d33c8293 Mon Sep 17 00:00:00 2001 From: senorblanco Date: Thu, 15 Oct 2015 05:04:27 -0700 Subject: [PATCH] Add a comment to explain clip intersection in crop rects. BUG=skia: R=robertphillips Review URL: https://codereview.chromium.org/1401973003 --- src/core/SkImageFilter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 3f6ea9a12b..bb7927669c 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -87,6 +87,11 @@ bool SkImageFilter::CropRect::applyTo(const SkIRect& imageBounds, const Context& cropped->fBottom = cropped->fTop + devICropR.height(); } } + // Intersect against the clip bounds, in case the crop rect has + // grown the bounds beyond the original clip. This can happen for + // example in tiling, where the clip is much smaller than the filtered + // primitive. If we didn't do this, we would be processing the filter + // at the full crop rect size in every tile. return cropped->intersect(ctx.clipBounds()); }