bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "VkTestContext.h" |
| 9 | |
| 10 | #ifdef SK_VULKAN |
| 11 | |
| 12 | namespace { |
bsalomon | c869932 | 2016-05-11 11:55:36 -0700 | [diff] [blame^] | 13 | // TODO: Implement fence syncs, swap buffers, submit, and flush |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 14 | class VkTestContextImpl : public sk_gpu_test::VkTestContext { |
| 15 | public: |
| 16 | VkTestContextImpl() |
| 17 | : VkTestContext(sk_sp<const GrVkBackendContext>(GrVkBackendContext::Create())) {} |
| 18 | |
| 19 | ~VkTestContextImpl() override { this->teardown(); } |
| 20 | |
| 21 | void testAbandon() override {} |
| 22 | |
bsalomon | c869932 | 2016-05-11 11:55:36 -0700 | [diff] [blame^] | 23 | void submit() override {} |
| 24 | void finish() override {} |
| 25 | |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 26 | protected: |
| 27 | void teardown() override { fVk.reset(nullptr); } |
| 28 | |
| 29 | private: |
| 30 | void onPlatformMakeCurrent() const override {} |
| 31 | void onPlatformSwapBuffers() const override {} |
| 32 | |
| 33 | typedef sk_gpu_test::VkTestContext INHERITED; |
| 34 | }; |
| 35 | } |
| 36 | |
| 37 | namespace sk_gpu_test { |
| 38 | VkTestContext* CreatePlatformVkTestContext() { |
| 39 | return new VkTestContextImpl; |
| 40 | } |
| 41 | } // namespace sk_gpu_test |
| 42 | |
| 43 | #endif |