![]() |
Flutter Engine
The Flutter Engine
|
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkDebug.h"
#include <cstddef>
#include <type_traits>
Go to the source code of this file.
Classes | |
class | gr_sp< T, Ref, Unref > |
Typedefs | |
template<typename T > | |
using | gr_cb = gr_sp< T, &T::refCommandBuffer, &T::unrefCommandBuffer > |
template<typename T > | |
using | gr_rp = gr_sp< T, &T::ref, &T::recycle > |
Functions | |
template<typename T > | |
gr_rp< T > | gr_ref_rp (T *obj) |
template<typename T > | |
gr_rp< T > | gr_ref_rp (const T *obj) |
Shared pointer class to wrap classes that support a refCommandBuffer() and unrefCommandBuffer() interface.
This class supports copying, moving, and assigning an sk_sp into it. In general these commands do not modify the sk_sp at all but just call refCommandBuffer() on the underlying object.
This class is designed to be used by GrGpuResources/graphite::Resources that need to track when they are in use on gpu (usually via a command buffer) separately from tracking if there are any current logical usages in Skia. This allows for a scratch resources to be reused for new draw calls even if it is in use on the GPU.
Definition at line 178 of file GpuRefCnt.h.
This class mimics sk_sp but instead of calling unref it calls recycle instead.
Definition at line 185 of file GpuRefCnt.h.
Definition at line 195 of file GpuRefCnt.h.
Returns a gr_rp wrapping the provided ptr AND calls ref on it (if not null).
This is different than the semantics of the constructor for gr_rp, which just wraps the ptr, effectively "adopting" it.
Definition at line 193 of file GpuRefCnt.h.