From 9075634d60cc8ce979e3007d4ba1d0e57afc6644 Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Tue, 8 Nov 2016 09:03:48 -0500 Subject: Remove SkAutoTUnref from public API GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4530 Change-Id: I1ba33edc5ca44332ff4f296e6b9997a133a08a87 Reviewed-on: https://skia-review.googlesource.com/4530 Commit-Queue: Hal Canary Reviewed-by: Mike Reed --- include/core/SkRefCnt.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'include/core/SkRefCnt.h') diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 9436b52269..53523b419d 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -181,26 +181,6 @@ template static inline void SkSafeSetNull(T*& obj) { /////////////////////////////////////////////////////////////////////////////// -template struct SkTUnref { - void operator()(T* t) { t->unref(); } -}; - -/** - * Utility class that simply unref's its argument in the destructor. - */ -template class SkAutoTUnref : public std::unique_ptr> { -public: - explicit SkAutoTUnref(T* obj = nullptr) : std::unique_ptr>(obj) {} - - operator T*() const { return this->get(); } - -#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) - // Need to update graphics/Shader.cpp. - T* detach() { return this->release(); } -#endif -}; -// Can't use the #define trick to guard a bare SkAutoTUnref(...) because it's templated. :( - // This is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes instead of 8 or 16. // There's only benefit to using this if the deriving class does not otherwise need a vtable. template -- cgit v1.2.3