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

Side by Side Diff: tools/flags/SkCommonFlagsConfig.cpp

Issue 2547603002: Revert of Enable sRGB on iOS, make sRGB decode support optional (Closed)
Patch Set: Created 4 years 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 | « tests/SRGBMipMapTest.cpp ('k') | tools/gpu/GrContextFactory.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkColorSpace_Base.h" 8 #include "SkColorSpace_Base.h"
9 #include "SkCommonFlagsConfig.h" 9 #include "SkCommonFlagsConfig.h"
10 #include "SkImageInfo.h" 10 #include "SkImageInfo.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 , fUseDIText(useDIText) 178 , fUseDIText(useDIText)
179 , fSamples(samples) 179 , fSamples(samples)
180 , fColorType(colorType) 180 , fColorType(colorType)
181 , fColorSpace(std::move(colorSpace)) { 181 , fColorSpace(std::move(colorSpace)) {
182 if (useNVPR) { 182 if (useNVPR) {
183 fContextOptions |= ContextOptions::kEnableNVPR; 183 fContextOptions |= ContextOptions::kEnableNVPR;
184 } 184 }
185 if (useInstanced) { 185 if (useInstanced) {
186 fContextOptions |= ContextOptions::kUseInstanced; 186 fContextOptions |= ContextOptions::kUseInstanced;
187 } 187 }
188 // Subtle logic: If the config has a color space attached, we're going to be rendering to sRGB,
189 // so we need that capability. In addition, to get the widest test coverage, we DO NOT require
190 // that we can disable sRGB decode. (That's for rendering sRGB sources to le gacy surfaces).
191 //
192 // If the config doesn't have a color space attached, we're going to be rend ering in legacy
193 // mode. In that case, we can't allow a context to be created that has sRGB support without
194 // the ability to disable sRGB decode. Otherwise, all of our sRGB source res ources will be
195 // treated as sRGB textures, but we will be unable to prevent the decode, ca using them to be
196 // too dark.
197 if (fColorSpace) { 188 if (fColorSpace) {
198 fContextOptions |= ContextOptions::kRequireSRGBSupport; 189 fContextOptions |= ContextOptions::kRequireSRGBSupport;
199 } else {
200 fContextOptions |= ContextOptions::kRequireSRGBDecodeDisableSupport;
201 } 190 }
202 } 191 }
203 static bool parse_option_int(const SkString& value, int* outInt) { 192 static bool parse_option_int(const SkString& value, int* outInt) {
204 if (value.isEmpty()) { 193 if (value.isEmpty()) {
205 return false; 194 return false;
206 } 195 }
207 char* endptr = nullptr; 196 char* endptr = nullptr;
208 long intValue = strtol(value.c_str(), &endptr, 10); 197 long intValue = strtol(value.c_str(), &endptr, 10);
209 if (*endptr != '\0') { 198 if (*endptr != '\0') {
210 return false; 199 return false;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 if (extendedBackend.equals("gpu")) { 440 if (extendedBackend.equals("gpu")) {
452 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti ons); 441 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti ons);
453 } 442 }
454 #endif 443 #endif
455 if (!parsedConfig) { 444 if (!parsedConfig) {
456 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); 445 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias);
457 } 446 }
458 outResult->emplace_back(parsedConfig); 447 outResult->emplace_back(parsedConfig);
459 } 448 }
460 } 449 }
OLDNEW
« no previous file with comments | « tests/SRGBMipMapTest.cpp ('k') | tools/gpu/GrContextFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698