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

Side by Side Diff: src/pathops/SkOpContour.h

Issue 257773007: pathops debug globals use atomic increment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | src/pathops/SkOpSegment.h » ('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 2013 Google Inc. 2 * Copyright 2013 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 #ifndef SkOpContour_DEFINED 7 #ifndef SkOpContour_DEFINED
8 #define SkOpContour_DEFINED 8 #define SkOpContour_DEFINED
9 9
10 #include "SkOpSegment.h" 10 #include "SkOpSegment.h"
11 #include "SkTArray.h" 11 #include "SkTArray.h"
12 12
13 #if defined(SK_DEBUG) || !FORCE_RELEASE
14 #include "SkThread.h"
15 #endif
16
13 class SkIntersections; 17 class SkIntersections;
14 class SkOpContour; 18 class SkOpContour;
15 class SkPathWriter; 19 class SkPathWriter;
16 20
17 struct SkCoincidence { 21 struct SkCoincidence {
18 SkOpContour* fOther; 22 SkOpContour* fOther;
19 int fSegments[2]; 23 int fSegments[2];
20 double fTs[2][2]; 24 double fTs[2][2];
21 SkPoint fPts[2]; 25 SkPoint fPts[2];
22 }; 26 };
23 27
24 class SkOpContour { 28 class SkOpContour {
25 public: 29 public:
26 SkOpContour() { 30 SkOpContour() {
27 reset(); 31 reset();
28 #if defined(SK_DEBUG) || !FORCE_RELEASE 32 #if defined(SK_DEBUG) || !FORCE_RELEASE
29 fID = ++SkPathOpsDebug::gContourID; 33 fID = sk_atomic_inc(&SkPathOpsDebug::gContourID);
30 #endif 34 #endif
31 } 35 }
32 36
33 bool operator<(const SkOpContour& rh) const { 37 bool operator<(const SkOpContour& rh) const {
34 return fBounds.fTop == rh.fBounds.fTop 38 return fBounds.fTop == rh.fBounds.fTop
35 ? fBounds.fLeft < rh.fBounds.fLeft 39 ? fBounds.fLeft < rh.fBounds.fLeft
36 : fBounds.fTop < rh.fBounds.fTop; 40 : fBounds.fTop < rh.fBounds.fTop;
37 } 41 }
38 42
39 bool addCoincident(int index, SkOpContour* other, int otherIndex, 43 bool addCoincident(int index, SkOpContour* other, int otherIndex,
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 bool fOppXor; 308 bool fOppXor;
305 #if defined(SK_DEBUG) || !FORCE_RELEASE 309 #if defined(SK_DEBUG) || !FORCE_RELEASE
306 int debugID() const { return fID; } 310 int debugID() const { return fID; }
307 int fID; 311 int fID;
308 #else 312 #else
309 int debugID() const { return -1; } 313 int debugID() const { return -1; }
310 #endif 314 #endif
311 }; 315 };
312 316
313 #endif 317 #endif
OLDNEW
« no previous file with comments | « no previous file | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698