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

Unified Diff: src/core/SkAAClip.cpp

Issue 2482193004: Tighten SkAAClip Bounds by Path Bounds (Closed)
Patch Set: Send in the true SkRegion Created 4 years, 1 month 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 | src/core/SkScan_AAAPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkAAClip.cpp
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp
index 1a60754d91370a1888a6b99842bf77de24b88580..16f02ac04d72eb50e4c0ec6fece292d977508f79 100644
--- a/src/core/SkAAClip.cpp
+++ b/src/core/SkAAClip.cpp
@@ -1403,12 +1403,15 @@ bool SkAAClip::setPath(const SkPath& path, const SkRegion* clip, bool doAA) {
clip = &tmpClip;
}
+ SkRegion realClip(*clip);
reed1 2016/11/09 21:27:42 nit: real doesn't convey much. How about tightClip
+
if (path.isInverseFillType()) {
ibounds = clip->getBounds();
} else {
if (ibounds.isEmpty() || !ibounds.intersect(clip->getBounds())) {
return this->setEmpty();
}
+ realClip.op(ibounds, SkRegion::kIntersect_Op);
}
Builder builder(ibounds);
@@ -1416,12 +1419,12 @@ bool SkAAClip::setPath(const SkPath& path, const SkRegion* clip, bool doAA) {
if (doAA) {
if (gSkUseAnalyticAA.load()) {
- SkScan::AAAFillPath(path, *clip, &blitter, true);
+ SkScan::AAAFillPath(path, realClip, &blitter, true);
} else {
- SkScan::AntiFillPath(path, *clip, &blitter, true);
+ SkScan::AntiFillPath(path, realClip, &blitter, true);
}
} else {
- SkScan::FillPath(path, *clip, &blitter);
+ SkScan::FillPath(path, realClip, &blitter);
}
blitter.finish();
« no previous file with comments | « no previous file | src/core/SkScan_AAAPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698