summaryrefslogtreecommitdiff
path: root/kms++util/src/testpat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kms++util/src/testpat.cpp')
-rw-r--r--kms++util/src/testpat.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp
index f9a3c8a..c120de3 100644
--- a/kms++util/src/testpat.cpp
+++ b/kms++util/src/testpat.cpp
@@ -106,6 +106,7 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned
unsigned w = fb.width();
const PixelFormatInfo& format_info = get_pixel_format_info(fb.format());
+ const PixelFormatPlaneInfo& plane_info = format_info.planes[format_info.num_planes - 1];
switch (format_info.type) {
case PixelColorType::RGB:
@@ -118,8 +119,8 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned
break;
case PixelColorType::YUV:
- switch (format_info.num_planes) {
- case 1:
+ switch (plane_info.xsub + plane_info.ysub) {
+ case 3:
for (y = start_y; y < end_y; y++) {
for (x = 0; x < w; x += 2) {
RGB pixel1 = get_test_pattern_pixel(fb, x, y);
@@ -129,7 +130,7 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned
}
break;
- case 2:
+ case 4:
for (y = start_y; y < end_y; y += 2) {
for (x = 0; x < w; x += 2) {
RGB pixel00 = get_test_pattern_pixel(fb, x, y);