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

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

Issue 1272293004: Move SkTemplates.h to private. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: It's a struct! Created 5 years, 4 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 | « include/core/SkTArray.h ('k') | include/core/SkTemplates.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 2011 Google Inc. 2 * Copyright 2011 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 SkTLazy_DEFINED 8 #ifndef SkTLazy_DEFINED
9 #define SkTLazy_DEFINED 9 #define SkTLazy_DEFINED
10 10
11 #include "SkTemplates.h" 11 #include "../private/SkTemplates.h"
12 #include "SkTypes.h" 12 #include "SkTypes.h"
13 #include <new> 13 #include <new>
14 14
15 /** 15 /**
16 * Efficient way to defer allocating/initializing a class until it is needed 16 * Efficient way to defer allocating/initializing a class until it is needed
17 * (if ever). 17 * (if ever).
18 */ 18 */
19 template <typename T> class SkTLazy { 19 template <typename T> class SkTLazy {
20 public: 20 public:
21 SkTLazy() : fPtr(NULL) {} 21 SkTLazy() : fPtr(NULL) {}
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 operator const T*() const { return fObj; } 161 operator const T*() const { return fObj; }
162 162
163 const T& operator *() const { return *fObj; } 163 const T& operator *() const { return *fObj; }
164 164
165 private: 165 private:
166 const T* fObj; 166 const T* fObj;
167 SkTLazy<T> fLazy; 167 SkTLazy<T> fLazy;
168 }; 168 };
169 169
170 #endif 170 #endif
OLDNEW
« no previous file with comments | « include/core/SkTArray.h ('k') | include/core/SkTemplates.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698