| 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 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 176 bool wantSRGB = kSRGB_SkColorProfileType == params.fProfileType; |
| 177 bool wantSRGB = srgbColorSpace == params.fColorSpace; | |
| 178 for (uint32_t i = 0; i < surfaceFormatCount; ++i) { | 177 for (uint32_t i = 0; i < surfaceFormatCount; ++i) { |
| 179 GrPixelConfig config; | 178 GrPixelConfig config; |
| 180 if (GrVkFormatToPixelConfig(surfaceFormats[i].format, &config) && | 179 if (GrVkFormatToPixelConfig(surfaceFormats[i].format, &config) && |
| 181 GrPixelConfigIsSRGB(config) == wantSRGB) { | 180 GrPixelConfigIsSRGB(config) == wantSRGB) { |
| 182 surfaceFormat = surfaceFormats[i].format; | 181 surfaceFormat = surfaceFormats[i].format; |
| 183 colorSpace = surfaceFormats[i].colorSpace; | 182 colorSpace = surfaceFormats[i].colorSpace; |
| 184 break; | 183 break; |
| 185 } | 184 } |
| 186 } | 185 } |
| 187 fDisplayParams = params; | 186 fDisplayParams = params; |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 &fSwapchain, // pSwapchains | 595 &fSwapchain, // pSwapchains |
| 597 &backbuffer->fImageIndex, // pImageIndices | 596 &backbuffer->fImageIndex, // pImageIndices |
| 598 NULL // pResults | 597 NULL // pResults |
| 599 }; | 598 }; |
| 600 | 599 |
| 601 fQueuePresentKHR(fPresentQueue, &presentInfo); | 600 fQueuePresentKHR(fPresentQueue, &presentInfo); |
| 602 | 601 |
| 603 } | 602 } |
| 604 | 603 |
| 605 } //namespace sk_app | 604 } //namespace sk_app |
| OLD | NEW |