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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 fContext->unref(); | 406 fContext->unref(); |
407 | 407 |
408 fBackendContext.reset(nullptr); | 408 fBackendContext.reset(nullptr); |
409 } | 409 } |
410 | 410 |
411 VulkanWindowContext::BackbufferInfo* VulkanWindowContext::getAvailableBackbuffer
() { | 411 VulkanWindowContext::BackbufferInfo* VulkanWindowContext::getAvailableBackbuffer
() { |
412 SkASSERT(fBackbuffers); | 412 SkASSERT(fBackbuffers); |
413 | 413 |
414 ++fCurrentBackbufferIndex; | 414 ++fCurrentBackbufferIndex; |
415 if (fCurrentBackbufferIndex > fImageCount) { | 415 if (fCurrentBackbufferIndex >= fImageCount) { |
416 fCurrentBackbufferIndex = 0; | 416 fCurrentBackbufferIndex = 0; |
417 } | 417 } |
418 | 418 |
419 BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex; | 419 BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex; |
420 | 420 |
421 GR_VK_CALL_ERRCHECK(fBackendContext->fInterface, | 421 GR_VK_CALL_ERRCHECK(fBackendContext->fInterface, |
422 WaitForFences(fBackendContext->fDevice, 2, backbuffer->f
UsageFences, | 422 WaitForFences(fBackendContext->fDevice, 2, backbuffer->f
UsageFences, |
423 true, UINT64_MAX)); | 423 true, UINT64_MAX)); |
424 return backbuffer; | 424 return backbuffer; |
425 } | 425 } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 1, // swapchainCount | 597 1, // swapchainCount |
598 &fSwapchain, // pSwapchains | 598 &fSwapchain, // pSwapchains |
599 &backbuffer->fImageIndex, // pImageIndices | 599 &backbuffer->fImageIndex, // pImageIndices |
600 NULL // pResults | 600 NULL // pResults |
601 }; | 601 }; |
602 | 602 |
603 fQueuePresentKHR(fPresentQueue, &presentInfo); | 603 fQueuePresentKHR(fPresentQueue, &presentInfo); |
604 } | 604 } |
605 | 605 |
606 } //namespace sk_app | 606 } //namespace sk_app |
OLD | NEW |