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

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

Issue 140823003: Move GrGLExtensions from GrGLContextInfo to GrGLInterface (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix Android 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 | « no previous file | include/gpu/gl/GrGLExtensions.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 8
9 9
10 #ifndef SkTemplates_DEFINED 10 #ifndef SkTemplates_DEFINED
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 * Transfer ownership of the object to the caller, setting the internal 136 * Transfer ownership of the object to the caller, setting the internal
137 * pointer to NULL. Note that this differs from get(), which also returns 137 * pointer to NULL. Note that this differs from get(), which also returns
138 * the pointer, but it does not transfer ownership. 138 * the pointer, but it does not transfer ownership.
139 */ 139 */
140 T* detach() { 140 T* detach() {
141 T* obj = fObj; 141 T* obj = fObj;
142 fObj = NULL; 142 fObj = NULL;
143 return obj; 143 return obj;
144 } 144 }
145 145
146 void swap(SkAutoTDelete* that) {
147 SkTSwap(fObj, that->fObj);
148 }
149
146 private: 150 private:
147 T* fObj; 151 T* fObj;
148 }; 152 };
149 153
150 // Calls ~T() in the destructor. 154 // Calls ~T() in the destructor.
151 template <typename T> class SkAutoTDestroy : SkNoncopyable { 155 template <typename T> class SkAutoTDestroy : SkNoncopyable {
152 public: 156 public:
153 SkAutoTDestroy(T* obj = NULL) : fObj(obj) {} 157 SkAutoTDestroy(T* obj = NULL) : fObj(obj) {}
154 ~SkAutoTDestroy() { 158 ~SkAutoTDestroy() {
155 if (NULL != fObj) { 159 if (NULL != fObj) {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 /** 462 /**
459 * Returns void* because this object does not initialize the 463 * Returns void* because this object does not initialize the
460 * memory. Use placement new for types that require a cons. 464 * memory. Use placement new for types that require a cons.
461 */ 465 */
462 void* get() { return fStorage.get(); } 466 void* get() { return fStorage.get(); }
463 private: 467 private:
464 SkAlignedSStorage<sizeof(T)*N> fStorage; 468 SkAlignedSStorage<sizeof(T)*N> fStorage;
465 }; 469 };
466 470
467 #endif 471 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/gl/GrGLExtensions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698