aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkTileImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-06-16 09:44:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-16 09:44:56 -0700
commitc3176aa5e578cc64a2534a9ddac2fec5ab6d8d77 (patch)
tree1dd1e9157c2147de3ef4817c2070312b190e5626 /src/effects/SkTileImageFilter.cpp
parent446ee67fda73b11281b8e28a68edec811347c0c5 (diff)
Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG: color filter (table) 0: xfermode filter (arith) 0: tile filter [0,80,34,114] -> [0,80,800,480] 0: color filter (table) 0: bitmap src 34x34 -> [0,80,34,114] 1: color filter (table) 0: picture filter [0, 80, 800, 480] computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn. This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit. BUG=493783 Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e Committed: https://skia.googlesource.com/skia/+/0be685755f942baea26c66a87226b569fc17e960 Review URL: https://codereview.chromium.org/1152553006
Diffstat (limited to 'src/effects/SkTileImageFilter.cpp')
-rw-r--r--src/effects/SkTileImageFilter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp
index b2244b9629..2b7ed940d2 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -93,6 +93,12 @@ bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
return true;
}
+void SkTileImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
+ // This is a workaround for skia:3194.
+ *dst = src;
+ dst->join(fDstRect);
+}
+
SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkRect src, dst;