mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-10 19:05:46 -04:00
Ignore existing surface size on Android
Seems to be a race condition here where it's not up to date.
This commit is contained in:
@ -89,19 +89,24 @@ bool ContextEGL::ChangeSurface(const WindowInfo& new_wi)
|
||||
|
||||
void ContextEGL::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_height /*= 0*/)
|
||||
{
|
||||
// This seems to race on Android...
|
||||
#ifndef ANDROID
|
||||
EGLint surface_width, surface_height;
|
||||
if (eglQuerySurface(m_display, m_surface, EGL_WIDTH, &surface_width) &&
|
||||
eglQuerySurface(m_display, m_surface, EGL_HEIGHT, &surface_height))
|
||||
{
|
||||
m_wi.surface_width = static_cast<u32>(surface_width);
|
||||
m_wi.surface_height = static_cast<u32>(surface_height);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log_ErrorPrintf("eglQuerySurface() failed: %d", eglGetError());
|
||||
m_wi.surface_width = new_surface_width;
|
||||
m_wi.surface_height = new_surface_height;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_wi.surface_width = new_surface_width;
|
||||
m_wi.surface_height = new_surface_height;
|
||||
}
|
||||
|
||||
bool ContextEGL::SwapBuffers()
|
||||
|
@ -333,7 +333,9 @@ bool SwapChain::CreateSwapChain()
|
||||
// Determine the dimensions of the swap chain. Values of -1 indicate the size we specify here
|
||||
// determines window size?
|
||||
VkExtent2D size = surface_capabilities.currentExtent;
|
||||
#ifndef ANDROID
|
||||
if (size.width == UINT32_MAX)
|
||||
#endif
|
||||
{
|
||||
size.width = m_wi.surface_width;
|
||||
size.height = m_wi.surface_height;
|
||||
|
Reference in New Issue
Block a user