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

Side by Side Diff: include/core/SkOnce.h

Issue 1116943004: Move instanced index buffer creation to flush time (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix missing assignment of keys to index buffers Created 5 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 | « gyp/gpu.gypi ('k') | include/gpu/GrContext.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 7
8 #ifndef SkOnce_DEFINED 8 #ifndef SkOnce_DEFINED
9 #define SkOnce_DEFINED 9 #define SkOnce_DEFINED
10 10
(...skipping 12 matching lines...) Expand all
23 // SK_DECLARE_STATIC_ONCE(once); 23 // SK_DECLARE_STATIC_ONCE(once);
24 // SkOnce(&once, register_my_stuff, GetGlobalRegistry()); 24 // SkOnce(&once, register_my_stuff, GetGlobalRegistry());
25 // } 25 // }
26 // 26 //
27 // No matter how many times you call EnsureRegistered(), register_my_stuff will be called just once. 27 // No matter how many times you call EnsureRegistered(), register_my_stuff will be called just once.
28 // OnceTest.cpp also should serve as a few other simple examples. 28 // OnceTest.cpp also should serve as a few other simple examples.
29 29
30 #include "SkAtomics.h" 30 #include "SkAtomics.h"
31 #include "SkSpinlock.h" 31 #include "SkSpinlock.h"
32 32
33 // This must be used in a global scope, not in fuction scope or as a class membe r. 33 // This must be used in a global scope, not in function scope or as a class memb er.
34 #define SK_DECLARE_STATIC_ONCE(name) namespace {} static SkOnceFlag name 34 #define SK_DECLARE_STATIC_ONCE(name) namespace {} static SkOnceFlag name
35 35
36 class SkOnceFlag; 36 class SkOnceFlag;
37 37
38 inline void SkOnce(SkOnceFlag* once, void (*f)()); 38 inline void SkOnce(SkOnceFlag* once, void (*f)());
39 39
40 template <typename Arg> 40 template <typename Arg>
41 inline void SkOnce(SkOnceFlag* once, void (*f)(Arg), Arg arg); 41 inline void SkOnce(SkOnceFlag* once, void (*f)(Arg), Arg arg);
42 42
43 // If you've already got a lock and a flag to use, this variant lets you avoid a n extra SkOnceFlag. 43 // If you've already got a lock and a flag to use, this variant lets you avoid a n extra SkOnceFlag.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 inline void SkOnce(SkOnceFlag* once, void (*func)()) { 130 inline void SkOnce(SkOnceFlag* once, void (*func)()) {
131 return SkOnce(once, sk_once_no_arg_adaptor, func); 131 return SkOnce(once, sk_once_no_arg_adaptor, func);
132 } 132 }
133 133
134 template <typename Lock> 134 template <typename Lock>
135 inline void SkOnce(bool* done, Lock* lock, void (*func)()) { 135 inline void SkOnce(bool* done, Lock* lock, void (*func)()) {
136 return SkOnce(done, lock, sk_once_no_arg_adaptor, func); 136 return SkOnce(done, lock, sk_once_no_arg_adaptor, func);
137 } 137 }
138 138
139 #endif // SkOnce_DEFINED 139 #endif // SkOnce_DEFINED
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698