Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: tools/viewer/sk_app/VulkanWindowContext.cpp

Issue 2169543002: Use Windowing system-specific WindowContext factories. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: more xlib Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/sk_app/VulkanWindowContext.h ('k') | tools/viewer/sk_app/android/GLWindowContext_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/VulkanWindowContext.cpp
diff --git a/tools/viewer/sk_app/VulkanWindowContext.cpp b/tools/viewer/sk_app/VulkanWindowContext.cpp
index c969f28d85138c705a11743c7ab840cb320a40ed..74c0674f2ed071f67e9a45210ff9c1d81662e27a 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.cpp
+++ b/tools/viewer/sk_app/VulkanWindowContext.cpp
@@ -25,7 +25,9 @@
namespace sk_app {
-VulkanWindowContext::VulkanWindowContext(void* platformData, const DisplayParams& params)
+VulkanWindowContext::VulkanWindowContext(const DisplayParams& params,
+ CreateVkSurfaceFn createVkSurface,
+ CanPresentFn canPresent)
: WindowContext()
, fSurface(VK_NULL_HANDLE)
, fSwapchain(VK_NULL_HANDLE)
@@ -36,13 +38,7 @@ VulkanWindowContext::VulkanWindowContext(void* platformData, const DisplayParams
, fBackbuffers(nullptr) {
// any config code here (particularly for msaa)?
-
- this->initializeContext(platformData, params);
-}
-
-void VulkanWindowContext::initializeContext(void* platformData, const DisplayParams& params) {
- fBackendContext.reset(GrVkBackendContext::Create(&fPresentQueueIndex, canPresent,
- platformData));
+ fBackendContext.reset(GrVkBackendContext::Create(&fPresentQueueIndex, canPresent));
if (!(fBackendContext->fExtensions & kKHR_surface_GrVkExtensionFlag) ||
!(fBackendContext->fExtensions & kKHR_swapchain_GrVkExtensionFlag)) {
@@ -65,7 +61,7 @@ void VulkanWindowContext::initializeContext(void* platformData, const DisplayPar
fContext = GrContext::Create(kVulkan_GrBackend, (GrBackendContext) fBackendContext.get());
- fSurface = createVkSurface(instance, platformData);
+ fSurface = createVkSurface(instance);
if (VK_NULL_HANDLE == fSurface) {
fBackendContext.reset(nullptr);
return;
« no previous file with comments | « tools/viewer/sk_app/VulkanWindowContext.h ('k') | tools/viewer/sk_app/android/GLWindowContext_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698