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

Side by Side Diff: src/core/SkStroke.cpp

Issue 834503002: Update stroke path to use rect returned from isRect (to fix trailing moveTo bug) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkStrokerPriv.h" 8 #include "SkStrokerPriv.h"
9 #include "SkGeometry.h" 9 #include "SkGeometry.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 SkScalar radius = SkScalarHalf(fWidth); 1407 SkScalar radius = SkScalarHalf(fWidth);
1408 1408
1409 AutoTmpPath tmp(src, &dst); 1409 AutoTmpPath tmp(src, &dst);
1410 1410
1411 if (radius <= 0) { 1411 if (radius <= 0) {
1412 return; 1412 return;
1413 } 1413 }
1414 1414
1415 // If src is really a rect, call our specialty strokeRect() method 1415 // If src is really a rect, call our specialty strokeRect() method
1416 { 1416 {
1417 SkRect rect;
1417 bool isClosed; 1418 bool isClosed;
1418 SkPath::Direction dir; 1419 SkPath::Direction dir;
1419 if (src.isRect(&isClosed, &dir) && isClosed) { 1420 if (src.isRect(&rect, &isClosed, &dir) && isClosed) {
1420 this->strokeRect(src.getBounds(), dst, dir); 1421 this->strokeRect(rect, dst, dir);
1421 // our answer should preserve the inverseness of the src 1422 // our answer should preserve the inverseness of the src
1422 if (src.isInverseFillType()) { 1423 if (src.isInverseFillType()) {
1423 SkASSERT(!dst->isInverseFillType()); 1424 SkASSERT(!dst->isInverseFillType());
1424 dst->toggleInverseFillType(); 1425 dst->toggleInverseFillType();
1425 } 1426 }
1426 return; 1427 return;
1427 } 1428 }
1428 } 1429 }
1429 1430
1430 SkAutoConicToQuads converter; 1431 SkAutoConicToQuads converter;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 default: 1587 default:
1587 break; 1588 break;
1588 } 1589 }
1589 1590
1590 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { 1591 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) {
1591 r = rect; 1592 r = rect;
1592 r.inset(radius, radius); 1593 r.inset(radius, radius);
1593 dst->addRect(r, reverse_direction(dir)); 1594 dst->addRect(r, reverse_direction(dir));
1594 } 1595 }
1595 } 1596 }
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698