Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::gpu::CommandBuffer Class Reference

#include <command_buffer.h>

Inheritance diagram for flutter::gpu::CommandBuffer:
flutter::RefCountedDartWrappable< CommandBuffer > fml::RefCountedThreadSafe< CommandBuffer > tonic::DartWrappable fml::internal::RefCountedThreadSafeBase

Public Member Functions

 CommandBuffer (std::shared_ptr< impeller::Context > context, std::shared_ptr< impeller::CommandBuffer > command_buffer)
 
std::shared_ptr< impeller::CommandBufferGetCommandBuffer ()
 
void AddRenderPass (std::shared_ptr< impeller::RenderPass > render_pass)
 
bool Submit ()
 
bool Submit (const impeller::CommandBuffer::CompletionCallback &completion_callback)
 
 ~CommandBuffer () override
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< CommandBuffer >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< CommandBuffer >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 
- Public Member Functions inherited from tonic::DartWrappable
 DartWrappable ()
 
virtual const DartWrapperInfoGetDartWrapperInfo () const =0
 
virtual void RetainDartWrappableReference () const =0
 
virtual void ReleaseDartWrappableReference () const =0
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Additional Inherited Members

- Public Types inherited from tonic::DartWrappable
enum  DartNativeFields { kPeerIndex , kNumberOfNativeFields }
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< CommandBuffer >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 
- Protected Member Functions inherited from tonic::DartWrappable
virtual ~DartWrappable ()
 
- Static Protected Member Functions inherited from tonic::DartWrappable
static Dart_PersistentHandle GetTypeForWrapper (tonic::DartState *dart_state, const tonic::DartWrapperInfo &wrapper_info)
 

Detailed Description

Definition at line 16 of file command_buffer.h.

Constructor & Destructor Documentation

◆ CommandBuffer()

flutter::gpu::CommandBuffer::CommandBuffer ( std::shared_ptr< impeller::Context context,
std::shared_ptr< impeller::CommandBuffer command_buffer 
)

Definition at line 19 of file command_buffer.cc.

22 : context_(std::move(context)),
23 command_buffer_(std::move(command_buffer)) {}

◆ ~CommandBuffer()

flutter::gpu::CommandBuffer::~CommandBuffer ( )
overridedefault

Member Function Documentation

◆ AddRenderPass()

void flutter::gpu::CommandBuffer::AddRenderPass ( std::shared_ptr< impeller::RenderPass render_pass)

Definition at line 31 of file command_buffer.cc.

32 {
33 encodables_.push_back(std::move(render_pass));
34}

◆ GetCommandBuffer()

std::shared_ptr< impeller::CommandBuffer > flutter::gpu::CommandBuffer::GetCommandBuffer ( )

Definition at line 27 of file command_buffer.cc.

27 {
28 return command_buffer_;
29}

◆ Submit() [1/2]

bool flutter::gpu::CommandBuffer::Submit ( )

Definition at line 36 of file command_buffer.cc.

36 {
37 for (auto& encodable : encodables_) {
38 encodable->EncodeCommands();
39 }
40
41 return context_->GetCommandQueue()->Submit({command_buffer_}).ok();
42}
static bool ok(int result)

◆ Submit() [2/2]

bool flutter::gpu::CommandBuffer::Submit ( const impeller::CommandBuffer::CompletionCallback completion_callback)

Definition at line 44 of file command_buffer.cc.

45 {
46 for (auto& encodable : encodables_) {
47 encodable->EncodeCommands();
48 }
49 return context_->GetCommandQueue()
50 ->Submit({command_buffer_}, completion_callback)
51 .ok();
52}

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