Lines Matching defs:obj
129 /** Call obj->ref() and return obj. The obj must not be nullptr.
131 template <typename T> static inline T* SkRef(T* obj) {
132 SkASSERT(obj);
133 obj->ref();
134 return obj;
137 /** Check if the argument is non-null, and if so, call obj->ref() and return obj.
139 template <typename T> static inline T* SkSafeRef(T* obj) {
140 if (obj) {
141 obj->ref();
143 return obj;
146 /** Check if the argument is non-null, and if so, call obj->unref()
148 template <typename T> static inline void SkSafeUnref(T* obj) {
149 if (obj) {
150 obj->unref();
245 explicit sk_sp(T* obj) : fPtr(obj) {}
374 template <typename T> sk_sp<T> sk_ref_sp(T* obj) {
375 return sk_sp<T>(SkSafeRef(obj));
378 template <typename T> sk_sp<T> sk_ref_sp(const T* obj) {
379 return sk_sp<T>(const_cast<T*>(SkSafeRef(obj)));