Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
skgpu::graphite::BackendTexture Class Reference

#include <BackendTexture.h>

Public Member Functions

 BackendTexture ()
 
 BackendTexture (const BackendTexture &)
 
 ~BackendTexture ()
 
BackendTextureoperator= (const BackendTexture &)
 
bool operator== (const BackendTexture &) const
 
bool operator!= (const BackendTexture &that) const
 
bool isValid () const
 
BackendApi backend () const
 
SkISize dimensions () const
 
const TextureInfoinfo () const
 
void setMutableState (const skgpu::MutableTextureState &)
 

Friends

class VulkanResourceProvider
 

Detailed Description

Definition at line 35 of file BackendTexture.h.

Constructor & Destructor Documentation

◆ BackendTexture() [1/2]

skgpu::graphite::BackendTexture::BackendTexture ( )
default

◆ BackendTexture() [2/2]

skgpu::graphite::BackendTexture::BackendTexture ( const BackendTexture that)

Definition at line 26 of file BackendTexture.cpp.

26 {
27 *this = that;
28}

◆ ~BackendTexture()

skgpu::graphite::BackendTexture::~BackendTexture ( )
default

Member Function Documentation

◆ backend()

BackendApi skgpu::graphite::BackendTexture::backend ( ) const
inline

Definition at line 100 of file BackendTexture.h.

100{ return fInfo.backend(); }
BackendApi backend() const
Definition TextureInfo.h:76

◆ dimensions()

SkISize skgpu::graphite::BackendTexture::dimensions ( ) const
inline

Definition at line 102 of file BackendTexture.h.

102{ return fDimensions; }

◆ info()

const TextureInfo & skgpu::graphite::BackendTexture::info ( ) const
inline

Definition at line 104 of file BackendTexture.h.

104{ return fInfo; }

◆ isValid()

bool skgpu::graphite::BackendTexture::isValid ( ) const
inline

Definition at line 99 of file BackendTexture.h.

99{ return fInfo.isValid(); }

◆ operator!=()

bool skgpu::graphite::BackendTexture::operator!= ( const BackendTexture that) const
inline

Definition at line 97 of file BackendTexture.h.

97{ return !(*this == that); }

◆ operator=()

BackendTexture & skgpu::graphite::BackendTexture::operator= ( const BackendTexture that)

Definition at line 30 of file BackendTexture.cpp.

30 {
31 if (!that.isValid()) {
32 fInfo = {};
33 return *this;
34 }
35 // We shouldn't be mixing backends.
36 SkASSERT(!this->isValid() || this->backend() == that.backend());
37 fDimensions = that.fDimensions;
38 fInfo = that.fInfo;
39
40 switch (that.backend()) {
41#ifdef SK_DAWN
43 fDawnTexture = that.fDawnTexture;
44 fDawnTextureView = that.fDawnTextureView;
45 break;
46#endif
47#ifdef SK_METAL
49 fMtlTexture = that.fMtlTexture;
50 break;
51#endif
52#ifdef SK_VULKAN
54 fVkImage = that.fVkImage;
55 fMutableState = that.fMutableState;
56 fMemoryAlloc = that.fMemoryAlloc;
57 break;
58#endif
59 default:
60 SK_ABORT("Unsupported Backend");
61 }
62 return *this;
63}
#define SK_ABORT(message,...)
Definition SkAssert.h:70
#define SkASSERT(cond)
Definition SkAssert.h:116

◆ operator==()

bool skgpu::graphite::BackendTexture::operator== ( const BackendTexture that) const

Definition at line 65 of file BackendTexture.cpp.

65 {
66 if (!this->isValid() || !that.isValid()) {
67 return false;
68 }
69
70 if (fDimensions != that.fDimensions || fInfo != that.fInfo) {
71 return false;
72 }
73
74 switch (that.backend()) {
75#ifdef SK_DAWN
77 if (fDawnTexture != that.fDawnTexture) {
78 return false;
79 }
80 if (fDawnTextureView != that.fDawnTextureView) {
81 return false;
82 }
83 break;
84#endif
85#ifdef SK_METAL
87 if (fMtlTexture != that.fMtlTexture) {
88 return false;
89 }
90 break;
91#endif
92#ifdef SK_VULKAN
94 if (fVkImage != that.fVkImage) {
95 return false;
96 }
97 break;
98#endif
99 default:
100 SK_ABORT("Unsupported Backend");
101 }
102 return true;
103}

◆ setMutableState()

void skgpu::graphite::BackendTexture::setMutableState ( const skgpu::MutableTextureState newState)

Definition at line 105 of file BackendTexture.cpp.

105 {
106 fMutableState->set(newState);
107}

Friends And Related Symbol Documentation

◆ VulkanResourceProvider

friend class VulkanResourceProvider
friend

Definition at line 129 of file BackendTexture.h.

Member Data Documentation

◆ fEnsureUnionNonEmpty

void* skgpu::graphite::BackendTexture::fEnsureUnionNonEmpty

Definition at line 157 of file BackendTexture.h.


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