Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
skgpu::MutableTextureState Class Reference

#include <MutableTextureState.h>

Inheritance diagram for skgpu::MutableTextureState:
SkRefCnt SkRefCntBase

Public Member Functions

 MutableTextureState ()
 
 ~MutableTextureState () override
 
 MutableTextureState (const MutableTextureState &that)
 
MutableTextureStateoperator= (const MutableTextureState &that)
 
void set (const MutableTextureState &that)
 
BackendApi backend () const
 
bool isValid () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Friends

class MutableTextureStateData
 
class MutableTextureStatePriv
 

Detailed Description

Since Skia and clients can both modify gpu textures and their connected state, Skia needs a way for clients to inform us if they have modifiend any of this state. In order to not need setters for every single API and state, we use this class to be a generic wrapper around all the mutable state. This class is used for calls that inform Skia of these texture/image state changes by the client as well as for requesting state changes to be done by Skia. The backend specific state that is wrapped by this class are located in files like:

Definition at line 30 of file MutableTextureState.h.

Constructor & Destructor Documentation

◆ MutableTextureState() [1/2]

skgpu::MutableTextureState::MutableTextureState ( )

Definition at line 14 of file MutableTextureState.cpp.

14 :
16 fIsValid(false) {}

◆ ~MutableTextureState()

skgpu::MutableTextureState::~MutableTextureState ( )
overridedefault

◆ MutableTextureState() [2/2]

skgpu::MutableTextureState::MutableTextureState ( const MutableTextureState that)

Definition at line 19 of file MutableTextureState.cpp.

19 : fIsValid(false) {
20 this->set(that);
21}
void set(const MutableTextureState &that)

Member Function Documentation

◆ backend()

BackendApi skgpu::MutableTextureState::backend ( ) const
inline

Definition at line 41 of file MutableTextureState.h.

41{ return fBackend; }

◆ isValid()

bool skgpu::MutableTextureState::isValid ( ) const
inline

Definition at line 44 of file MutableTextureState.h.

44{ return fIsValid; }

◆ operator=()

MutableTextureState & skgpu::MutableTextureState::operator= ( const MutableTextureState that)

Definition at line 23 of file MutableTextureState.cpp.

23 {
24 if (this != &that) {
25 this->set(that);
26 }
27 return *this;
28}

◆ set()

void skgpu::MutableTextureState::set ( const MutableTextureState that)

Definition at line 30 of file MutableTextureState.cpp.

30 {
31 SkASSERT(!fIsValid || this->fBackend == that.fBackend);
32 fIsValid = that.fIsValid;
33 fBackend = that.fBackend;
34 if (!fIsValid) {
35 return;
36 }
37 fStateData.reset();
38 switch (fBackend) {
40 that.fStateData->copyTo(fStateData);
41 break;
42 default:
43 SK_ABORT("Unknown BackendApi");
44 }
45}
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
#define SkASSERT(cond)
Definition: SkAssert.h:116

Friends And Related Function Documentation

◆ MutableTextureStateData

friend class MutableTextureStateData
friend

Definition at line 47 of file MutableTextureState.h.

◆ MutableTextureStatePriv

friend class MutableTextureStatePriv
friend

Definition at line 48 of file MutableTextureState.h.


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