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

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

Issue 2069173002: Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bad assert Created 4 years, 6 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/GLWindowContext.cpp ('k') | tools/viewer/sk_app/WindowContext.cpp » ('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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/GLWindowContext.cpp ('k') | tools/viewer/sk_app/WindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698