diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-07 17:24:42 +1000 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-01-19 13:33:26 +0100 |
commit | 7dd93291cad743e83e972a323a5775ff5a954bd5 (patch) | |
tree | fbe4f53ff554f5bcbee61bfa7dd69b254e9bd8e2 /ui/sdl.c | |
parent | fcf73af68ecb83dcb1d997c6b6a0c29989ebfea8 (diff) |
ui/sdl: Support shared surface for more pixman formats
At least all the ones I've tested. We make the assumption that
SDL is going to be better at conversion than we are.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ kraxel: minor format tweaks ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/sdl.c')
-rw-r--r-- | ui/sdl.c | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -151,6 +151,19 @@ static void sdl_switch(DisplayChangeListener *dcl, pf.bmask, pf.amask); } +static bool sdl_check_format(DisplayChangeListener *dcl, + pixman_format_code_t format) +{ + /* + * We let SDL convert for us a few more formats than, + * the native ones. Thes are the ones I have tested. + */ + return (format == PIXMAN_x8r8g8b8 || + format == PIXMAN_b8g8r8x8 || + format == PIXMAN_x1r5g5b5 || + format == PIXMAN_r5g6b5); +} + /* generic keyboard conversion */ #include "sdl_keysym.h" @@ -865,12 +878,13 @@ static void sdl_cleanup(void) } static const DisplayChangeListenerOps dcl_ops = { - .dpy_name = "sdl", - .dpy_gfx_update = sdl_update, - .dpy_gfx_switch = sdl_switch, - .dpy_refresh = sdl_refresh, - .dpy_mouse_set = sdl_mouse_warp, - .dpy_cursor_define = sdl_mouse_define, + .dpy_name = "sdl", + .dpy_gfx_update = sdl_update, + .dpy_gfx_switch = sdl_switch, + .dpy_gfx_check_format = sdl_check_format, + .dpy_refresh = sdl_refresh, + .dpy_mouse_set = sdl_mouse_warp, + .dpy_cursor_define = sdl_mouse_define, }; void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) |