Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
skgpu::graphite::TestResource Class Reference
Inheritance diagram for skgpu::graphite::TestResource:
skgpu::graphite::Resource

Public Member Functions

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)
 

Static Public Member Functions

static sk_sp< TestResourceMake (const SharedContext *sharedContext, Ownership owned, skgpu::Budgeted budgeted, Shareable shareable, size_t gpuMemorySize=1)
 
static void CreateKey (GraphiteResourceKey *key, Shareable shareable)
 

Additional Inherited Members

- 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 37 of file GraphiteResourceCacheTest.cpp.

Member Function Documentation

◆ CreateKey()

static void skgpu::graphite::TestResource::CreateKey ( GraphiteResourceKey key,
Shareable  shareable 
)
inlinestatic

Definition at line 61 of file GraphiteResourceCacheTest.cpp.

61 {
62 // Internally we assert that we don't make the same key twice where the only difference is
63 // shareable vs non-shareable. That allows us to now have Shareable be part of the Key's
64 // key. So here we make two different resource types so the keys will be different.
66 static const ResourceType kShareableType = GraphiteResourceKey::GenerateResourceType();
67 ResourceType type = shareable == Shareable::kNo ? kType : kShareableType;
69 }
GLenum type
const GraphiteResourceKey & key() const
Definition: Resource.h:156
DlVertices::Builder Builder
uint32_t ResourceType

◆ getResourceType()

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

Implements skgpu::graphite::Resource.

Definition at line 59 of file GraphiteResourceCacheTest.cpp.

59{ return "Test Resource"; }

◆ Make()

static sk_sp< TestResource > skgpu::graphite::TestResource::Make ( const SharedContext sharedContext,
Ownership  owned,
skgpu::Budgeted  budgeted,
Shareable  shareable,
size_t  gpuMemorySize = 1 
)
inlinestatic

Definition at line 39 of file GraphiteResourceCacheTest.cpp.

43 {
45 owned,
48 if (!resource) {
49 return nullptr;
50 }
51
52 GraphiteResourceKey key;
53 CreateKey(&key, shareable);
54
55 resource->setKey(key);
56 return resource;
57 }
static SkString resource(SkPDFResourceType type, int index)
skgpu::Budgeted budgeted() const
Definition: Resource.h:100
size_t gpuMemorySize() const
Definition: Resource.h:104
const SharedContext * sharedContext() const
Definition: Resource.h:189
static void CreateKey(GraphiteResourceKey *key, Shareable shareable)

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