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

#include <device_buffer.h>

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

Public Member Functions

 DeviceBuffer (std::shared_ptr< impeller::DeviceBuffer > device_buffer)
 
 ~DeviceBuffer () override
 
std::shared_ptr< impeller::DeviceBufferGetBuffer ()
 
bool Overwrite (const tonic::DartByteData &source_bytes, size_t destination_offset_in_bytes)
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< DeviceBuffer >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< DeviceBuffer >
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< DeviceBuffer >
 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 17 of file device_buffer.h.

Constructor & Destructor Documentation

◆ DeviceBuffer()

flutter::gpu::DeviceBuffer::DeviceBuffer ( std::shared_ptr< impeller::DeviceBuffer device_buffer)
explicit

Definition at line 23 of file device_buffer.cc.

25 : device_buffer_(std::move(device_buffer)) {}

◆ ~DeviceBuffer()

flutter::gpu::DeviceBuffer::~DeviceBuffer ( )
overridedefault

Member Function Documentation

◆ GetBuffer()

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

Definition at line 29 of file device_buffer.cc.

29 {
30 return device_buffer_;
31}

◆ Overwrite()

bool flutter::gpu::DeviceBuffer::Overwrite ( const tonic::DartByteData source_bytes,
size_t  destination_offset_in_bytes 
)

Definition at line 33 of file device_buffer.cc.

34 {
35 if (!device_buffer_->CopyHostBuffer(
36 reinterpret_cast<const uint8_t*>(source_bytes.data()),
37 impeller::Range(0, source_bytes.length_in_bytes()),
38 destination_offset_in_bytes)) {
39 return false;
40 }
41 return true;
42}
const void * data() const
size_t length_in_bytes() const

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