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

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

Issue 1832053003: Fix typo in SkTLazy copy ctor. src is a reference, not a pointer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | 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 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
(...skipping 11 matching lines...) Expand all
22 SkTLazy() : fPtr(NULL) {} 22 SkTLazy() : fPtr(NULL) {}
23 23
24 explicit SkTLazy(const T* src) : fPtr(NULL) { 24 explicit SkTLazy(const T* src) : fPtr(NULL) {
25 if (src) { 25 if (src) {
26 fPtr = new (fStorage.get()) T(*src); 26 fPtr = new (fStorage.get()) T(*src);
27 } 27 }
28 } 28 }
29 29
30 SkTLazy(const SkTLazy<T>& src) : fPtr(NULL) { 30 SkTLazy(const SkTLazy<T>& src) : fPtr(NULL) {
31 if (src.isValid()) { 31 if (src.isValid()) {
32 fPtr = new (fStorage.get()) T(*src->get()); 32 fPtr = new (fStorage.get()) T(*src.get());
33 } else { 33 } else {
34 fPtr = NULL; 34 fPtr = NULL;
35 } 35 }
36 } 36 }
37 37
38 ~SkTLazy() { 38 ~SkTLazy() {
39 if (this->isValid()) { 39 if (this->isValid()) {
40 fPtr->~T(); 40 fPtr->~T();
41 } 41 }
42 } 42 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 operator const T*() const { return fObj; } 164 operator const T*() const { return fObj; }
165 165
166 const T& operator *() const { return *fObj; } 166 const T& operator *() const { return *fObj; }
167 167
168 private: 168 private:
169 const T* fObj; 169 const T* fObj;
170 SkTLazy<T> fLazy; 170 SkTLazy<T> fLazy;
171 }; 171 };
172 172
173 #endif 173 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698