Ticket #12611: 0001-also-print-color-space-and-overlay-support-status.patch

File 0001-also-print-color-space-and-overlay-support-status.patch, 1.3 KB (added by hypgci, 5 years ago)
  • src/bin/screeninfo.cpp

    From be325080ab8940ffed789e5ce36837c79ebb65c3 Mon Sep 17 00:00:00 2001
    From: Hannah <hypgci@gmail.com>
    Date: Sat, 23 Jan 2016 00:06:09 +0000
    Subject: [PATCH] also print color space and overlay support status
    
    ---
     src/bin/screeninfo.cpp | 29 +++++++++++++++++++++++++++++
     1 file changed, 29 insertions(+)
    
    diff --git a/src/bin/screeninfo.cpp b/src/bin/screeninfo.cpp
    index ff2a06f..52ff63d 100644
    a b  
    1212#include <stdio.h>
    1313
    1414
     15const char* colorSpaceName(color_space colorSpace)
     16{
     17    switch (colorSpace)
     18    {
     19        case B_CMAP8:
     20            return "CMAP8";
     21        case B_RGB15:
     22            return "RGB15";
     23        case B_RGB32:
     24            return "RGB32";
     25        default:
     26            return "None";
     27    }
     28}
     29
     30
     31bool overlaySupport(color_space colorSpace)
     32{
     33    uint32 supportFlags = 0;
     34
     35    return bitmaps_support_space(colorSpace, &supportFlags)
     36            && (supportFlags & B_BITMAPS_SUPPORT_OVERLAY);
     37}
     38
     39
    1540int
    1641main()
    1742{
    main()  
    3459            printf("  name:    %s\n", info.name);
    3560            printf("  chipset: %s\n", info.chipset);
    3661            printf("  serial:  %s\n", info.serial_no);
     62            color_space colorSpace = screen.ColorSpace();
     63            printf("  color space:     %s\n", colorSpaceName(colorSpace));
     64            printf("  overlay support: %s\n",
     65                    overlaySupport(colorSpace) ? "yes" : "no");
    3766        }
    3867    } while (screen.SetToNext() == B_OK);
    3968