OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 #include "SkSurface.h" | 10 #include "SkSurface.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 , fBackbuffers(nullptr) { | 26 , fBackbuffers(nullptr) { |
27 | 27 |
28 // any config code here (particularly for msaa)? | 28 // any config code here (particularly for msaa)? |
29 | 29 |
30 this->initializeContext(platformData); | 30 this->initializeContext(platformData); |
31 } | 31 } |
32 | 32 |
33 void VulkanTestContext::initializeContext(void* platformData) { | 33 void VulkanTestContext::initializeContext(void* platformData) { |
34 | 34 |
35 fBackendContext.reset(GrVkBackendContext::Create()); | 35 fBackendContext.reset(GrVkBackendContext::Create()); |
36 fBackendContext->ref(); | |
37 | 36 |
38 fContext = GrContext::Create(kVulkan_GrBackend, (GrBackendContext)fBackendCo
ntext.get()); | 37 fContext = GrContext::Create(kVulkan_GrBackend, (GrBackendContext)fBackendCo
ntext.get()); |
39 | 38 |
40 fSurface = createVkSurface(platformData); | 39 fSurface = createVkSurface(platformData); |
41 if (VK_NULL_HANDLE == fSurface) { | 40 if (VK_NULL_HANDLE == fSurface) { |
42 fBackendContext.reset(nullptr); | 41 fBackendContext.reset(nullptr); |
43 return; | 42 return; |
44 } | 43 } |
45 | 44 |
46 // query to get the initial queue props size | 45 // query to get the initial queue props size |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 1, // swapchainCount | 596 1, // swapchainCount |
598 &fSwapchain, // pSwapchains | 597 &fSwapchain, // pSwapchains |
599 &backbuffer->fImageIndex, // pImageIndices | 598 &backbuffer->fImageIndex, // pImageIndices |
600 NULL // pResults | 599 NULL // pResults |
601 }; | 600 }; |
602 | 601 |
603 GR_VK_CALL_ERRCHECK(fBackendContext->fInterface, | 602 GR_VK_CALL_ERRCHECK(fBackendContext->fInterface, |
604 QueuePresentKHR(fPresentQueue, &presentInfo)); | 603 QueuePresentKHR(fPresentQueue, &presentInfo)); |
605 | 604 |
606 } | 605 } |
OLD | NEW |