Lines Matching defs:gr_sp

24 class gr_sp {
42 constexpr gr_sp() : fPtr(nullptr) {}
43 constexpr gr_sp(std::nullptr_t) : fPtr(nullptr) {}
47 * created gr_sp both have a reference to it.
49 gr_sp(const gr_sp& that) : fPtr(SafeRef(that.get())) {}
54 gr_sp(const gr_sp<U, URefBase, UUnrefBase, Ref, Unref>& that) : fPtr(SafeRef(that.get())) {}
56 gr_sp(const sk_sp<T>& that) : fPtr(SafeRef(that.get())) {}
60 * Move the underlying object from the argument to the newly created gr_sp. Afterwards only the
61 * new gr_sp will have a reference to the object, and the argument will point to null.
64 gr_sp(gr_sp&& that) : fPtr(that.release()) {}
67 * Copies the underlying object pointer from the argument to the gr_sp. It will then call
70 gr_sp(sk_sp<T>&& that) : fPtr(SafeRef(that.get())) {}
73 * Adopt the bare pointer into the newly created gr_sp.
76 explicit gr_sp(T* obj) : fPtr(obj) {}
81 ~gr_sp() {
86 gr_sp& operator=(std::nullptr_t) {
92 * Shares the underlying object referenced by the argument by calling Ref() on it. If this gr_sp
95 gr_sp& operator=(const gr_sp& that) {
103 * Copies the underlying object pointer from the argument to the gr_sp. If the gr_sp previously
107 gr_sp& operator=(const sk_sp<T>& that) {
113 * Move the underlying object from the argument to the gr_sp. If the gr_sp previously held
117 gr_sp& operator=(gr_sp&& that) {
123 * Copies the underlying object pointer from the argument to the gr_sp. If the gr_sp previously
127 gr_sp& operator=(sk_sp<T>&& that) {
182 using gr_cb = gr_sp<T,
194 using gr_rp = gr_sp<T, GrManagedResource, GrRecycledResource, &T::ref, &T::recycle>;