| 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 "GrRenderTarget.h" | 10 #include "GrRenderTarget.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 if (!this->createSwapchain(-1, -1, params)) { | 79 if (!this->createSwapchain(-1, -1, params)) { |
| 80 this->destroyContext(); | 80 this->destroyContext(); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 // create presentQueue | 84 // create presentQueue |
| 85 vkGetDeviceQueue(fBackendContext->fDevice, fPresentQueueIndex, 0, &fPresentQ
ueue); | 85 vkGetDeviceQueue(fBackendContext->fDevice, fPresentQueueIndex, 0, &fPresentQ
ueue); |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool VulkanWindowContext::createSwapchain(uint32_t width, uint32_t height, | 88 bool VulkanWindowContext::createSwapchain(int width, int height, |
| 89 const DisplayParams& params) { | 89 const DisplayParams& params) { |
| 90 // check for capabilities | 90 // check for capabilities |
| 91 VkSurfaceCapabilitiesKHR caps; | 91 VkSurfaceCapabilitiesKHR caps; |
| 92 VkResult res = fGetPhysicalDeviceSurfaceCapabilitiesKHR(fBackendContext->fPh
ysicalDevice, | 92 VkResult res = fGetPhysicalDeviceSurfaceCapabilitiesKHR(fBackendContext->fPh
ysicalDevice, |
| 93 fSurface, &caps); | 93 fSurface, &caps); |
| 94 if (VK_SUCCESS != res) { | 94 if (VK_SUCCESS != res) { |
| 95 return false; | 95 return false; |
| 96 } | 96 } |
| 97 | 97 |
| 98 uint32_t surfaceFormatCount; | 98 uint32_t surfaceFormatCount; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 &fSwapchain, // pSwapchains | 590 &fSwapchain, // pSwapchains |
| 591 &backbuffer->fImageIndex, // pImageIndices | 591 &backbuffer->fImageIndex, // pImageIndices |
| 592 NULL // pResults | 592 NULL // pResults |
| 593 }; | 593 }; |
| 594 | 594 |
| 595 fQueuePresentKHR(fPresentQueue, &presentInfo); | 595 fQueuePresentKHR(fPresentQueue, &presentInfo); |
| 596 | 596 |
| 597 } | 597 } |
| 598 | 598 |
| 599 } //namespace sk_app | 599 } //namespace sk_app |
| OLD | NEW |