Skip to content

Commit 4bde460

Browse files
author
Yuuki Harano
committed
change surface handling.
1 parent 4a479e8 commit 4bde460

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/image.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3067,9 +3067,9 @@ Create_Pixmap_From_Bitmap_Data (struct frame *f, struct image *img, char *data,
30673067
img->pixmap = ns_image_from_XBM (data, img->width, img->height, fg, bg);
30683068

30693069
#elif defined (HAVE_PGTK)
3070-
unsigned char *pix = xmalloc(img->width * img->height * 4);
3070+
cairo_surface_t *surface = create_cairo_image_surface(img->width, img->height);
3071+
uint32_t *dp = (uint32_t *) cairo_image_surface_get_data (surface);
30713072
int x, y;
3072-
uint32_t *dp = (uint32_t *) pix;
30733073
unsigned char *sp = (unsigned char *) data;
30743074
int mask = 0x01;
30753075
for (y = 0; y < img->height; y++) {
@@ -3086,7 +3086,6 @@ Create_Pixmap_From_Bitmap_Data (struct frame *f, struct image *img, char *data,
30863086
mask = 0x01;
30873087
}
30883088
}
3089-
create_cairo_image_surface(img, pix, img->width, img->height);
30903089
#else
30913090
img->pixmap =
30923091
(x_check_image_size (0, img->width, img->height)

0 commit comments

Comments
 (0)