OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "VkTestContext.h" | 8 #include "VkTestContext.h" |
9 | 9 |
10 #ifdef SK_VULKAN | 10 #ifdef SK_VULKAN |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 private: | 96 private: |
97 sk_sp<const GrVkInterface> fVk; | 97 sk_sp<const GrVkInterface> fVk; |
98 VkDevice fDevice; | 98 VkDevice fDevice; |
99 VkQueue fQueue; | 99 VkQueue fQueue; |
100 VkCommandPool fCommandPool; | 100 VkCommandPool fCommandPool; |
101 VkCommandBuffer fCommandBuffer; | 101 VkCommandBuffer fCommandBuffer; |
102 SkDEBUGCODE(mutable int fUnfinishedSyncs;) | 102 SkDEBUGCODE(mutable int fUnfinishedSyncs;) |
103 typedef sk_gpu_test::FenceSync INHERITED; | 103 typedef sk_gpu_test::FenceSync INHERITED; |
104 }; | 104 }; |
105 | 105 |
| 106 GR_STATIC_ASSERT(sizeof(VkFence) <= sizeof(sk_gpu_test::PlatformFence)); |
| 107 |
106 // TODO: Implement swap buffers and finish | 108 // TODO: Implement swap buffers and finish |
107 class VkTestContextImpl : public sk_gpu_test::VkTestContext { | 109 class VkTestContextImpl : public sk_gpu_test::VkTestContext { |
108 public: | 110 public: |
109 static VkTestContext* Create() { | 111 static VkTestContext* Create() { |
110 sk_sp<const GrVkBackendContext> backendContext(GrVkBackendContext::Creat
e()); | 112 sk_sp<const GrVkBackendContext> backendContext(GrVkBackendContext::Creat
e()); |
111 if (!backendContext) { | 113 if (!backendContext) { |
112 return nullptr; | 114 return nullptr; |
113 } | 115 } |
114 return new VkTestContextImpl(std::move(backendContext)); | 116 return new VkTestContextImpl(std::move(backendContext)); |
115 } | 117 } |
(...skipping 25 matching lines...) Expand all Loading... |
141 | 143 |
142 typedef sk_gpu_test::VkTestContext INHERITED; | 144 typedef sk_gpu_test::VkTestContext INHERITED; |
143 }; | 145 }; |
144 } // anonymous namespace | 146 } // anonymous namespace |
145 | 147 |
146 namespace sk_gpu_test { | 148 namespace sk_gpu_test { |
147 VkTestContext* CreatePlatformVkTestContext() { return VkTestContextImpl::Create(
); } | 149 VkTestContext* CreatePlatformVkTestContext() { return VkTestContextImpl::Create(
); } |
148 } // namespace sk_gpu_test | 150 } // namespace sk_gpu_test |
149 | 151 |
150 #endif | 152 #endif |
OLD | NEW |