Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: src/effects/SkTileImageFilter.cpp

Issue 1563873002: Optimize SkTileImageFilter destination bitmap size. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkTileImageFilter.cpp
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp
index 8ef617d520f96dfc05c77a3d3b67dc02fdbc1b23..8d158013879a7bf23097c75a2ce241f49816bad6 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -35,6 +35,12 @@ bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
SkRect dstRect;
ctx.ctm().mapRect(&dstRect, fDstRect);
+#ifndef SK_DISABLE_TILE_IMAGE_FILTER_DEST_OPTIMIZATION
+ if (!dstRect.intersect(SkRect::Make(ctx.clipBounds()))) {
+ offset->fX = offset->fY = 0;
+ return true;
+ }
+#endif
const SkIRect dstIRect = dstRect.roundOut();
int w = dstIRect.width();
int h = dstIRect.height();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698