9#ifndef GrD3DTypes_DEFINED
10#define GrD3DTypes_DEFINED
48template <
typename T>
class gr_cp {
52 constexpr gr_cp() : fObject(nullptr) {}
53 constexpr gr_cp(std::nullptr_t) : fObject(nullptr) {}
102 this->
reset(that.release());
106 explicit operator bool()
const {
return this->
get() !=
nullptr; }
108 T*
get()
const {
return fObject; }
117 T* oldObject = fObject;
127 if (this->fObject !=
object) {
149 return a.get() ==
b.get();
154 return a.get() !=
b.get();
166 D3D12_RESOURCE_STATES initialResourceState,
168 const D3D12_CLEAR_VALUE*) = 0;
170 uint64_t localOffset,
171 const D3D12_RESOURCE_DESC*,
172 D3D12_RESOURCE_STATES initialResourceState,
173 const D3D12_CLEAR_VALUE*) = 0;
193 D3D12_RESOURCE_STATES resourceState,
195 uint32_t sampleCount,
197 unsigned int sampleQualityLevel,
209 D3D12_RESOURCE_STATES resourceState)
219#if defined(GR_TEST_UTILS)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
bool operator==(const gr_cp< T > &a, const gr_cp< T > &b)
static void GrSafeComRelease(T *obj)
bool operator!=(const gr_cp< T > &a, const gr_cp< T > &b)
static T * GrSafeComAddRef(T *obj)
static SkString resource(SkPDFResourceType type, int index)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
~GrD3DAlloc() override=default
virtual gr_cp< ID3D12Resource > createResource(D3D12_HEAP_TYPE, const D3D12_RESOURCE_DESC *, D3D12_RESOURCE_STATES initialResourceState, sk_sp< GrD3DAlloc > *allocation, const D3D12_CLEAR_VALUE *)=0
virtual gr_cp< ID3D12Resource > createAliasingResource(sk_sp< GrD3DAlloc > &allocation, uint64_t localOffset, const D3D12_RESOURCE_DESC *, D3D12_RESOURCE_STATES initialResourceState, const D3D12_CLEAR_VALUE *)=0
gr_cp(const gr_cp< T > &that)
constexpr gr_cp(std::nullptr_t)
gr_cp< T > & operator=(const gr_cp< T > &that)
void reset(T *object=nullptr)
gr_cp< T > & operator=(gr_cp< T > &&that)
uint32_t uint32_t * format
gr_cp< ID3D12Fence > fFence
skgpu::Protected fProtected
unsigned int fSampleQualityPattern
unsigned int fSampleQualityPattern
D3D12_RESOURCE_STATES fResourceState
gr_cp< ID3D12Resource > fResource
skgpu::Protected fProtected
GrD3DTextureResourceInfo(ID3D12Resource *resource, const sk_sp< GrD3DAlloc > alloc, D3D12_RESOURCE_STATES resourceState, DXGI_FORMAT format, uint32_t sampleCount, uint32_t levelCount, unsigned int sampleQualityLevel, skgpu::Protected isProtected=skgpu::Protected::kNo)
GrD3DTextureResourceInfo()=default
GrD3DTextureResourceInfo(const GrD3DTextureResourceInfo &info, D3D12_RESOURCE_STATES resourceState)
sk_sp< GrD3DAlloc > fAlloc