diff options
Diffstat (limited to 'libkms++')
-rw-r--r-- | libkms++/dumbframebuffer.h | 5 | ||||
-rw-r--r-- | libkms++/framebuffer.h | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/libkms++/dumbframebuffer.h b/libkms++/dumbframebuffer.h index 226a8dc..6b3ee64 100644 --- a/libkms++/dumbframebuffer.h +++ b/libkms++/dumbframebuffer.h @@ -5,13 +5,16 @@ namespace kms { -class DumbFramebuffer : public Framebuffer +class DumbFramebuffer : public Framebuffer, public IMappedFramebuffer { public: DumbFramebuffer(Card& card, uint32_t width, uint32_t height, const std::string& fourcc); DumbFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format); virtual ~DumbFramebuffer(); + uint32_t width() const { return Framebuffer::width(); } + uint32_t height() const { return Framebuffer::height(); } + PixelFormat format() const { return m_format; } unsigned num_planes() const { return m_num_planes; } diff --git a/libkms++/framebuffer.h b/libkms++/framebuffer.h index 77a6c32..25659c6 100644 --- a/libkms++/framebuffer.h +++ b/libkms++/framebuffer.h @@ -1,6 +1,7 @@ #pragma once #include "drmobject.h" +#include "pixelformats.h" namespace kms { @@ -19,4 +20,21 @@ private: uint32_t m_width; uint32_t m_height; }; + +class IMappedFramebuffer { +public: + virtual ~IMappedFramebuffer() { } + + virtual uint32_t width() const = 0; + virtual uint32_t height() const = 0; + + virtual PixelFormat format() const = 0; + virtual unsigned num_planes() const = 0; + + virtual uint32_t stride(unsigned plane) const = 0; + virtual uint32_t size(unsigned plane) const = 0; + virtual uint32_t offset(unsigned plane) const = 0; + virtual uint8_t* map(unsigned plane) = 0; +}; + } |