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

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

Issue 2072813002: Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 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
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
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