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

Unified Diff: src/core/SkPath.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 6 years 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 | « include/core/SkPath.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index f8aa8521dadb1e13cc6e785d7fa7b88acf0bb4bc..27b7283263a059bf4d018bd8f2abb6b0358d6510 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -534,18 +534,18 @@ SkPath::PathAsRect SkPath::asRect(Direction* direction) const {
return (PathAsRect) (isRect(&isClosed, direction) + isClosed);
}
-bool SkPath::isRect(SkRect* rect) const {
+bool SkPath::isRect(SkRect* rect, bool* isClosed, Direction* direction) const {
SkDEBUGCODE(this->validate();)
int currVerb = 0;
const SkPoint* pts = fPathRef->points();
const SkPoint* first = pts;
- bool isClosed;
- if (!this->isRectContour(false, &currVerb, &pts, &isClosed, NULL)) {
+ if (!this->isRectContour(false, &currVerb, &pts, isClosed, direction)) {
return false;
}
if (rect) {
- if (isClosed) {
- rect->set(first, SkToS32(pts - first));
+ int32_t num = SkToS32(pts - first);
+ if (num) {
+ rect->set(first, num);
} else {
// 'pts' isn't updated for open rects
*rect = this->getBounds();
@@ -554,13 +554,6 @@ bool SkPath::isRect(SkRect* rect) const {
return true;
}
-bool SkPath::isRect(bool* isClosed, Direction* direction) const {
- SkDEBUGCODE(this->validate();)
- int currVerb = 0;
- const SkPoint* pts = fPathRef->points();
- return isRectContour(false, &currVerb, &pts, isClosed, direction);
-}
-
bool SkPath::isNestedRects(SkRect rects[2], Direction dirs[2]) const {
SkDEBUGCODE(this->validate();)
int currVerb = 0;
« no previous file with comments | « include/core/SkPath.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698