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

Unified Diff: src/core/SkScan_Hairline.cpp

Issue 1003813003: some utils for rect and matrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « src/core/SkScan_Antihair.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScan_Hairline.cpp
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 7ca54eac33dc6d8adef509588951fa81534a8bc1..bd597b3d68c155486d0994b73b385b343334d290 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -267,9 +267,7 @@ static void hair_path(const SkPath& path, const SkRasterClip& rclip,
const SkRegion* clip = NULL;
{
- SkIRect ibounds;
- path.getBounds().roundOut(&ibounds);
- ibounds.inset(-1, -1);
+ const SkIRect ibounds = path.getBounds().roundOut().makeOutset(1, 1);
if (rclip.quickReject(ibounds)) {
return;
@@ -379,7 +377,7 @@ void SkScan::HairLine(const SkPoint& p0, const SkPoint& p1,
SkRect r;
r.set(p0.fX, p0.fY, p1.fX, p1.fY);
r.sort();
- r.inset(-SK_ScalarHalf, -SK_ScalarHalf);
+ r.outset(SK_ScalarHalf, SK_ScalarHalf);
SkAAClipBlitterWrapper wrap;
if (!clip.quickContains(r.roundOut())) {
@@ -398,14 +396,11 @@ void SkScan::AntiHairLine(const SkPoint& p0, const SkPoint& p1,
} else {
const SkRegion* clipRgn = NULL;
SkRect r;
- SkIRect ir;
r.set(p0.fX, p0.fY, p1.fX, p1.fY);
r.sort();
- r.roundOut(&ir);
- ir.inset(-1, -1);
SkAAClipBlitterWrapper wrap;
- if (!clip.quickContains(ir)) {
+ if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) {
wrap.init(clip, blitter);
blitter = wrap.getBlitter();
clipRgn = &wrap.getRgn();
« no previous file with comments | « src/core/SkScan_Antihair.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698