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

Unified Diff: src/core/SkDraw.cpp

Issue 552743004: Outset the stroke width when computing the bounds for drawing a stroked rect, or 1 if it's a hairli… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkScalarHalf Created 6 years, 3 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 | « gyp/gmslides.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 3532efd7e5e5e7d9fd27fd57754fea2610760465..4b878ba2b1252e2711205cc1252e47aa84e01395 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -817,7 +817,12 @@ void SkDraw::drawRect(const SkRect& rect, const SkPaint& paint) const {
devRect.roundOut(&ir);
if (paint.getStyle() != SkPaint::kFill_Style) {
// extra space for hairlines
- ir.inset(-1, -1);
+ if (paint.getStrokeWidth() == 0) {
+ ir.outset(1, 1);
+ } else {
+ SkScalar radius = SkScalarHalf(paint.getStrokeWidth());
+ ir.outset(radius, radius);
+ }
}
if (fRC->quickReject(ir)) {
return;
« no previous file with comments | « gyp/gmslides.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698