|
Ream v0.1.0-1
C++ graphics library for Linux
|
A DRM dumb buffer for software (CPU) rendering. More...
#include <RDumbBuffer.h>
Inheritance diagram for RDumbBuffer:Public Member Functions | |
| ~RDumbBuffer () noexcept | |
| Unmaps and destroys the underlying dumb buffer. | |
| std::shared_ptr< RCore > | core () const noexcept |
| Returns the internal shared reference to the core instance. | |
| std::shared_ptr< RDRMFramebuffer > | fb () const noexcept |
| Returns the DRM framebuffer wrapping this dumb buffer, for KMS scanout. | |
| SkISize | size () const noexcept |
| Returns the width and height of the buffer in pixels. | |
| const RFormatInfo & | formatInfo () const noexcept |
| Returns detailed information about the buffer's DRM format. | |
| RDevice * | allocator () const noexcept |
| Returns the DRM device that allocated this buffer. | |
| UInt32 | handle () const noexcept |
| Returns the GEM handle of the dumb buffer, valid on the allocator device. | |
| UInt32 | stride () const noexcept |
| Returns the buffer stride (bytes per row). | |
| UInt8 * | pixels () const noexcept |
| Returns a pointer to the mapped, CPU-accessible pixel data. | |
Public Member Functions inherited from RObject | |
| RObject ()=default | |
| Constructs a default RObject. | |
Static Public Member Functions | |
| static std::shared_ptr< RDumbBuffer > | Make (SkISize size, const RDRMFormat &format, RDevice *allocator=nullptr) noexcept |
| Creates and maps a DRM dumb buffer. | |
A DRM dumb buffer for software (CPU) rendering.
Wraps a DRM dumb buffer (drmModeCreateDumbBuffer), a simple CPU-accessible buffer suitable for software rendering and scanout on devices without GPU acceleration. The buffer is mapped into the process address space (via mmap) so its pixels can be read and written directly, and it is also wrapped in an RDRMFramebuffer so it can be presented via KMS.
Dumb buffers only support the DRM_FORMAT_MOD_INVALID or DRM_FORMAT_MOD_LINEAR modifier, and only single-block (1x1 pixel-per-block) formats. The allocating device must advertise the DumbBuffer capability.
Use Make() to create an instance.
|
noexcept |
Unmaps and destroys the underlying dumb buffer.
|
staticnoexcept |
Creates and maps a DRM dumb buffer.
| size | The width and height of the buffer in pixels; must be non-empty. |
| format | The DRM format and modifiers. The modifier set must contain DRM_FORMAT_MOD_INVALID or DRM_FORMAT_MOD_LINEAR, and the format must be a supported single-block (1x1) format. |
| allocator | The DRM device to allocate on. If nullptr, RCore::mainDevice() is used. Must support the DumbBuffer capability. |
|
inlinenoexcept |
Returns the internal shared reference to the core instance.
This ensures the current RCore instance stays alive while the buffer exists.
|
noexcept |
Returns the DRM framebuffer wrapping this dumb buffer, for KMS scanout.
|
inlinenoexcept |
Returns the width and height of the buffer in pixels.
|
inlinenoexcept |
Returns detailed information about the buffer's DRM format.
|
inlinenoexcept |
Returns the DRM device that allocated this buffer.
|
inlinenoexcept |
Returns the GEM handle of the dumb buffer, valid on the allocator device.
|
inlinenoexcept |
Returns the buffer stride (bytes per row).
|
inlinenoexcept |
Returns a pointer to the mapped, CPU-accessible pixel data.
The mapping is read/write and remains valid for the lifetime of this object.