aboutsummaryrefslogtreecommitdiffstats
path: root/gfx.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-02-03 13:08:57 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-03 13:08:57 +0100
commit930713cf44bcae9a91f92a1582f329643d38abfd (patch)
treea02b43454a26174c905ef1e2035685eb7b6428e1 /gfx.h
parent4ff884bd2510326dafb5adb97e69797d006b0e14 (diff)
downloadfbida-930713cf44bcae9a91f92a1582f329643d38abfd.tar.gz
add gfxfmt, fixes
Diffstat (limited to 'gfx.h')
-rw-r--r--gfx.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gfx.h b/gfx.h
index 608a128..840d0df 100644
--- a/gfx.h
+++ b/gfx.h
@@ -1,8 +1,33 @@
#include <stdbool.h>
#include <inttypes.h>
+#include <pixman.h>
+#include <cairo.h>
+
+/* ---------------------------------------------------------------------- */
+
+#undef MAX
+#define MAX(x,y) ((x)>(y)?(x):(y))
+#undef MIN
+#define MIN(x,y) ((x)<(y)?(x):(y))
+#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
+
+/* ---------------------------------------------------------------------- */
+
+typedef struct gfxfmt gfxfmt;
typedef struct gfxstate gfxstate;
+struct gfxfmt {
+ uint32_t fourcc; /* little endian (drm) */
+ cairo_format_t cairo; /* native endian */
+ pixman_format_code_t pixman; /* native endian */
+ uint32_t bits_pp;
+ uint32_t bytes_pp;
+};
+
+extern gfxfmt fmt_list[];
+extern uint32_t fmt_count;
+
struct gfxstate {
/* info */
uint32_t hdisplay;