Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
skgpu::graphite::Texture Class Reference

#include <Texture.h>

Inheritance diagram for skgpu::graphite::Texture:
skgpu::graphite::Resource skgpu::graphite::DawnTexture skgpu::graphite::MtlTexture skgpu::graphite::VulkanTexture

Public Member Functions

 ~Texture () override
 
int numSamples () const
 
Mipmapped mipmapped () const
 
SkISize dimensions () const
 
const TextureInfotextureInfo () const
 
void setReleaseCallback (sk_sp< RefCntedCallback >)
 
const char * getResourceType () const override
 
- Public Member Functions inherited from skgpu::graphite::Resource
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
Resourceoperator= (const Resource &)=delete
 
Resourceoperator= (Resource &&)=delete
 
void ref () const
 
void unref () const
 
void refCommandBuffer () const
 
void unrefCommandBuffer () const
 
Ownership ownership () const
 
skgpu::Budgeted budgeted () const
 
size_t gpuMemorySize () const
 
UniqueID uniqueID () const
 
virtual const char * getResourceType () const =0
 
std::string getLabel () const
 
void setLabel (std::string_view label)
 
bool wasDestroyed () const
 
const GraphiteResourceKeykey () const
 
void setKey (const GraphiteResourceKey &key)
 
void dumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump) const
 
virtual void prepareForReturnToCache (const std::function< void()> &takeRef)
 

Protected Member Functions

 Texture (const SharedContext *, SkISize dimensions, const TextureInfo &info, sk_sp< MutableTextureState > mutableState, Ownership, skgpu::Budgeted)
 
MutableTextureStatemutableState () const
 
void invokeReleaseProc () override
 
void onDumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump, const char *dumpName) const override
 
- Protected Member Functions inherited from skgpu::graphite::Resource
 Resource (const SharedContext *, Ownership, skgpu::Budgeted, size_t gpuMemorySize, bool commandBufferRefsAsUsageRefs=false)
 
virtual ~Resource ()
 
const SharedContextsharedContext () const
 
virtual void onDumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump, const char *dumpName) const
 
void setDeleteASAP ()
 

Detailed Description

Definition at line 24 of file Texture.h.

Constructor & Destructor Documentation

◆ ~Texture()

skgpu::graphite::Texture::~Texture ( )
override

Definition at line 30 of file Texture.cpp.

30{}

◆ Texture()

skgpu::graphite::Texture::Texture ( const SharedContext sharedContext,
SkISize  dimensions,
const TextureInfo info,
sk_sp< MutableTextureState mutableState,
Ownership  ownership,
skgpu::Budgeted  budgeted 
)
protected

Definition at line 19 of file Texture.cpp.

26 , fDimensions(dimensions)
27 , fInfo(info)
28 , fMutableState(std::move(mutableState)) {}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
skgpu::Budgeted budgeted() const
Definition: Resource.h:100
Resource(const Resource &)=delete
const SharedContext * sharedContext() const
Definition: Resource.h:189
Ownership ownership() const
Definition: Resource.h:98
SkISize dimensions() const
Definition: Texture.h:31
MutableTextureState * mutableState() const
Definition: Texture.cpp:44
size_t ComputeSize(SkISize dimensions, const TextureInfo &info)

Member Function Documentation

◆ dimensions()

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

Definition at line 31 of file Texture.h.

31{ return fDimensions; }

◆ getResourceType()

const char * skgpu::graphite::Texture::getResourceType ( ) const
inlineoverridevirtual

Implements skgpu::graphite::Resource.

Definition at line 36 of file Texture.h.

36{ return "Texture"; }

◆ invokeReleaseProc()

void skgpu::graphite::Texture::invokeReleaseProc ( )
overrideprotectedvirtual

Reimplemented from skgpu::graphite::Resource.

Definition at line 36 of file Texture.cpp.

36 {
37 if (fReleaseCallback) {
38 // Depending on the ref count of fReleaseCallback this may or may not actually trigger
39 // the ReleaseProc to be called.
40 fReleaseCallback.reset();
41 }
42}

◆ mipmapped()

Mipmapped skgpu::graphite::Texture::mipmapped ( ) const
inline

Definition at line 29 of file Texture.h.

29{ return fInfo.mipmapped(); }
Mipmapped mipmapped() const
Definition: TextureInfo.h:79

◆ mutableState()

MutableTextureState * skgpu::graphite::Texture::mutableState ( ) const
protected

Definition at line 44 of file Texture.cpp.

44{ return fMutableState.get(); }

◆ numSamples()

int skgpu::graphite::Texture::numSamples ( ) const
inline

Definition at line 28 of file Texture.h.

28{ return fInfo.numSamples(); }
uint32_t numSamples() const
Definition: TextureInfo.h:78

◆ onDumpMemoryStatistics()

void skgpu::graphite::Texture::onDumpMemoryStatistics ( SkTraceMemoryDump traceMemoryDump,
const char *  dumpName 
) const
overrideprotectedvirtual

Reimplemented from skgpu::graphite::Resource.

Definition at line 46 of file Texture.cpp.

47 {
48 SkString dimensionsStr;
49 dimensionsStr.printf("(%dx%d)", fDimensions.width(), fDimensions.height());
50 traceMemoryDump->dumpStringValue(dumpName, "dimensions", dimensionsStr.c_str());
51 traceMemoryDump->dumpStringValue(dumpName, "textureInfo", fInfo.toString().c_str());
52}
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534
const char * c_str() const
Definition: SkString.h:133
virtual void dumpStringValue(const char *, const char *, const char *)
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37

◆ setReleaseCallback()

void skgpu::graphite::Texture::setReleaseCallback ( sk_sp< RefCntedCallback releaseCallback)

Definition at line 32 of file Texture.cpp.

32 {
33 fReleaseCallback = std::move(releaseCallback);
34}

◆ textureInfo()

const TextureInfo & skgpu::graphite::Texture::textureInfo ( ) const
inline

Definition at line 32 of file Texture.h.

32{ return fInfo; }

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