| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 SkASSERT(caps.supportedCompositeAlpha & (VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR | | 166 SkASSERT(caps.supportedCompositeAlpha & (VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR | |
| 167 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR)
); | 167 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR)
); |
| 168 VkCompositeAlphaFlagBitsKHR composite_alpha = | 168 VkCompositeAlphaFlagBitsKHR composite_alpha = |
| 169 (caps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) ? | 169 (caps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) ? |
| 170 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR : | 170 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR : |
| 171 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; | 171 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; |
| 172 | 172 |
| 173 // Pick our surface format. For now, just make sure it matches our sRGB requ
est: | 173 // Pick our surface format. For now, just make sure it matches our sRGB requ
est: |
| 174 VkFormat surfaceFormat = VK_FORMAT_UNDEFINED; | 174 VkFormat surfaceFormat = VK_FORMAT_UNDEFINED; |
| 175 VkColorSpaceKHR colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; | 175 VkColorSpaceKHR colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; |
| 176 bool wantSRGB = kSRGB_SkColorProfileType == params.fProfileType; | 176 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
| 177 bool wantSRGB = srgbColorSpace == params.fColorSpace; |
| 177 for (uint32_t i = 0; i < surfaceFormatCount; ++i) { | 178 for (uint32_t i = 0; i < surfaceFormatCount; ++i) { |
| 178 GrPixelConfig config; | 179 GrPixelConfig config; |
| 179 if (GrVkFormatToPixelConfig(surfaceFormats[i].format, &config) && | 180 if (GrVkFormatToPixelConfig(surfaceFormats[i].format, &config) && |
| 180 GrPixelConfigIsSRGB(config) == wantSRGB) { | 181 GrPixelConfigIsSRGB(config) == wantSRGB) { |
| 181 surfaceFormat = surfaceFormats[i].format; | 182 surfaceFormat = surfaceFormats[i].format; |
| 182 colorSpace = surfaceFormats[i].colorSpace; | 183 colorSpace = surfaceFormats[i].colorSpace; |
| 183 break; | 184 break; |
| 184 } | 185 } |
| 185 } | 186 } |
| 186 fDisplayParams = params; | 187 fDisplayParams = params; |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 &fSwapchain, // pSwapchains | 596 &fSwapchain, // pSwapchains |
| 596 &backbuffer->fImageIndex, // pImageIndices | 597 &backbuffer->fImageIndex, // pImageIndices |
| 597 NULL // pResults | 598 NULL // pResults |
| 598 }; | 599 }; |
| 599 | 600 |
| 600 fQueuePresentKHR(fPresentQueue, &presentInfo); | 601 fQueuePresentKHR(fPresentQueue, &presentInfo); |
| 601 | 602 |
| 602 } | 603 } |
| 603 | 604 |
| 604 } //namespace sk_app | 605 } //namespace sk_app |
| OLD | NEW |