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

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

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/RasterWindowContext.h ('k') | tools/viewer/sk_app/VulkanWindowContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/VulkanWindowContext.h
diff --git a/tools/viewer/sk_app/VulkanWindowContext.h b/tools/viewer/sk_app/VulkanWindowContext.h
index 63b52bc73f935eb1cea64a4b77d2e5a6d6060ad2..d40adf6e6ee09ece11997338b59d45d067b3e781 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.h
+++ b/tools/viewer/sk_app/VulkanWindowContext.h
@@ -23,20 +23,6 @@ class VulkanWindowContext : public WindowContext {
public:
~VulkanWindowContext() override;
- // each platform will have to implement these in its CPP file
- static VkSurfaceKHR createVkSurface(VkInstance, void* platformData);
- static bool canPresent(VkInstance, VkPhysicalDevice, uint32_t queueFamilyIndex,
- void* platformData);
-
- static VulkanWindowContext* Create(void* platformData, const DisplayParams& params) {
- VulkanWindowContext* ctx = new VulkanWindowContext(platformData, params);
- if (!ctx->isValid()) {
- delete ctx;
- return nullptr;
- }
- return ctx;
- }
-
sk_sp<SkSurface> getBackbufferSurface() override;
void swapBuffers() override;
@@ -54,9 +40,14 @@ public:
return (GrBackendContext) fBackendContext.get();
}
+ /** 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 = GrVkBackendContext::CanPresentFn;
+
+ VulkanWindowContext(const DisplayParams&, CreateVkSurfaceFn, CanPresentFn);
+
private:
- VulkanWindowContext(void*, const DisplayParams&);
- void initializeContext(void*, const DisplayParams&);
void destroyContext();
struct BackbufferInfo {
« no previous file with comments | « tools/viewer/sk_app/RasterWindowContext.h ('k') | tools/viewer/sk_app/VulkanWindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698