Remove sk_ref_sp's misleading preprocessor define and comment
This function will always be useful. Don't make it look/feel like a temporary hack. BUG=skia: Change-Id: I6506d7d51dc3b25a7dbcea4ac273f51cf05f3a89 Reviewed-on: https://skia-review.googlesource.com/6330 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
92aee3d685
commit
a69f4cf0a7
@ -16,8 +16,6 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#define SK_SUPPORT_TRANSITION_TO_SP_INTERFACES
|
|
||||||
|
|
||||||
/** \class SkRefCntBase
|
/** \class SkRefCntBase
|
||||||
|
|
||||||
SkRefCntBase is the base class for objects that may be shared by multiple
|
SkRefCntBase is the base class for objects that may be shared by multiple
|
||||||
@ -413,20 +411,14 @@ sk_sp<T> sk_make_sp(Args&&... args) {
|
|||||||
return sk_sp<T>(new T(std::forward<Args>(args)...));
|
return sk_sp<T>(new T(std::forward<Args>(args)...));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SK_SUPPORT_TRANSITION_TO_SP_INTERFACES
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns a sk_sp wrapping the provided ptr AND calls ref on it (if not null).
|
* Returns a sk_sp wrapping the provided ptr AND calls ref on it (if not null).
|
||||||
*
|
*
|
||||||
* This is different than the semantics of the constructor for sk_sp, which just wraps the ptr,
|
* This is different than the semantics of the constructor for sk_sp, which just wraps the ptr,
|
||||||
* effectively "adopting" it.
|
* effectively "adopting" it.
|
||||||
*
|
|
||||||
* This function may be helpful while we convert callers from ptr-based to sk_sp-based parameters.
|
|
||||||
*/
|
*/
|
||||||
template <typename T> sk_sp<T> sk_ref_sp(T* obj) {
|
template <typename T> sk_sp<T> sk_ref_sp(T* obj) {
|
||||||
return sk_sp<T>(SkSafeRef(obj));
|
return sk_sp<T>(SkSafeRef(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
Loading…
Reference in New Issue
Block a user