diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-08 16:06:06 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-08 16:06:06 +0000 |
commit | ddbf4c85dece1bef3b6c97219187a6b616b66346 (patch) | |
tree | 34d9264491d8bf4d00a6ae2a2d3d84106cc16c68 | |
parent | 480ab7d5f13c4b281051a129c5cb4914da511a16 (diff) |
remove unused methods from SkRefPtr, as a check-point for better understanding
what we want to do with this class.
git-svn-id: http://skia.googlecode.com/svn/trunk@903 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | include/core/SkRefCnt.h | 20 | ||||
-rw-r--r-- | tests/UtilsTest.cpp | 6 |
2 files changed, 6 insertions, 20 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 2024e08c9b..b9b2c9858b 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -147,32 +147,18 @@ public: return *this; } - bool operator==(const SkRefPtr& rp) const { return fObj == rp.fObj; } - bool operator==(const T* obj) const { return fObj == obj; } - bool operator!=(const SkRefPtr& rp) const { return fObj != rp.fObj; } - bool operator!=(const T* obj) const { return fObj != obj; } - T* get() const { return fObj; } T& operator*() const { return *fObj; } T* operator->() const { return fObj; } - bool operator!() const { return !fObj; } typedef T* SkRefPtr::*unspecified_bool_type; - operator unspecified_bool_type() const { return fObj ? &SkRefPtr::fObj : NULL; } + operator unspecified_bool_type() const { + return fObj ? &SkRefPtr::fObj : NULL; + } private: T* fObj; }; -template <typename T> -inline bool operator==(T* obj, const SkRefPtr<T>& rp) { - return obj == rp.get(); -} - -template <typename T> -inline bool operator!=(T* obj, const SkRefPtr<T>& rp) { - return obj != rp.get(); -} - #endif diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp index 1e11bdcc2d..2019a77f74 100644 --- a/tests/UtilsTest.cpp +++ b/tests/UtilsTest.cpp @@ -23,17 +23,17 @@ static void test_refptr(skiatest::Reporter* reporter) { SkRefPtr<RefClass> rc1; REPORTER_ASSERT(reporter, rc0 == rc1); - REPORTER_ASSERT(reporter, rc0 != r0); + REPORTER_ASSERT(reporter, rc0.get() != r0); rc0 = r0; REPORTER_ASSERT(reporter, rc0); REPORTER_ASSERT(reporter, rc0 != rc1); - REPORTER_ASSERT(reporter, rc0 == r0); + REPORTER_ASSERT(reporter, rc0.get() == r0); rc1 = rc0; REPORTER_ASSERT(reporter, rc1); REPORTER_ASSERT(reporter, rc0 == rc1); - REPORTER_ASSERT(reporter, rc0 == r0); + REPORTER_ASSERT(reporter, rc0.get() == r0); rc0 = NULL; REPORTER_ASSERT(reporter, rc0.get() == NULL); |