aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_app/VulkanWindowContext.h
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-06-28 23:31:00 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-28 23:34:52 +0000
commit007267bdb54d56ec978c97c6a6944afc2b6ff40b (patch)
treebf32945463a4c9345e0236b188e2f62ec902bd78 /tools/sk_app/VulkanWindowContext.h
parent3148f802af419297c466e6bf5efc003b6c498f0a (diff)
Revert "Reland "Make GrVkBackendContext no longer derive from SkRefCnt.""
This reverts commit 0db3a8846a4d05d55c36b7fa95fa6fbc1a6639cd. Reason for revert: fuchsia change reverted Original change's description: > Reland "Make GrVkBackendContext no longer derive from SkRefCnt." > > This reverts commit 059a9ab4bcd07a4bfdbfef333c27ef3d277e0e46. > > Reason for revert: Fix landed in Fuchsia > > Original change's description: > > Revert "Make GrVkBackendContext no longer derive from SkRefCnt." > > > > This reverts commit 93ae2337732bf206e6ef4faecc6b30c3881e8359. > > > > Reason for revert: <INSERT REASONING HERE> > > > > Original change's description: > > > Make GrVkBackendContext no longer derive from SkRefCnt. > > > > > > Also moves the helper Create functions to VkTestUtils since no clients > > > are using them anymore. > > > > > > Bug: skia: > > > Change-Id: I7e8e4912e7ef6fb00a7e2a00407aed5e83211799 > > > Reviewed-on: https://skia-review.googlesource.com/135323 > > > Reviewed-by: Jim Van Verth <jvanverth@google.com> > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com > > > > # Not skipping CQ checks because original CL landed > 1 day ago. > > > > Bug: skia: > > Change-Id: If7201917631dc22753ea3fa6e9d2984463e38e4c > > Reviewed-on: https://skia-review.googlesource.com/137903 > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: skia: > Change-Id: Ia4b7c0bb2c7b5dba809d85c69f0b41b473140526 > Reviewed-on: https://skia-review.googlesource.com/138181 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com Change-Id: I3f7bc4a5e4e09512fe165303685c123ec3527e58 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/138422 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tools/sk_app/VulkanWindowContext.h')
-rw-r--r--tools/sk_app/VulkanWindowContext.h19
1 files changed, 3 insertions, 16 deletions
diff --git a/tools/sk_app/VulkanWindowContext.h b/tools/sk_app/VulkanWindowContext.h
index 79298f6b38..1fca9dc83e 100644
--- a/tools/sk_app/VulkanWindowContext.h
+++ b/tools/sk_app/VulkanWindowContext.h
@@ -13,8 +13,6 @@
#ifdef SK_VULKAN
#include "vk/GrVkBackendContext.h"
-#include "vk/GrVkInterface.h"
-#include "vk/VkTestUtils.h"
#include "WindowContext.h"
class GrRenderTarget;
@@ -28,7 +26,7 @@ public:
sk_sp<SkSurface> getBackbufferSurface() override;
void swapBuffers() override;
- bool isValid() override { return fDevice != VK_NULL_HANDLE; }
+ bool isValid() override { return SkToBool(fBackendContext.get()); }
void resize(int w, int h) override {
this->createSwapchain(w, h, fDisplayParams);
@@ -43,7 +41,7 @@ public:
/** Platform specific function that creates a VkSurfaceKHR for a window */
using CreateVkSurfaceFn = std::function<VkSurfaceKHR(VkInstance)>;
/** Platform specific function that determines whether presentation will succeed. */
- using CanPresentFn = sk_gpu_test::CanPresentFn;
+ using CanPresentFn = GrVkBackendContext::CanPresentFn;
VulkanWindowContext(const DisplayParams&, CreateVkSurfaceFn, CanPresentFn,
PFN_vkGetInstanceProcAddr, PFN_vkGetDeviceProcAddr);
@@ -65,9 +63,7 @@ private:
void createBuffers(VkFormat format, SkColorType colorType);
void destroyBuffers();
- VkInstance fInstance = VK_NULL_HANDLE;
- VkPhysicalDevice fPhysicalDevice = VK_NULL_HANDLE;
- VkDevice fDevice = VK_NULL_HANDLE;
+ sk_sp<const GrVkBackendContext> fBackendContext;
// simple wrapper class that exists only to initialize a pointer to NULL
template <typename FNPTR_TYPE> class VkPtr {
@@ -99,19 +95,10 @@ private:
VkPtr<PFN_vkGetSwapchainImagesKHR> fGetSwapchainImagesKHR;
VkPtr<PFN_vkAcquireNextImageKHR> fAcquireNextImageKHR;
VkPtr<PFN_vkQueuePresentKHR> fQueuePresentKHR;
-
- VkPtr<PFN_vkDestroyInstance> fDestroyInstance;
- VkPtr<PFN_vkDeviceWaitIdle> fDeviceWaitIdle;
- VkPtr<PFN_vkQueueWaitIdle> fQueueWaitIdle;
- VkPtr<PFN_vkDestroyDevice> fDestroyDevice;
VkPtr<PFN_vkGetDeviceQueue> fGetDeviceQueue;
- sk_sp<const GrVkInterface> fInterface;
-
VkSurfaceKHR fSurface;
VkSwapchainKHR fSwapchain;
- uint32_t fGraphicsQueueIndex;
- VkQueue fGraphicsQueue;
uint32_t fPresentQueueIndex;
VkQueue fPresentQueue;