diff options
author | 2016-07-26 12:02:50 -0700 | |
---|---|---|
committer | 2016-07-26 12:02:51 -0700 | |
commit | d1bdd1fcbd308afb9903f39d231742f5c951cf07 (patch) | |
tree | 786715537d870e3ff8bc3686ea40b83b62c43d6b /tools/viewer/sk_app/VulkanWindowContext.cpp | |
parent | 1ed2ae45f59c2864ea05838b4da2750b85472824 (diff) |
Use Windowing system-specific WindowContext factories.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2169543002
Review-Url: https://codereview.chromium.org/2169543002
Diffstat (limited to 'tools/viewer/sk_app/VulkanWindowContext.cpp')
-rw-r--r-- | tools/viewer/sk_app/VulkanWindowContext.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tools/viewer/sk_app/VulkanWindowContext.cpp b/tools/viewer/sk_app/VulkanWindowContext.cpp index c969f28d85..74c0674f2e 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; |