aboutsummaryrefslogtreecommitdiffstats
path: root/fb-gui.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-02-01 12:03:37 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-01 12:03:37 +0100
commit100c5b1863a4c716d3834a39be9511325921337e (patch)
tree3fadf962d1adec569bc2b6db3018d42213c71a6e /fb-gui.c
parent900255f2876a906071b6f4c4b7bca975db2ebaaa (diff)
downloadfbida-100c5b1863a4c716d3834a39be9511325921337e.tar.gz
init cairo context for shadow
Diffstat (limited to 'fb-gui.c')
-rw-r--r--fb-gui.c13
1 files changed, 12 insertions, 1 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) {