mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
misc ui patches, mostly sdl related.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJVAafbAAoJEEy22O7T6HE4t4kP/0uizYcn7yoSt2JREKmn6/lh dc3cAxuwcxEZ8KXUxWSGCSheQDDdYAaKyK06pl8GUncnRSUOpSvcRvjN6IE7GVZP 6VQu5cdE69rPKPOIxvGApLbXvwqkngYCiDyKdFiJ/pjn4E7zA5yjv4YOa8LkQsMU L9iqPF5NogQ9yZiTepeWULJU/6kqhOAb4gfueGEC5SrePoa8E7chaBF8EjYt+IBB E1BJjZ12mtXHgG5mDVL7ysWrPTXMqDJSGKdFfV8uICFK21E0pN4uG6U4mq6+t3rY g2KJ3X//3KSSg9vJnNGpFSTSuXqRmf6cgpK0I+r+v99mKpuNRPNPSYBT0GWEfZUX TYxL3fTw03PqSHsL/Ep+ppmWOwwNPsryahoCBtPUHNnd48HluTlV62ONyQah8XTk TzAaeuGcbAwMwrLjzn92Qz4Dx/8Bdnj67tqGSYVqv+dOKlko41sgY0Q0n9TU1t6P oEOEfQvrnfot8Wey4tZ3jAfdxrf1Jr3bc1zehzVWCRusBTt7iCFpWi8kMA6PEfGX aivQXBbBJBzJ6B91asKLizjvVBiNvavy+BDWIBNYH++lou9htrdWg23qpH7etWOE S9IIFIR57P1+gSdr9k4Bed4B0A9qz5GQA6I1CHHyQSz6S8PU2s8YKC2viljr+hyn riFN11We9O20RVL1k7PX =OoVt -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20150312-2' into staging misc ui patches, mostly sdl related. # gpg: Signature made Thu Mar 12 14:51:07 2015 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-sdl-20150312-2: pixman: add a bunch of PIXMAN_BE_* defines for 32bpp Allow the use of X11 from a non standard location. configure: opengl overhaul sdl: Fix crash when calling sdl_switch() with NULL surface sdl: Refresh debug statements Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
dea4635998
8 changed files with 81 additions and 32 deletions
27
ui/sdl.c
27
ui/sdl.c
|
@ -61,16 +61,24 @@ static SDL_PixelFormat host_format;
|
|||
static int scaling_active = 0;
|
||||
static Notifier mouse_mode_notifier;
|
||||
|
||||
#if 0
|
||||
#define DEBUG_SDL
|
||||
#endif
|
||||
|
||||
static void sdl_update(DisplayChangeListener *dcl,
|
||||
int x, int y, int w, int h)
|
||||
{
|
||||
// printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h);
|
||||
SDL_Rect rec;
|
||||
rec.x = x;
|
||||
rec.y = y;
|
||||
rec.w = w;
|
||||
rec.h = h;
|
||||
|
||||
#ifdef DEBUG_SDL
|
||||
printf("SDL: Updating x=%d y=%d w=%d h=%d (scaling: %d)\n",
|
||||
x, y, w, h, scaling_active);
|
||||
#endif
|
||||
|
||||
if (guest_screen) {
|
||||
if (!scaling_active) {
|
||||
SDL_BlitSurface(guest_screen, &rec, real_screen, &rec);
|
||||
|
@ -89,7 +97,9 @@ static void do_sdl_resize(int width, int height, int bpp)
|
|||
int flags;
|
||||
SDL_Surface *tmp_screen;
|
||||
|
||||
// printf("resizing to %d %d\n", w, h);
|
||||
#ifdef DEBUG_SDL
|
||||
printf("SDL: Resizing to %dx%d bpp %d\n", width, height, bpp);
|
||||
#endif
|
||||
|
||||
flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
|
||||
if (gui_fullscreen) {
|
||||
|
@ -125,12 +135,13 @@ static void do_sdl_resize(int width, int height, int bpp)
|
|||
static void sdl_switch(DisplayChangeListener *dcl,
|
||||
DisplaySurface *new_surface)
|
||||
{
|
||||
PixelFormat pf = qemu_pixelformat_from_pixman(new_surface->format);
|
||||
PixelFormat pf;
|
||||
|
||||
/* temporary hack: allows to call sdl_switch to handle scaling changes */
|
||||
if (new_surface) {
|
||||
surface = new_surface;
|
||||
}
|
||||
pf = qemu_pixelformat_from_pixman(surface->format);
|
||||
|
||||
if (!scaling_active) {
|
||||
do_sdl_resize(surface_width(surface), surface_height(surface), 0);
|
||||
|
@ -143,6 +154,12 @@ static void sdl_switch(DisplayChangeListener *dcl,
|
|||
if (guest_screen != NULL) {
|
||||
SDL_FreeSurface(guest_screen);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SDL
|
||||
printf("SDL: Creating surface with masks: %08x %08x %08x %08x\n",
|
||||
pf.rmask, pf.gmask, pf.bmask, pf.amask);
|
||||
#endif
|
||||
|
||||
guest_screen = SDL_CreateRGBSurfaceFrom
|
||||
(surface_data(surface),
|
||||
surface_width(surface), surface_height(surface),
|
||||
|
@ -486,6 +503,10 @@ static void sdl_scale(int width, int height)
|
|||
{
|
||||
int bpp = real_screen->format->BitsPerPixel;
|
||||
|
||||
#ifdef DEBUG_SDL
|
||||
printf("SDL: Scaling to %dx%d bpp %d\n", width, height, bpp);
|
||||
#endif
|
||||
|
||||
if (bpp != 16 && bpp != 32) {
|
||||
bpp = 32;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue