diff options
Diffstat (limited to 'include/core/SkRefCnt.h')
-rw-r--r-- | include/core/SkRefCnt.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 01580abe1a..5d070a2cc1 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -445,4 +445,8 @@ template <typename T> sk_sp<T> sk_ref_sp(T* obj) { return sk_sp<T>(SkSafeRef(obj)); } +template <typename T> sk_sp<T> sk_ref_sp(const T* obj) { + return sk_sp<T>(const_cast<T*>(SkSafeRef(obj))); +} + #endif |