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

Side by Side Diff: src/pathops/SkPathWriter.cpp

Issue 23542056: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: verbose + mutex around file number access Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkPathOpsTypes.cpp ('k') | src/pathops/SkQuarticRoot.cpp » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
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 #include "SkPathOpsPoint.h" 7 #include "SkPathOpsPoint.h"
8 #include "SkPathWriter.h" 8 #include "SkPathWriter.h"
9 9
10 // wrap path to keep track of whether the contour is initialized and non-empty 10 // wrap path to keep track of whether the contour is initialized and non-empty
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return fHasMove; 83 return fHasMove;
84 } 84 }
85 85
86 void SkPathWriter::init() { 86 void SkPathWriter::init() {
87 fEmpty = true; 87 fEmpty = true;
88 fHasMove = false; 88 fHasMove = false;
89 fMoved = false; 89 fMoved = false;
90 } 90 }
91 91
92 bool SkPathWriter::isClosed() const { 92 bool SkPathWriter::isClosed() const {
93 return !fEmpty && fFirstPt == fDefer[1]; 93 return !fEmpty && SkDPoint::ApproximatelyEqual(fFirstPt, fDefer[1]);
94 } 94 }
95 95
96 void SkPathWriter::lineTo() { 96 void SkPathWriter::lineTo() {
97 if (fDefer[0] == fDefer[1]) { 97 if (fDefer[0] == fDefer[1]) {
98 return; 98 return;
99 } 99 }
100 moveTo(); 100 moveTo();
101 nudge(); 101 nudge();
102 fEmpty = false; 102 fEmpty = false;
103 #if DEBUG_PATH_CONSTRUCTION 103 #if DEBUG_PATH_CONSTRUCTION
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return; 157 return;
158 } 158 }
159 fFirstPt = fDefer[0]; 159 fFirstPt = fDefer[0];
160 #if DEBUG_PATH_CONSTRUCTION 160 #if DEBUG_PATH_CONSTRUCTION
161 SkDebugf("path.moveTo(%1.9g,%1.9g);\n", fDefer[0].fX, fDefer[0].fY); 161 SkDebugf("path.moveTo(%1.9g,%1.9g);\n", fDefer[0].fX, fDefer[0].fY);
162 #endif 162 #endif
163 fPathPtr->moveTo(fDefer[0].fX, fDefer[0].fY); 163 fPathPtr->moveTo(fDefer[0].fX, fDefer[0].fY);
164 fMoved = false; 164 fMoved = false;
165 fMoves++; 165 fMoves++;
166 } 166 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsTypes.cpp ('k') | src/pathops/SkQuarticRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698