提交 7dd93291 编写于 作者: B Benjamin Herrenschmidt 提交者: Gerd Hoffmann

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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>

[ kraxel: minor format tweaks ]
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 fcf73af6
......@@ -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"
......@@ -868,6 +881,7 @@ static const DisplayChangeListenerOps dcl_ops = {
.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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册