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

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

Issue 257773007: pathops debug globals use atomic increment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/pathops/SkOpContour.h ('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 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 #ifndef SkOpSegment_DEFINE 7 #ifndef SkOpSegment_DEFINE
8 #define SkOpSegment_DEFINE 8 #define SkOpSegment_DEFINE
9 9
10 #include "SkOpAngle.h" 10 #include "SkOpAngle.h"
11 #include "SkOpSpan.h" 11 #include "SkOpSpan.h"
12 #include "SkPathOpsBounds.h" 12 #include "SkPathOpsBounds.h"
13 #include "SkPathOpsCurve.h" 13 #include "SkPathOpsCurve.h"
14 #include "SkTArray.h" 14 #include "SkTArray.h"
15 #include "SkTDArray.h" 15 #include "SkTDArray.h"
16 16
17 #if defined(SK_DEBUG) || !FORCE_RELEASE
18 #include "SkThread.h"
19 #endif
20
17 class SkPathWriter; 21 class SkPathWriter;
18 22
19 class SkOpSegment { 23 class SkOpSegment {
20 public: 24 public:
21 SkOpSegment() { 25 SkOpSegment() {
22 #if defined(SK_DEBUG) || !FORCE_RELEASE 26 #if defined(SK_DEBUG) || !FORCE_RELEASE
23 fID = ++SkPathOpsDebug::gSegmentID; 27 fID = sk_atomic_inc(&SkPathOpsDebug::gSegmentID);
24 #endif 28 #endif
25 } 29 }
26 30
27 bool operator<(const SkOpSegment& rh) const { 31 bool operator<(const SkOpSegment& rh) const {
28 return fBounds.fTop < rh.fBounds.fTop; 32 return fBounds.fTop < rh.fBounds.fTop;
29 } 33 }
30 34
31 // FIXME: add some template or macro to avoid casting 35 // FIXME: add some template or macro to avoid casting
32 SkOpAngle& angle(int index) { 36 SkOpAngle& angle(int index) {
33 const SkOpAngle& cAngle = (const_cast<const SkOpSegment*>(this))->angle( index); 37 const SkOpAngle& cAngle = (const_cast<const SkOpSegment*>(this))->angle( index);
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 bool fSmall; // set if some span is small 523 bool fSmall; // set if some span is small
520 bool fTiny; // set if some span is tiny 524 bool fTiny; // set if some span is tiny
521 #if defined(SK_DEBUG) || !FORCE_RELEASE 525 #if defined(SK_DEBUG) || !FORCE_RELEASE
522 int fID; 526 int fID;
523 #endif 527 #endif
524 528
525 friend class PathOpsSegmentTester; 529 friend class PathOpsSegmentTester;
526 }; 530 };
527 531
528 #endif 532 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkOpContour.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698