Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
skgpu::graphite::DawnSharedContext Class Referencefinal

#include <DawnSharedContext.h>

Inheritance diagram for skgpu::graphite::DawnSharedContext:
skgpu::graphite::SharedContext SkRefCnt SkRefCntBase

Public Member Functions

 ~DawnSharedContext () override
 
std::unique_ptr< ResourceProvidermakeResourceProvider (SingleOwner *, uint32_t recorderID, size_t resourceBudget) override
 
const DawnCapsdawnCaps () const
 
const wgpu::Device & device () const
 
const wgpu::Queue & queue () const
 
const wgpu::ShaderModule & noopFragment () const
 
bool hasTick () const
 
void tick () const
 
- Public Member Functions inherited from skgpu::graphite::SharedContext
 ~SharedContext () override
 
const Capscaps () const
 
BackendApi backend () const
 
Protected isProtected () const
 
GlobalCacheglobalCache ()
 
const GlobalCacheglobalCache () const
 
const RendererProviderrendererProvider () const
 
ShaderCodeDictionaryshaderCodeDictionary ()
 
const ShaderCodeDictionaryshaderCodeDictionary () const
 
virtual bool isDeviceLost () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< SharedContextMake (const DawnBackendContext &, const ContextOptions &)
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::graphite::SharedContext
 SharedContext (std::unique_ptr< const Caps >, BackendApi)
 

Detailed Description

Definition at line 22 of file DawnSharedContext.h.

Constructor & Destructor Documentation

◆ ~DawnSharedContext()

skgpu::graphite::DawnSharedContext::~DawnSharedContext ( )
override

Definition at line 60 of file DawnSharedContext.cpp.

60 {
61 // need to clear out resources before any allocator is removed
63}

Member Function Documentation

◆ dawnCaps()

const DawnCaps * skgpu::graphite::DawnSharedContext::dawnCaps ( ) const
inline

Definition at line 31 of file DawnSharedContext.h.

31{ return static_cast<const DawnCaps*>(this->caps()); }
const Caps * caps() const

◆ device()

const wgpu::Device & skgpu::graphite::DawnSharedContext::device ( ) const
inline

Definition at line 32 of file DawnSharedContext.h.

32{ return fDevice; }

◆ hasTick()

bool skgpu::graphite::DawnSharedContext::hasTick ( ) const
inline

Definition at line 36 of file DawnSharedContext.h.

36{ return fTick; }

◆ Make()

sk_sp< SharedContext > skgpu::graphite::DawnSharedContext::Make ( const DawnBackendContext backendContext,
const ContextOptions options 
)
static

Definition at line 32 of file DawnSharedContext.cpp.

33 {
34 if (!backendContext.fDevice || !backendContext.fQueue) {
35 return {};
36 }
37
38 auto noopFragment = CreateNoopFragment(backendContext.fDevice);
39 if (!noopFragment) {
40 return {};
41 }
42
43 auto caps = std::make_unique<const DawnCaps>(backendContext, options);
44
45 return sk_sp<SharedContext>(new DawnSharedContext(backendContext,
46 std::move(caps),
47 std::move(noopFragment)));
48}
const char * options
const wgpu::ShaderModule & noopFragment() const

◆ makeResourceProvider()

std::unique_ptr< ResourceProvider > skgpu::graphite::DawnSharedContext::makeResourceProvider ( SingleOwner singleOwner,
uint32_t  recorderID,
size_t  resourceBudget 
)
overridevirtual

Implements skgpu::graphite::SharedContext.

Definition at line 65 of file DawnSharedContext.cpp.

68 {
69 return std::unique_ptr<ResourceProvider>(new DawnResourceProvider(this,
70 singleOwner,
71 recorderID,
72 resourceBudget));
73}

◆ noopFragment()

const wgpu::ShaderModule & skgpu::graphite::DawnSharedContext::noopFragment ( ) const
inline

Definition at line 34 of file DawnSharedContext.h.

34{ return fNoopFragment; }

◆ queue()

const wgpu::Queue & skgpu::graphite::DawnSharedContext::queue ( ) const
inline

Definition at line 33 of file DawnSharedContext.h.

33{ return fQueue; }

◆ tick()

void skgpu::graphite::DawnSharedContext::tick ( ) const
inline

Definition at line 38 of file DawnSharedContext.h.

38 {
39 SkASSERT(this->hasTick());
40 fTick(fInstance);
41 }
#define SkASSERT(cond)
Definition SkAssert.h:116

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