7#ifndef GraphiteVulkanWindowContext_DEFINED
8#define GraphiteVulkanWindowContext_DEFINED
19namespace skgpu {
struct VulkanInterface; }
23class GraphiteVulkanWindowContext :
public WindowContext {
25 ~GraphiteVulkanWindowContext()
override;
31 void resize(
int w,
int h)
override {
32 this->createSwapchain(
w,
h, fDisplayParams);
35 void setDisplayParams(
const DisplayParams&
params)
override {
36 this->destroyContext();
38 this->initializeContext();
42 using CreateVkSurfaceFn =
std::function<VkSurfaceKHR(VkInstance)>;
44 using CanPresentFn = sk_gpu_test::CanPresentFn;
46 GraphiteVulkanWindowContext(
const DisplayParams&, CreateVkSurfaceFn, CanPresentFn,
50 void initializeContext();
51 void destroyContext();
53 struct BackbufferInfo {
55 VkSemaphore fRenderSemaphore;
58 BackbufferInfo* getAvailableBackbuffer();
61 void destroyBuffers();
62 void onSwapBuffers()
override;
70 CreateVkSurfaceFn fCreateVkSurfaceFn;
71 CanPresentFn fCanPresentFn;
97 VkSurfaceKHR fSurface;
98 VkSwapchainKHR fSwapchain;
99 uint32_t fGraphicsQueueIndex;
100 VkQueue fGraphicsQueue;
101 uint32_t fPresentQueueIndex;
102 VkQueue fPresentQueue;
104 uint32_t fImageCount;
108 BackbufferInfo* fBackbuffers;
109 uint32_t fCurrentBackbufferIndex;
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
const EmbeddedViewParams * params
uint32_t uint32_t * format
Dart_NativeFunction function
void(VKAPI_PTR * PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator)
VkResult(VKAPI_PTR * PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages)
void(VKAPI_PTR * PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue)
VkFlags VkImageUsageFlags
void(VKAPI_PTR * PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks *pAllocator)
VkResult(VKAPI_PTR * PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities)
void(VKAPI_PTR * PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator)
VkResult(VKAPI_PTR * PFN_vkQueueWaitIdle)(VkQueue queue)
VkResult(VKAPI_PTR * PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported)
void(VKAPI_PTR * PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks *pAllocator)
VkResult(VKAPI_PTR * PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain)
VkResult(VKAPI_PTR * PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR *pPresentInfo)
VkResult(VKAPI_PTR * PFN_vkDeviceWaitIdle)(VkDevice device)
VkResult(VKAPI_PTR * PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats)
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
VkResult(VKAPI_PTR * PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex)
VkResult(VKAPI_PTR * PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes)
void(VKAPI_PTR * PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator)