From 80a82dff82d11c229d33e87453e8510cbd1603b9 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 12 Jul 2017 15:42:51 -0400 Subject: On Windows, always re-create window for GL or Vulkan On at least one machine, I've seen SetPixelFormat fail after Vulkan was used to render to a window, preventing us from creating a GL context. This is ham-fisted, but solves the problem. Bug: skia: Change-Id: I76d0cb26e181304846aa06109c1af768f8363a18 Reviewed-on: https://skia-review.googlesource.com/22740 Reviewed-by: Greg Daniel Commit-Queue: Brian Osman --- tools/viewer/Viewer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index c0b8dd83c0..29e5b70cb8 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -667,9 +667,10 @@ void Viewer::setBackend(sk_app::Window::BackendType backendType) { fWindow->detach(); #if defined(SK_BUILD_FOR_WIN) && defined(SK_VULKAN) - // Switching from OpenGL to Vulkan in the same window is problematic at this point on - // Windows, so we just delete the window and recreate it. - if (sk_app::Window::kVulkan_BackendType == fBackendType) { + // Switching from OpenGL to Vulkan (or vice-versa on some systems) in the same window is + // problematic at this point on Windows, so we just delete the window and recreate it. + if (sk_app::Window::kVulkan_BackendType == fBackendType || + sk_app::Window::kNativeGL_BackendType == fBackendType) { DisplayParams params = fWindow->getRequestedDisplayParams(); delete fWindow; fWindow = Window::CreateNativeWindow(nullptr); -- cgit v1.2.3