Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
impeller::TestImpellerDeviceBuffer Class Reference

#include <image_decoder_no_gl_unittests.h>

Inheritance diagram for impeller::TestImpellerDeviceBuffer:
impeller::DeviceBuffer

Public Member Functions

 TestImpellerDeviceBuffer (DeviceBufferDescriptor desc)
 
 ~TestImpellerDeviceBuffer ()
 
- Public Member Functions inherited from impeller::DeviceBuffer
virtual ~DeviceBuffer ()
 
bool CopyHostBuffer (const uint8_t *source, Range source_range, size_t offset=0u)
 
const DeviceBufferDescriptorGetDeviceBufferDescriptor () const
 
virtual void Flush (std::optional< Range > range=std::nullopt) const
 
virtual void Invalidate (std::optional< Range > range=std::nullopt) const
 

Private Member Functions

std::shared_ptr< TextureAsTexture (Allocator &allocator, const TextureDescriptor &descriptor, uint16_t row_bytes) const override
 
bool SetLabel (const std::string &label) override
 
bool SetLabel (const std::string &label, Range range) override
 
uint8_t * OnGetContents () const override
 
bool OnCopyHostBuffer (const uint8_t *source, Range source_range, size_t offset) override
 

Additional Inherited Members

- Static Public Member Functions inherited from impeller::DeviceBuffer
static BufferView AsBufferView (std::shared_ptr< DeviceBuffer > buffer)
 Create a buffer view of this entire buffer.
 
- Protected Member Functions inherited from impeller::DeviceBuffer
 DeviceBuffer (DeviceBufferDescriptor desc)
 
- Protected Attributes inherited from impeller::DeviceBuffer
const DeviceBufferDescriptor desc_
 

Detailed Description

Definition at line 37 of file image_decoder_no_gl_unittests.h.

Constructor & Destructor Documentation

◆ TestImpellerDeviceBuffer()

impeller::TestImpellerDeviceBuffer::TestImpellerDeviceBuffer ( DeviceBufferDescriptor  desc)
inlineexplicit

Definition at line 39 of file image_decoder_no_gl_unittests.h.

40 : DeviceBuffer(desc) {
41 bytes_ = static_cast<uint8_t*>(malloc(desc.size));
42 }
DeviceBuffer(DeviceBufferDescriptor desc)
void * malloc(size_t size)
Definition allocation.cc:19

◆ ~TestImpellerDeviceBuffer()

impeller::TestImpellerDeviceBuffer::~TestImpellerDeviceBuffer ( )
inline

Definition at line 44 of file image_decoder_no_gl_unittests.h.

44{ free(bytes_); }

Member Function Documentation

◆ AsTexture()

std::shared_ptr< Texture > impeller::TestImpellerDeviceBuffer::AsTexture ( Allocator allocator,
const TextureDescriptor descriptor,
uint16_t  row_bytes 
) const
inlineoverrideprivatevirtual

Reimplemented from impeller::DeviceBuffer.

Definition at line 47 of file image_decoder_no_gl_unittests.h.

49 {
50 return nullptr;
51 }

◆ OnCopyHostBuffer()

bool impeller::TestImpellerDeviceBuffer::OnCopyHostBuffer ( const uint8_t *  source,
Range  source_range,
size_t  offset 
)
inlineoverrideprivatevirtual

Implements impeller::DeviceBuffer.

Definition at line 59 of file image_decoder_no_gl_unittests.h.

61 {
62 for (auto i = source_range.offset; i < source_range.length; i++, offset++) {
63 bytes_[offset] = source[i];
64 }
65 return true;
66 }
SkBitmap source
Definition examples.cpp:28
Point offset

◆ OnGetContents()

uint8_t * impeller::TestImpellerDeviceBuffer::OnGetContents ( ) const
inlineoverrideprivatevirtual

Implements impeller::DeviceBuffer.

Definition at line 57 of file image_decoder_no_gl_unittests.h.

57{ return bytes_; }

◆ SetLabel() [1/2]

bool impeller::TestImpellerDeviceBuffer::SetLabel ( const std::string &  label)
inlineoverrideprivatevirtual

Implements impeller::DeviceBuffer.

Definition at line 53 of file image_decoder_no_gl_unittests.h.

53{ return true; }

◆ SetLabel() [2/2]

bool impeller::TestImpellerDeviceBuffer::SetLabel ( const std::string &  label,
Range  range 
)
inlineoverrideprivatevirtual

Implements impeller::DeviceBuffer.

Definition at line 55 of file image_decoder_no_gl_unittests.h.

55{ return true; }

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