From 97d795c955f8d261a0a5294d49ea06d5a473ed03 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Sun, 16 Jan 2011 01:42:37 +0100 Subject: Add support for 32-bit framebuffers. This modifies the emulator so support 32-bit framebuffers. You can create such a frame-buffer using one of these methods: - Add a "bpp 32" line to the "display" element of your skin - Use the new 'magic' skin option format: e.g. -skin 320x480x32 Note that the result will be hideous since the kernel driver still thinks the hardware is only 16-bits. This will be addressed in a later patch to hw/goldfish_fb.c and to the kernel driver ($KERNEL/drivers/video/goldfishfb.c) Change-Id: I0fc700c4a4cb8521076605324e15ed34e5d01136 --- android/display-core.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'android/display-core.c') diff --git a/android/display-core.c b/android/display-core.c index 1efb4a2..0b2a869 100644 --- a/android/display-core.c +++ b/android/display-core.c @@ -79,14 +79,24 @@ coredisplay_fb_done(void* opaque) void coredisplay_init(DisplayState* ds) { + int format; + core_display.ds = ds; /* Create and initialize framebuffer instance that will be used for core * display. */ ANEW0(core_display.fb); core_display.core_fb = NULL; + + /* In the core, there is no skin to parse and the format of ds->surface + * is determined by the -android-gui option. + */ + format = QFRAME_BUFFER_RGB565; + if (ds->surface->pf.bytes_per_pixel == 4) + format = QFRAME_BUFFER_RGBX_8888; + qframebuffer_init(core_display.fb, ds->surface->width, ds->surface->height, - 0, QFRAME_BUFFER_RGB565 ); + 0, format); qframebuffer_fifo_add(core_display.fb); /* Register core display as the client for the framebuffer, so we can start * receiving framebuffer notifications. Note that until UI connects to the -- cgit v1.1