aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-19 21:09:14 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-19 21:09:14 +0000
commit07784a041925f9a921e390e782195a622c76fbfa (patch)
treedef5977d87179f7859e58b09d9a6fc2a27699fff /src
parentf11cf9ff885c81e29f55283174ca34ce2fc5fd23 (diff)
skip very large rects (for now) until we can pre-clip them to avoid floating
point precision errors. git-svn-id: http://skia.googlecode.com/svn/trunk@6497 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/effects/SkBlurMaskFilter.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 467af23204..94b7fa90a1 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -140,6 +140,10 @@ static bool drawRectsIntoMask(const SkRect rects[], int count, SkMask* mask) {
return true;
}
+static bool rect_coordinates_exceed(const SkRect& r, SkScalar v) {
+ return r.fLeft < -v || r.fTop < -v || r.fRight > v || r.fBottom > v;
+}
+
SkMaskFilter::FilterReturn
SkBlurMaskFilterImpl::filterRectsToNine(const SkRect rects[], int count,
const SkMatrix& matrix,
@@ -148,7 +152,13 @@ SkBlurMaskFilterImpl::filterRectsToNine(const SkRect rects[], int count,
if (count < 1 || count > 2) {
return kUnimplemented_FilterReturn;
}
-
+
+ // TODO: take clipBounds into account to limit our coordinates up front
+ // for now, just skip too-large src rects (to take the old code path).
+ if (rect_coordinates_exceed(rects[0], SkIntToScalar(32767))) {
+ return kUnimplemented_FilterReturn;
+ }
+
SkIPoint margin;
SkMask srcM, dstM;
rects[0].roundOut(&srcM.fBounds);