diff options
author | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-04 19:31:24 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-04 19:31:24 +0000 |
commit | d96d17b9c113ac694138224249ff2ce643e961dd (patch) | |
tree | e4057be1bbc1a448d19dea3ce54136e7c97ed188 /include | |
parent | 4a1362a3c91ae9461a54bf1b04c250b0aa145db4 (diff) |
Remove SkRefPtr
(resubmit of https://codereview.appspot.com/7030059/)
TBR=junov@google.com
Review URL: https://codereview.appspot.com/7030065
git-svn-id: http://skia.googlecode.com/svn/trunk@7030 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkRefCnt.h | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 21ed0efec3..17d77de288 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -229,37 +229,5 @@ private: SkRefCnt* fObj; }; -/** Wrapper class for SkRefCnt pointers. This manages ref/unref of a pointer to - a SkRefCnt (or subclass) object. - */ -template <typename T> class SkRefPtr { -public: - SkRefPtr() : fObj(NULL) {} - SkRefPtr(T* obj) : fObj(obj) { SkSafeRef(fObj); } - SkRefPtr(const SkRefPtr& o) : fObj(o.fObj) { SkSafeRef(fObj); } - ~SkRefPtr() { SkSafeUnref(fObj); } - - SkRefPtr& operator=(const SkRefPtr& rp) { - SkRefCnt_SafeAssign(fObj, rp.fObj); - return *this; - } - SkRefPtr& operator=(T* obj) { - SkRefCnt_SafeAssign(fObj, obj); - return *this; - } - - T* get() const { return fObj; } - T& operator*() const { return *fObj; } - T* operator->() const { return fObj; } - - typedef T* SkRefPtr::*unspecified_bool_type; - operator unspecified_bool_type() const { - return fObj ? &SkRefPtr::fObj : NULL; - } - -private: - T* fObj; -}; - #endif |