mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 23:20:43 +00:00
wineandroid: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
This commit is contained in:
parent
f605add4fd
commit
ff64d67f76
|
@ -208,11 +208,10 @@ void update_gl_drawable( HWND hwnd )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL set_pixel_format( HDC hdc, int format, BOOL allow_change )
|
static BOOL set_pixel_format( HDC hdc, int format, BOOL internal )
|
||||||
{
|
{
|
||||||
struct gl_drawable *gl;
|
struct gl_drawable *gl;
|
||||||
HWND hwnd = NtUserWindowFromDC( hdc );
|
HWND hwnd = NtUserWindowFromDC( hdc );
|
||||||
int prev = 0;
|
|
||||||
|
|
||||||
if (!hwnd || hwnd == NtUserGetDesktopWindow())
|
if (!hwnd || hwnd == NtUserGetDesktopWindow())
|
||||||
{
|
{
|
||||||
|
@ -226,10 +225,18 @@ static BOOL set_pixel_format( HDC hdc, int format, BOOL allow_change )
|
||||||
}
|
}
|
||||||
TRACE( "%p/%p format %d\n", hdc, hwnd, format );
|
TRACE( "%p/%p format %d\n", hdc, hwnd, format );
|
||||||
|
|
||||||
|
if (!internal)
|
||||||
|
{
|
||||||
|
/* cannot change it if already set */
|
||||||
|
int prev = win32u_get_window_pixel_format( hwnd );
|
||||||
|
|
||||||
|
if (prev)
|
||||||
|
return prev == format;
|
||||||
|
}
|
||||||
|
|
||||||
if ((gl = get_gl_drawable( hwnd, 0 )))
|
if ((gl = get_gl_drawable( hwnd, 0 )))
|
||||||
{
|
{
|
||||||
prev = gl->format;
|
if (internal)
|
||||||
if (allow_change)
|
|
||||||
{
|
{
|
||||||
EGLint pf;
|
EGLint pf;
|
||||||
p_eglGetConfigAttrib( display, pixel_formats[format - 1].config, EGL_NATIVE_VISUAL_ID, &pf );
|
p_eglGetConfigAttrib( display, pixel_formats[format - 1].config, EGL_NATIVE_VISUAL_ID, &pf );
|
||||||
|
@ -241,8 +248,7 @@ static BOOL set_pixel_format( HDC hdc, int format, BOOL allow_change )
|
||||||
|
|
||||||
release_gl_drawable( gl );
|
release_gl_drawable( gl );
|
||||||
|
|
||||||
if (prev && prev != format && !allow_change) return FALSE;
|
if (win32u_set_window_pixel_format( hwnd, format, internal )) return TRUE;
|
||||||
if (win32u_set_window_pixel_format( hwnd, format, FALSE )) return TRUE;
|
|
||||||
destroy_gl_drawable( hwnd );
|
destroy_gl_drawable( hwnd );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue