card: fix compile warning
[android/external-libkmsxx.git] / kms++util / src / extcpuframebuffer.cpp
2 #include <kms++util/kms++util.h>
4 using namespace std;
6 namespace kms
7 {
9 ExtCPUFramebuffer::ExtCPUFramebuffer(uint32_t width, uint32_t height, PixelFormat format,
10                                      uint8_t* buffer, uint32_t size, uint32_t pitch, uint32_t offset)
11         : m_width(width), m_height(height), m_format(format)
12 {
13         const PixelFormatInfo& format_info = get_pixel_format_info(m_format);
15         m_num_planes = format_info.num_planes;
17         ASSERT(m_num_planes == 1);
19         FramebufferPlane& plane = m_planes[0];
21         plane.stride = pitch;
22         plane.size = size;
23         plane.offset = offset;
24         plane.map = buffer;
25 }
27 ExtCPUFramebuffer::ExtCPUFramebuffer(uint32_t width, uint32_t height, PixelFormat format,
28                                      uint8_t* buffers[4], uint32_t sizes[4], uint32_t pitches[4], uint32_t offsets[4])
29         : m_width(width), m_height(height), m_format(format)
30 {
31         const PixelFormatInfo& format_info = get_pixel_format_info(m_format);
33         m_num_planes = format_info.num_planes;
35         for (unsigned i = 0; i < format_info.num_planes; ++i) {
36                 FramebufferPlane& plane = m_planes[i];
38                 plane.stride = pitches[i];
39                 plane.size = sizes[i];
40                 plane.offset = offsets[i];
41                 plane.map = buffers[i];
42         }
43 }
45 ExtCPUFramebuffer::~ExtCPUFramebuffer()
46 {
47 }
49 }