aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-07-12 15:42:51 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-12 20:31:38 +0000
commit80a82dff82d11c229d33e87453e8510cbd1603b9 (patch)
treeafc4ea5d6dadba402b6751bd44f700948a6697d9 /tools/viewer
parent176c3b2e8892865d2b78a745fb359b3644d11d2b (diff)
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 <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/viewer')
-rw-r--r--tools/viewer/Viewer.cpp7
1 files 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);