diff options
Diffstat (limited to 'kms++util/src')
| -rw-r--r-- | kms++util/src/cpuframebuffer.cpp | 5 | ||||
| -rw-r--r-- | kms++util/src/testpat.cpp | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/kms++util/src/cpuframebuffer.cpp b/kms++util/src/cpuframebuffer.cpp index c3bc248..8eac8c4 100644 --- a/kms++util/src/cpuframebuffer.cpp +++ b/kms++util/src/cpuframebuffer.cpp @@ -14,11 +14,10 @@ CPUFramebuffer::CPUFramebuffer(uint32_t width, uint32_t height, PixelFormat form m_num_planes = format_info.num_planes; for (unsigned i = 0; i < format_info.num_planes; ++i) { - const PixelFormatPlaneInfo& pi = format_info.planes[i]; FramebufferPlane& plane = m_planes[i]; - plane.stride = width * pi.bitspp / 8; - plane.size = plane.stride * height / pi.ysub; + plane.stride = format_info.stride(width, i); + plane.size = format_info.planesize(plane.stride, height, i); plane.offset = 0; plane.map = new uint8_t[plane.size]; } diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp index 7699243..029684a 100644 --- a/kms++util/src/testpat.cpp +++ b/kms++util/src/testpat.cpp @@ -118,7 +118,7 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned break; case PixelColorType::YUV: - switch (plane_info.xsub + plane_info.ysub) { + switch (plane_info.hsub + plane_info.vsub) { case 2: for (y = start_y; y < end_y; y++) { for (x = 0; x < w; x++) { |
