1
0
Fork 0
forked from wry/wry

autocommit 2022-03-11 18:15:21 CET

This commit is contained in:
Julian Orth 2022-03-11 18:15:21 +01:00
parent 0399772467
commit b1890894b2
30 changed files with 2909 additions and 504 deletions

View file

@ -1,7 +1,9 @@
use crate::pixman;
use crate::render::sys::{GLint, GL_BGRA_EXT, GL_UNSIGNED_BYTE};
use crate::utils::debug_fn::debug_fn;
use ahash::AHashMap;
use once_cell::sync::Lazy;
use std::fmt::{Debug, Write};
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Format {
@ -32,6 +34,16 @@ const fn fourcc_code(a: char, b: char, c: char, d: char) -> u32 {
(a as u32) | ((b as u32) << 8) | ((c as u32) << 16) | ((d as u32) << 24)
}
pub fn debug(fourcc: u32) -> impl Debug {
debug_fn(move |fmt| {
fmt.write_char(fourcc as u8 as char)?;
fmt.write_char((fourcc >> 8) as u8 as char)?;
fmt.write_char((fourcc >> 16) as u8 as char)?;
fmt.write_char((fourcc >> 24) as u8 as char)?;
Ok(())
})
}
const ARGB8888_ID: u32 = 0;
const ARGB8888_DRM: u32 = fourcc_code('A', 'R', '2', '4');