Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 * Called when the ref count goes to 0. | 100 * Called when the ref count goes to 0. |
| 101 */ | 101 */ |
| 102 virtual void internal_dispose() const { | 102 virtual void internal_dispose() const { |
| 103 this->internal_dispose_restore_refcnt_to_1(); | 103 this->internal_dispose_restore_refcnt_to_1(); |
| 104 SkDELETE(this); | 104 SkDELETE(this); |
| 105 } | 105 } |
| 106 | 106 |
| 107 friend class SkWeakRefCnt; | 107 friend class SkWeakRefCnt; |
| 108 friend class GrTexture; // to allow GrTexture's internal_dispose to | 108 friend class GrTexture; // to allow GrTexture's internal_dispose to |
| 109 // call SkRefCnt's & directly set fRefCnt (to 1) | 109 // call SkRefCnt's & directly set fRefCnt (to 1) |
| 110 friend class SkPDFObject; | |
|
reed1
2013/03/05 18:51:21
ick. If we must do this, please ad a detailed comm
| |
| 110 | 111 |
| 111 mutable int32_t fRefCnt; | 112 mutable int32_t fRefCnt; |
| 112 | 113 |
| 113 typedef SkNoncopyable INHERITED; | 114 typedef SkNoncopyable INHERITED; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 /////////////////////////////////////////////////////////////////////////////// | 117 /////////////////////////////////////////////////////////////////////////////// |
| 117 | 118 |
| 118 /** Helper macro to safely assign one SkRefCnt[TS]* to another, checking for | 119 /** Helper macro to safely assign one SkRefCnt[TS]* to another, checking for |
| 119 null in on each side of the assignment, and ensuring that ref() is called | 120 null in on each side of the assignment, and ensuring that ref() is called |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 typedef T* SkRefPtr::*unspecified_bool_type; | 256 typedef T* SkRefPtr::*unspecified_bool_type; |
| 256 operator unspecified_bool_type() const { | 257 operator unspecified_bool_type() const { |
| 257 return fObj ? &SkRefPtr::fObj : NULL; | 258 return fObj ? &SkRefPtr::fObj : NULL; |
| 258 } | 259 } |
| 259 | 260 |
| 260 private: | 261 private: |
| 261 T* fObj; | 262 T* fObj; |
| 262 }; | 263 }; |
| 263 | 264 |
| 264 #endif | 265 #endif |
| OLD | NEW |