| 865 | |
| 866 | |
| 867 | static const pixel_format *get_pixel_format(int format, bool allow_nondisplayable) { |
| 868 | /* Check if the pixel format is valid. Note that it is legal to pass an invalid |
| 869 | * format in case of probing the number of pixel formats. |
| 870 | */ |
| 871 | if (is_valid_pixel_format(format) && (is_displayable_pixel_format(format) || allow_nondisplayable)) { |
| 872 | return &pixel_formats[format - 1]; |
| 873 | } |
| 874 | return NULL; |
| 875 | } |
| 876 | |
| 877 | static bool initialized = false; |
| 878 |
no test coverage detected