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

Side by Side Diff: gm/convexpaths.cpp

Issue 99483003: Make leak counters thread-safe (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: bug# Created 6 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 | Annotate | Revision Log
« no previous file with comments | « gm/colormatrix.cpp ('k') | gyp/core.gypi » ('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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkRandom.h" 9 #include "SkRandom.h"
10 #include "SkTArray.h" 10 #include "SkTArray.h"
11 11
12 class SkOnce : SkNoncopyable { 12 class SkDoOnce : SkNoncopyable {
13 public: 13 public:
14 SkOnce() { fDidOnce = false; } 14 SkDoOnce() { fDidOnce = false; }
15 15
16 bool needToDo() const { return !fDidOnce; } 16 bool needToDo() const { return !fDidOnce; }
17 bool alreadyDone() const { return fDidOnce; } 17 bool alreadyDone() const { return fDidOnce; }
18 void accomplished() { 18 void accomplished() {
19 SkASSERT(!fDidOnce); 19 SkASSERT(!fDidOnce);
20 fDidOnce = true; 20 fDidOnce = true;
21 } 21 }
22 22
23 private: 23 private:
24 bool fDidOnce; 24 bool fDidOnce;
25 }; 25 };
26 26
27 namespace skiagm { 27 namespace skiagm {
28 28
29 class ConvexPathsGM : public GM { 29 class ConvexPathsGM : public GM {
30 SkOnce fOnce; 30 SkDoOnce fOnce;
31 public: 31 public:
32 ConvexPathsGM() { 32 ConvexPathsGM() {
33 this->setBGColor(0xFF000000); 33 this->setBGColor(0xFF000000);
34 } 34 }
35 35
36 protected: 36 protected:
37 virtual SkString onShortName() { 37 virtual SkString onShortName() {
38 return SkString("convexpaths"); 38 return SkString("convexpaths");
39 } 39 }
40 40
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 typedef GM INHERITED; 288 typedef GM INHERITED;
289 SkTArray<SkPath> fPaths; 289 SkTArray<SkPath> fPaths;
290 }; 290 };
291 291
292 ////////////////////////////////////////////////////////////////////////////// 292 //////////////////////////////////////////////////////////////////////////////
293 293
294 static GM* MyFactory(void*) { return new ConvexPathsGM; } 294 static GM* MyFactory(void*) { return new ConvexPathsGM; }
295 static GMRegistry reg(MyFactory); 295 static GMRegistry reg(MyFactory);
296 296
297 } 297 }
OLDNEW
« no previous file with comments | « gm/colormatrix.cpp ('k') | gyp/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698