aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fb-gui.c13
-rw-r--r--meson.build2
2 files changed, 13 insertions, 2 deletions
diff --git a/fb-gui.c b/fb-gui.c
index 97f91c4..4d76d96 100644
--- a/fb-gui.c
+++ b/fb-gui.c
@@ -8,6 +8,7 @@
#include <sys/ioctl.h>
#include <linux/fb.h>
+#include <cairo.h>
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
@@ -26,6 +27,10 @@ static int32_t s_lut_transp[256], s_lut_red[256], s_lut_green[256], s_lut_blue[2
static unsigned char **shadow;
static unsigned int *sdirty,swidth,sheight;
+static cairo_t *context;
+static cairo_surface_t *surface;
+static unsigned char *framebuffer;
+
static void shadow_lut_init_one(int32_t *lut, int bits, int shift)
{
int i;
@@ -135,9 +140,15 @@ void shadow_init(gfxstate *gfx)
shadow = malloc(sizeof(unsigned char*) * sheight);
sdirty = malloc(sizeof(unsigned int) * sheight);
memset(sdirty,0, sizeof(unsigned int) * sheight);
+ framebuffer = malloc(swidth*sheight*4);
for (i = 0; i < sheight; i++)
- shadow[i] = malloc(swidth*4);
+ shadow[i] = framebuffer + i*swidth*4;
shadow_clear();
+ surface = cairo_image_surface_create_for_data(gfx->mem,
+ CAIRO_FORMAT_RGB24,
+ swidth, sheight,
+ swidth * 4);
+ context = cairo_create(surface);
/* init rendering */
switch (gfx->bits_per_pixel) {
diff --git a/meson.build b/meson.build
index cd9cc49..e4408b6 100644
--- a/meson.build
+++ b/meson.build
@@ -88,7 +88,7 @@ fbi_srcs = [ 'fbi.c', 'fb-gui.c', 'desktop.c',
'filter.c', 'op.c', 'jpegtools.c',
trans_src, read_srcs ]
fbi_deps = [ freetype_dep, fontconf_dep,
- drm_dep, pixman_dep,
+ drm_dep, pixman_dep, cairo_dep,
exif_dep, image_deps,
math_dep, udev_dep, input_dep ]