Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
BenchResource Class Reference
Inheritance diagram for BenchResource:
GrGpuResource GrIORef< GrGpuResource > SkNoncopyable

Public Member Functions

 BenchResource (GrGpu *gpu, std::string_view label)
 
- Public Member Functions inherited from GrGpuResource
bool wasDestroyed () const
 
const GrDirectContextgetContext () const
 
GrDirectContextgetContext ()
 
size_t gpuMemorySize () const
 
UniqueID uniqueID () const
 
const skgpu::UniqueKeygetUniqueKey () const
 
std::string getLabel () const
 
void setLabel (std::string_view label)
 
CacheAccess cacheAccess ()
 
const CacheAccess cacheAccess () const
 
ProxyAccess proxyAccess ()
 
ResourcePriv resourcePriv ()
 
const ResourcePriv resourcePriv () const
 
virtual void dumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump) const
 
- Public Member Functions inherited from GrIORef< GrGpuResource >
bool unique () const
 
void ref () const
 
void unref () const
 
void refCommandBuffer () const
 
void unrefCommandBuffer () const
 
- Public Member Functions inherited from SkNoncopyable
 SkNoncopyable ()=default
 
 SkNoncopyable (SkNoncopyable &&)=default
 
SkNoncopyableoperator= (SkNoncopyable &&)=default
 

Static Public Member Functions

static void ComputeKey (int i, int keyData32Count, skgpu::UniqueKey *key)
 
- Static Public Member Functions inherited from GrGpuResource
static uint32_t CreateUniqueID ()
 

Private Member Functions

size_t onGpuMemorySize () const override
 
void onSetLabel () override
 
const char * getResourceType () const override
 

Additional Inherited Members

- Public Types inherited from GrIORef< GrGpuResource >
enum  LastRemovedRef
 
- Protected Member Functions inherited from GrGpuResource
void registerWithCache (skgpu::Budgeted)
 
void registerWithCacheWrapped (GrWrapCacheable)
 
 GrGpuResource (GrGpu *, std::string_view label)
 
virtual ~GrGpuResource ()
 
GrGpugetGpu () const
 
virtual void onRelease ()
 
virtual void onAbandon ()
 
virtual void setMemoryBacking (SkTraceMemoryDump *, const SkString &) const
 
SkString getResourceName () const
 
void dumpMemoryStatisticsPriv (SkTraceMemoryDump *traceMemoryDump, const SkString &resourceName, const char *type, size_t size) const
 
- Protected Member Functions inherited from GrIORef< GrGpuResource >
 GrIORef ()
 
bool internalHasRef () const
 
bool internalHasNoCommandBufferUsages () const
 
void addInitialRef () const
 

Detailed Description

Definition at line 22 of file GrResourceCacheBench.cpp.

Constructor & Destructor Documentation

◆ BenchResource()

BenchResource::BenchResource ( GrGpu gpu,
std::string_view  label 
)
inline

Definition at line 24 of file GrResourceCacheBench.cpp.

25 : INHERITED(gpu, label) {
27 }
void registerWithCache(skgpu::Budgeted)

Member Function Documentation

◆ ComputeKey()

static void BenchResource::ComputeKey ( int  i,
int  keyData32Count,
skgpu::UniqueKey key 
)
inlinestatic

Definition at line 29 of file GrResourceCacheBench.cpp.

29 {
31 skgpu::UniqueKey::Builder builder(key, kDomain, keyData32Count);
32 for (int j = 0; j < keyData32Count; ++j) {
33 builder[j] = i + j;
34 }
35 }
static Domain GenerateDomain()

◆ getResourceType()

const char * BenchResource::getResourceType ( ) const
inlineoverrideprivatevirtual

Describes the type of gpu resource that is represented by the implementing class (e.g. texture, buffer object, stencil). This data is used for diagnostic purposes by dumpMemoryStatistics().

The value returned is expected to be long lived and will not be copied by the caller.

Implements GrGpuResource.

Definition at line 40 of file GrResourceCacheBench.cpp.

40{ return "bench"; }

◆ onGpuMemorySize()

size_t BenchResource::onGpuMemorySize ( ) const
inlineoverrideprivatevirtual

Implements GrGpuResource.

Definition at line 38 of file GrResourceCacheBench.cpp.

38{ return 100; }

◆ onSetLabel()

void BenchResource::onSetLabel ( )
inlineoverrideprivatevirtual

Implements GrGpuResource.

Definition at line 39 of file GrResourceCacheBench.cpp.

39{}

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