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

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

Issue 392333008: Make GrCacheable implement its own ref counting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove extra blank line Created 6 years, 5 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 | « gm/texdata.cpp ('k') | include/gpu/GrCacheable.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 SkRefCnt_DEFINED 10 #ifndef SkRefCnt_DEFINED
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 /** 106 /**
107 * Called when the ref count goes to 0. 107 * Called when the ref count goes to 0.
108 */ 108 */
109 virtual void internal_dispose() const { 109 virtual void internal_dispose() const {
110 this->internal_dispose_restore_refcnt_to_1(); 110 this->internal_dispose_restore_refcnt_to_1();
111 SkDELETE(this); 111 SkDELETE(this);
112 } 112 }
113 113
114 // The following friends are those which override internal_dispose() 114 // The following friends are those which override internal_dispose()
115 // and conditionally call SkRefCnt::internal_dispose(). 115 // and conditionally call SkRefCnt::internal_dispose().
116 friend class GrTexture;
117 friend class SkWeakRefCnt; 116 friend class SkWeakRefCnt;
118 117
119 mutable int32_t fRefCnt; 118 mutable int32_t fRefCnt;
120 119
121 typedef SkNoncopyable INHERITED; 120 typedef SkNoncopyable INHERITED;
122 }; 121 };
123 122
124 #ifdef SK_REF_CNT_MIXIN_INCLUDE 123 #ifdef SK_REF_CNT_MIXIN_INCLUDE
125 // It is the responsibility of the following include to define the type SkRefCnt . 124 // It is the responsibility of the following include to define the type SkRefCnt .
126 // This SkRefCnt should normally derive from SkRefCntBase. 125 // This SkRefCnt should normally derive from SkRefCntBase.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 }; 241 };
243 // Can't use the #define trick below to guard a bare SkAutoTUnref(...) because i t's templated. :( 242 // Can't use the #define trick below to guard a bare SkAutoTUnref(...) because i t's templated. :(
244 243
245 class SkAutoUnref : public SkAutoTUnref<SkRefCnt> { 244 class SkAutoUnref : public SkAutoTUnref<SkRefCnt> {
246 public: 245 public:
247 SkAutoUnref(SkRefCnt* obj) : SkAutoTUnref<SkRefCnt>(obj) {} 246 SkAutoUnref(SkRefCnt* obj) : SkAutoTUnref<SkRefCnt>(obj) {}
248 }; 247 };
249 #define SkAutoUnref(...) SK_REQUIRE_LOCAL_VAR(SkAutoUnref) 248 #define SkAutoUnref(...) SK_REQUIRE_LOCAL_VAR(SkAutoUnref)
250 249
251 #endif 250 #endif
OLDNEW
« no previous file with comments | « gm/texdata.cpp ('k') | include/gpu/GrCacheable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698