]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/commitdiff
add PixelFormat support to DumbFramebuffer
authorTomi Valkeinen <tomi.valkeinen@iki.fi>
Sat, 3 Oct 2015 20:26:58 +0000 (23:26 +0300)
committerTomi Valkeinen <tomi.valkeinen@iki.fi>
Sun, 4 Oct 2015 07:21:56 +0000 (10:21 +0300)
libkms++/dumbframebuffer.cpp
libkms++/dumbframebuffer.h

index 0defd3a19932e8d0d6d240dd4290e1e8240997c2..abea762955744a06905f235a0202828f779841dd 100644 (file)
@@ -18,17 +18,14 @@ namespace kms
 {
 
 DumbFramebuffer::DumbFramebuffer(Card &card, uint32_t width, uint32_t height, const string& fourcc)
-       :Framebuffer(card, width, height)
+       :DumbFramebuffer(card, width, height, FourCCToPixelFormat(fourcc))
 {
-       uint32_t a, b, c, d;
-       a = fourcc[0];
-       b = fourcc[1];
-       c = fourcc[2];
-       d = fourcc[3];
-
-       uint32_t code = ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24));
+}
 
-       Create(width, height, code);
+DumbFramebuffer::DumbFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format)
+       :Framebuffer(card, width, height)
+{
+       Create(width, height, (uint32_t)format);
 }
 
 DumbFramebuffer::~DumbFramebuffer()
index 24e791aad9eadd3441d1342ebcf463a24e21df06..25a3c2e83f9ff2f64bc8e59c944fdf08ed899166 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "framebuffer.h"
+#include "pixelformats.h"
 
 namespace kms
 {
@@ -8,6 +9,7 @@ class DumbFramebuffer : public Framebuffer
 {
 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();
 
        void print_short() const;