Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
GrD3DBackendSurfaceInfo Struct Reference

#include <GrD3DTypesMinimal.h>

Public Member Functions

 GrD3DBackendSurfaceInfo (const GrD3DTextureResourceInfo &info, GrD3DResourceState *state)
 
void cleanup ()
 
GrD3DBackendSurfaceInfooperator= (const GrD3DBackendSurfaceInfo &)=delete
 
void assign (const GrD3DBackendSurfaceInfo &, bool isValid)
 
void setResourceState (GrD3DResourceStateEnum state)
 
sk_sp< GrD3DResourceStategetGrD3DResourceState () const
 
GrD3DTextureResourceInfo snapTextureResourceInfo () const
 
bool isProtected () const
 

Detailed Description

Definition at line 33 of file GrD3DTypesMinimal.h.

Constructor & Destructor Documentation

◆ GrD3DBackendSurfaceInfo()

GrD3DBackendSurfaceInfo::GrD3DBackendSurfaceInfo ( const GrD3DTextureResourceInfo info,
GrD3DResourceState state 
)

Definition at line 14 of file GrD3DTypesMinimal.cpp.

16 : fTextureResourceInfo(new GrD3DTextureResourceInfo(info))
17 , fResourceState(state) {}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
AtkStateType state

Member Function Documentation

◆ assign()

void GrD3DBackendSurfaceInfo::assign ( const GrD3DBackendSurfaceInfo that,
bool  isValid 
)

Definition at line 26 of file GrD3DTypesMinimal.cpp.

26 {
27 GrD3DTextureResourceInfo* oldInfo = fTextureResourceInfo;
28 GrD3DResourceState* oldLayout = fResourceState;
29 fTextureResourceInfo = new GrD3DTextureResourceInfo(*that.fTextureResourceInfo);
30 fResourceState = SkSafeRef(that.fResourceState);
31 if (isThisValid) {
32 delete oldInfo;
33 SkSafeUnref(oldLayout);
34 }
35}
static void SkSafeUnref(T *obj)
Definition: SkRefCnt.h:149
static T * SkSafeRef(T *obj)
Definition: SkRefCnt.h:140

◆ cleanup()

void GrD3DBackendSurfaceInfo::cleanup ( )

Definition at line 19 of file GrD3DTypesMinimal.cpp.

19 {
20 SkSafeUnref(fResourceState);
21 fResourceState = nullptr;
22 delete fTextureResourceInfo;
23 fTextureResourceInfo = nullptr;
24};

◆ getGrD3DResourceState()

sk_sp< GrD3DResourceState > GrD3DBackendSurfaceInfo::getGrD3DResourceState ( ) const

Definition at line 42 of file GrD3DTypesMinimal.cpp.

42 {
43 SkASSERT(fResourceState);
44 return sk_ref_sp(fResourceState);
45}
#define SkASSERT(cond)
Definition: SkAssert.h:116
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381

◆ isProtected()

bool GrD3DBackendSurfaceInfo::isProtected ( ) const

Definition at line 53 of file GrD3DTypesMinimal.cpp.

53 {
54 SkASSERT(fTextureResourceInfo);
55 return fTextureResourceInfo->fProtected == GrProtected::kYes;
56}
skgpu::Protected fProtected
Definition: GrD3DTypes.h:187

◆ operator=()

GrD3DBackendSurfaceInfo & GrD3DBackendSurfaceInfo::operator= ( const GrD3DBackendSurfaceInfo )
delete

◆ setResourceState()

void GrD3DBackendSurfaceInfo::setResourceState ( GrD3DResourceStateEnum  state)

Definition at line 37 of file GrD3DTypesMinimal.cpp.

37 {
38 SkASSERT(fResourceState);
39 fResourceState->setResourceState(static_cast<D3D12_RESOURCE_STATES>(resourceState));
40}
void setResourceState(D3D12_RESOURCE_STATES state)

◆ snapTextureResourceInfo()

GrD3DTextureResourceInfo GrD3DBackendSurfaceInfo::snapTextureResourceInfo ( ) const

Definition at line 47 of file GrD3DTypesMinimal.cpp.

47 {
49 *fTextureResourceInfo,
50 static_cast<D3D12_RESOURCE_STATES>(fResourceState->getResourceState()));
51}
D3D12_RESOURCE_STATES getResourceState() const

The documentation for this struct was generated from the following files: