Hack to fix MSAA GL -> Vk transition on Windows Viewer
Bug: skia:
Change-Id: I49417789ab43734a1cbb4010281482970579971d
Reviewed-on: https://skia-review.googlesource.com/20505
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index e8e3734..c0b8dd8 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -684,7 +684,13 @@
fWindow->registerMouseWheelFunc(on_mouse_wheel_handler, this);
fWindow->registerKeyFunc(on_key_handler, this);
fWindow->registerCharFunc(on_char_handler, this);
- fWindow->setRequestedDisplayParams(params);
+ // Don't allow the window to re-attach. If we're in MSAA mode, the params we grabbed above
+ // will still include our correct sample count. But the re-created fWindow will lose that
+ // information. On Windows, we need to re-create the window when changing sample count,
+ // so we'll incorrectly detect that situation, then re-initialize the window in GL mode,
+ // rendering this tear-down step pointless (and causing the Vulkan window context to fail
+ // as if we had never changed windows at all).
+ fWindow->setRequestedDisplayParams(params, false);
}
#endif