Skip to content

Commit

Permalink
ui: compile out some qemu-pixman functions when !PIXMAN
Browse files Browse the repository at this point in the history
Those functions require the PIXMAN library.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  • Loading branch information
elmarco committed Nov 7, 2023
1 parent ce59c54 commit b3ec48c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/ui/qemu-pixman.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian);
pixman_format_code_t qemu_drm_format_to_pixman(uint32_t drm_format);
uint32_t qemu_pixman_to_drm_format(pixman_format_code_t pixman);
int qemu_pixman_get_type(int rshift, int gshift, int bshift);
pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf);
bool qemu_pixman_check_format(DisplayChangeListener *dcl,
pixman_format_code_t format);

#ifdef CONFIG_PIXMAN
pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf);
pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
int width);
void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb,
int width, int x, int y);
pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format,
pixman_image_t *image);
void qemu_pixman_image_unref(pixman_image_t *image);

pixman_image_t *qemu_pixman_glyph_from_vgafont(int height, const uint8_t *font,
unsigned int ch);
Expand All @@ -91,6 +91,9 @@ void qemu_pixman_glyph_render(pixman_image_t *glyph,
pixman_color_t *fgcol,
pixman_color_t *bgcol,
int x, int y, int cw, int ch);
#endif

void qemu_pixman_image_unref(pixman_image_t *image);

G_DEFINE_AUTOPTR_CLEANUP_FUNC(pixman_image_t, qemu_pixman_image_unref)

Expand Down
6 changes: 6 additions & 0 deletions ui/qemu-pixman.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ int qemu_pixman_get_type(int rshift, int gshift, int bshift)
return type;
}

#ifdef CONFIG_PIXMAN
pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf)
{
pixman_format_code_t format;
Expand All @@ -158,6 +159,7 @@ pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf)
}
return format;
}
#endif

/*
* Return true for known-good pixman conversions.
Expand Down Expand Up @@ -186,6 +188,7 @@ bool qemu_pixman_check_format(DisplayChangeListener *dcl,
}
}

#ifdef CONFIG_PIXMAN
pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
int width)
{
Expand All @@ -211,6 +214,7 @@ pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format,
NULL,
pixman_image_get_stride(image));
}
#endif

void qemu_pixman_image_unref(pixman_image_t *image)
{
Expand All @@ -220,6 +224,7 @@ void qemu_pixman_image_unref(pixman_image_t *image)
pixman_image_unref(image);
}

#ifdef CONFIG_PIXMAN
pixman_image_t *qemu_pixman_glyph_from_vgafont(int height, const uint8_t *font,
unsigned int ch)
{
Expand Down Expand Up @@ -262,3 +267,4 @@ void qemu_pixman_glyph_render(pixman_image_t *glyph,
pixman_image_unref(ifg);
pixman_image_unref(ibg);
}
#endif /* CONFIG_PIXMAN */

0 comments on commit b3ec48c

Please sign in to comment.