Skip to content

Commit 136c38a

Browse files
author
James Clarke
committed
Fix Windows embedding. Appears that flutter#6523 or flutter#6525 introduced a bug for embedder scenarios causing the window native library to be incorrectly initialized and thus incapable of correctly resolving GL functions. This change fixes that.
1 parent d0fae04 commit 136c38a

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

shell/platform/embedder/embedder.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,18 @@ static bool IsRendererValid(const FlutterRendererConfig* config) {
8989
return false;
9090
}
9191

92-
#if OS_LINUX || OS_WIN
93-
9492
static void* DefaultGLProcResolver(const char* name) {
9593
static fml::RefPtr<fml::NativeLibrary> proc_library =
94+
95+
#if OS_LINUX
9696
fml::NativeLibrary::CreateForCurrentProcess();
97-
return static_cast<void*>(
98-
const_cast<uint8_t*>(proc_library->ResolveSymbol(name)));
99-
}
97+
#elif OS_WIN // OS_LINUX
98+
fml::NativeLibrary::Create("opengl32.dll");
99+
#endif // OS_WIN
100100

101-
#endif // OS_LINUX || OS_WIN
101+
return static_cast<void*>(
102+
const_cast<uint8_t*>(proc_library->ResolveSymbol(name)));
103+
}
102104

103105
static shell::Shell::CreateCallback<shell::PlatformView>
104106
InferOpenGLPlatformViewCreationCallback(

0 commit comments

Comments
 (0)