Index: tools/gpu/vk/VkTestContext.cpp |
diff --git a/tools/gpu/vk/VkTestContext.cpp b/tools/gpu/vk/VkTestContext.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..44be9fd2425813d144f9920ca6480a72ce380c5b |
--- /dev/null |
+++ b/tools/gpu/vk/VkTestContext.cpp |
@@ -0,0 +1,40 @@ |
+/* |
+ * Copyright 2016 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#include "VkTestContext.h" |
+ |
+#ifdef SK_VULKAN |
+ |
+namespace { |
+// TODO: Implement fence syncs and swap buffers |
+class VkTestContextImpl : public sk_gpu_test::VkTestContext { |
+public: |
+ VkTestContextImpl() |
+ : VkTestContext(sk_sp<const GrVkBackendContext>(GrVkBackendContext::Create())) {} |
+ |
+ ~VkTestContextImpl() override { this->teardown(); } |
+ |
+ void testAbandon() override {} |
+ |
+protected: |
+ void teardown() override { fVk.reset(nullptr); } |
+ |
+private: |
+ void onPlatformMakeCurrent() const override {} |
+ void onPlatformSwapBuffers() const override {} |
+ |
+ typedef sk_gpu_test::VkTestContext INHERITED; |
+}; |
+} |
+ |
+namespace sk_gpu_test { |
+VkTestContext* CreatePlatformVkTestContext() { |
+ return new VkTestContextImpl; |
+} |
+} // namespace sk_gpu_test |
+ |
+#endif |