Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: tools/viewer/sk_app/VulkanWindowContext.cpp

Issue 2182273002: SW backend for viewer on Windows (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/viewer/sk_app/VulkanWindowContext.h ('k') | tools/viewer/sk_app/Window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/VulkanWindowContext.h ('k') | tools/viewer/sk_app/Window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698