Add MappedFramebuffer
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 23 Sep 2016 12:32:29 +0000 (15:32 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 21 Nov 2016 16:20:14 +0000 (18:20 +0200)
Add a base MappedFramebuffer class, which inherits Framebuffer and
implements IMappedFramebuffer.  This helps to implement platform
specific framebuffer classes, like OmapFramebuffer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
kms++/inc/kms++/dumbframebuffer.h
kms++/inc/kms++/kms++.h
kms++/inc/kms++/mappedframebuffer.h [new file with mode: 0644]
kms++/src/dumbframebuffer.cpp
kms++/src/mappedframebuffer.cpp [new file with mode: 0644]

index 6b3ee648c4987c3fc890dde8b35473d650da5880..15d25d105af4485e8bbaa651f8933313539052f3 100644 (file)
@@ -1,11 +1,12 @@
 #pragma once
 
-#include "framebuffer.h"
+#include "mappedframebuffer.h"
 #include "pixelformats.h"
 
 namespace kms
 {
-class DumbFramebuffer : public Framebuffer, public IMappedFramebuffer
+
+class DumbFramebuffer : public MappedFramebuffer
 {
 public:
        DumbFramebuffer(Card& card, uint32_t width, uint32_t height, const std::string& fourcc);
index 3365ef7bb77430face1174614f9c075f4d6f4a75..6fc6977db9e5b3ac19e74ae6877b9761261d471b 100644 (file)
@@ -8,6 +8,7 @@
 #include "framebuffer.h"
 #include "dumbframebuffer.h"
 #include "extframebuffer.h"
+#include "mappedframebuffer.h"
 #include "plane.h"
 #include "property.h"
 #include "blob.h"
diff --git a/kms++/inc/kms++/mappedframebuffer.h b/kms++/inc/kms++/mappedframebuffer.h
new file mode 100644 (file)
index 0000000..ed3bc69
--- /dev/null
@@ -0,0 +1,21 @@
+#pragma once
+
+namespace kms
+{
+
+class MappedFramebuffer : public Framebuffer, public IMappedFramebuffer
+{
+public:
+       virtual ~MappedFramebuffer() { }
+
+protected:
+       MappedFramebuffer(Card& card, uint32_t id);
+       MappedFramebuffer(Card& card, uint32_t width, uint32_t height);
+
+public:
+       virtual uint32_t width() const = 0;
+       virtual uint32_t height() const = 0;
+
+};
+
+}
index b21e8ff0072e6fce3fbf0634311d6d40552455d9..9de7ee1cc960557e48edfd82ff603d91cb927a27 100644 (file)
@@ -25,7 +25,7 @@ DumbFramebuffer::DumbFramebuffer(Card &card, uint32_t width, uint32_t height, co
 }
 
 DumbFramebuffer::DumbFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format)
-       :Framebuffer(card, width, height), m_format(format)
+       :MappedFramebuffer(card, width, height), m_format(format)
 {
        Create();
 }
diff --git a/kms++/src/mappedframebuffer.cpp b/kms++/src/mappedframebuffer.cpp
new file mode 100644 (file)
index 0000000..21e082f
--- /dev/null
@@ -0,0 +1,20 @@
+#include <kms++/kms++.h>
+
+using namespace std;
+
+namespace kms
+{
+
+MappedFramebuffer::MappedFramebuffer(Card& card, uint32_t id)
+       : Framebuffer(card, id)
+{
+
+}
+
+MappedFramebuffer::MappedFramebuffer(Card& card, uint32_t width, uint32_t height)
+       : Framebuffer(card, width, height)
+{
+
+}
+
+}