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

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

Issue 1944413005: More refactoring for Viewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix up Android Created 4 years, 7 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/Application.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/VulkanTestContext.h b/tools/viewer/sk_app/VulkanWindowContext.h
similarity index 78%
rename from tools/viewer/VulkanTestContext.h
rename to tools/viewer/sk_app/VulkanWindowContext.h
index 60b3b80cf49022a18c26f0a366cbd174ed5658cc..48f8ed536ba12a183c786abbd003678c2cb06141 100644
--- a/tools/viewer/VulkanTestContext.h
+++ b/tools/viewer/sk_app/VulkanWindowContext.h
@@ -5,27 +5,29 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#ifndef VulkanTestContext_DEFINED
-#define VulkanTestContext_DEFINED
+#ifndef VulkanWindowContext_DEFINED
+#define VulkanWindowContext_DEFINED
#ifdef SK_VULKAN
-#include "GrTypes.h"
#include "vk/GrVkBackendContext.h"
+#include "WindowContext.h"
class SkSurface;
class GrContext;
-class VulkanTestContext {
+namespace sk_app {
+
+class VulkanWindowContext : public WindowContext {
public:
- ~VulkanTestContext();
+ ~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);
- static VulkanTestContext* Create(void* platformData, int msaaSampleCount) {
- VulkanTestContext* ctx = new VulkanTestContext(platformData, msaaSampleCount);
+ static VulkanWindowContext* Create(void* platformData, int msaaSampleCount) {
+ VulkanWindowContext* ctx = new VulkanWindowContext(platformData, msaaSampleCount);
if (!ctx->isValid()) {
delete ctx;
return nullptr;
@@ -33,22 +35,24 @@ public:
return ctx;
}
- SkSurface* getBackbufferSurface();
- void swapBuffers();
+ SkSurface* getBackbufferSurface() override;
+ void swapBuffers() override;
- bool makeCurrent() { return true; }
+ bool makeCurrent() override { return true; }
- bool isValid() { return SkToBool(fBackendContext.get()); }
+ bool isValid() override { return SkToBool(fBackendContext.get()); }
- void resize(uint32_t w, uint32_t h) {
- this->createSwapchain(w, h);
+ void resize(uint32_t w, uint32_t h) override {
+ this->createSwapchain(w, h);
}
- GrBackendContext getBackendContext() { return (GrBackendContext)fBackendContext.get(); }
+ GrBackendContext getBackendContext() override {
+ return (GrBackendContext) fBackendContext.get();
+ }
private:
- VulkanTestContext();
- VulkanTestContext(void*, int msaaSampleCount);
+ VulkanWindowContext();
+ VulkanWindowContext(void*, int msaaSampleCount);
void initializeContext(void*);
void destroyContext();
@@ -76,7 +80,7 @@ private:
private:
FNPTR_TYPE fPtr;
};
-
+
// WSI interface functions
VkPtr<PFN_vkDestroySurfaceKHR> fDestroySurfaceKHR;
VkPtr<PFN_vkGetPhysicalDeviceSurfaceSupportKHR> fGetPhysicalDeviceSurfaceSupportKHR;
@@ -109,6 +113,8 @@ private:
uint32_t fCurrentBackbufferIndex;
};
+} // namespace sk_app
+
#endif // SK_VULKAN
#endif
« no previous file with comments | « tools/viewer/sk_app/Application.h ('k') | tools/viewer/sk_app/VulkanWindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698