From 4cb543d6057b692e1099e9f115155f0bf323a0c8 Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Fri, 14 Mar 2014 15:44:01 +0000 Subject: Implement support for a Context parameter in image filters Some upcoming work (support for expanding crop rects) requires the clip bounds to be available during filter traversal. This change replaces the SkMatrix parameter in the onFilterImage() traversals with a Context parameter. It contains the CTM, as well as the clip bounds. BUG=skia: R=reed@google.com Review URL: https://codereview.chromium.org/189913021 git-svn-id: http://skia.googlecode.com/svn/trunk@13803 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/effects/SkBitmapSource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/effects/SkBitmapSource.cpp') diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp index dd44be7cd6..6834e9e32e 100644 --- a/src/effects/SkBitmapSource.cpp +++ b/src/effects/SkBitmapSource.cpp @@ -42,11 +42,11 @@ void SkBitmapSource::flatten(SkWriteBuffer& buffer) const { buffer.writeRect(fDstRect); } -bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const SkMatrix& matrix, +bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const Context& ctx, SkBitmap* result, SkIPoint* offset) const { SkRect bounds, dstRect; fBitmap.getBounds(&bounds); - matrix.mapRect(&dstRect, fDstRect); + ctx.ctm().mapRect(&dstRect, fDstRect); if (fSrcRect == bounds && dstRect == bounds) { // No regions cropped out or resized; return entire bitmap. *result = fBitmap; -- cgit v1.2.3