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

#include <host_buffer.h>

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

Public Member Functions

 HostBuffer (Context *context)
 
 ~HostBuffer () override
 
std::shared_ptr< impeller::HostBufferGetBuffer ()
 
size_t EmplaceBytes (const tonic::DartByteData &byte_data)
 
std::optional< impeller::BufferViewGetBufferViewForOffset (size_t offset)
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< HostBuffer >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< HostBuffer >
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< HostBuffer >
 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 18 of file host_buffer.h.

Constructor & Destructor Documentation

◆ HostBuffer()

flutter::gpu::HostBuffer::HostBuffer ( Context context)
explicit

Definition at line 19 of file host_buffer.cc.

20 : host_buffer_(impeller::HostBuffer::Create(
21 context->GetContext()->GetResourceAllocator())) {}
static std::shared_ptr< HostBuffer > Create(const std::shared_ptr< Allocator > &allocator)
Definition: host_buffer.cc:20

◆ ~HostBuffer()

flutter::gpu::HostBuffer::~HostBuffer ( )
overridedefault

Member Function Documentation

◆ EmplaceBytes()

size_t flutter::gpu::HostBuffer::EmplaceBytes ( const tonic::DartByteData byte_data)

Definition at line 29 of file host_buffer.cc.

29 {
30 auto view =
31 host_buffer_->Emplace(byte_data.data(), byte_data.length_in_bytes(),
33 emplacements_[current_offset_] = view;
34 size_t previous_offset = current_offset_;
35 current_offset_ += view.range.length;
36 return previous_offset;
37}
const void * data() const
size_t length_in_bytes() const
constexpr size_t DefaultUniformAlignment()
Definition: platform.h:14
SeparatedVector2 previous_offset

◆ GetBuffer()

std::shared_ptr< impeller::HostBuffer > flutter::gpu::HostBuffer::GetBuffer ( )

Definition at line 25 of file host_buffer.cc.

25 {
26 return host_buffer_;
27}

◆ GetBufferViewForOffset()

std::optional< impeller::BufferView > flutter::gpu::HostBuffer::GetBufferViewForOffset ( size_t  offset)

Definition at line 39 of file host_buffer.cc.

40 {
41 return emplacements_[offset];
42}
SeparatedVector2 offset

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