From 8b7b9c2e804b54a8301363091f418cfeda719fe3 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Tue, 9 Dec 2014 05:28:24 -0800 Subject: [PATCH] Fix MatrixImageFilter computeFastBounds This CL makes the bounding box returned from SkMatrixImageFilter::computeFastBounds actually contain the final result pixels. This, in turn, fixes the first two rows of the filterfastbounds GM and the SVG web page cited in the bug. BUG=418417 Review URL: https://codereview.chromium.org/785893004 --- src/effects/SkMatrixImageFilter.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/effects/SkMatrixImageFilter.cpp b/src/effects/SkMatrixImageFilter.cpp index 919dff3994..f2c403f443 100644 --- a/src/effects/SkMatrixImageFilter.cpp +++ b/src/effects/SkMatrixImageFilter.cpp @@ -98,11 +98,8 @@ void SkMatrixImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) cons if (getInput(0)) { getInput(0)->computeFastBounds(src, &bounds); } - SkMatrix matrix; - matrix.setTranslate(-bounds.x(), -bounds.y()); - matrix.postConcat(fTransform); - matrix.postTranslate(bounds.x(), bounds.y()); - matrix.mapRect(dst, bounds); + fTransform.mapRect(dst, bounds); + dst->join(bounds); // Work around for skia:3194 } bool SkMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,