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

Side by Side Diff: content/shell/app/shell_main_delegate.cc

Issue 2945453002: color: Use base::Feature to control color correct rendering (Closed)
Patch Set: Add histogram enum Created 3 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 | « content/renderer/gpu/render_widget_compositor.cc ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/app/shell_main_delegate.h" 5 #include "content/shell/app/shell_main_delegate.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 command_line.AppendSwitchASCII(switches::kHostResolverRules, 206 command_line.AppendSwitchASCII(switches::kHostResolverRules,
207 "MAP *.test 127.0.0.1"); 207 "MAP *.test 127.0.0.1");
208 208
209 command_line.AppendSwitch(switches::kEnablePartialRaster); 209 command_line.AppendSwitch(switches::kEnablePartialRaster);
210 210
211 if (!command_line.HasSwitch(switches::kForceGpuRasterization) && 211 if (!command_line.HasSwitch(switches::kForceGpuRasterization) &&
212 !command_line.HasSwitch(switches::kEnableGpuRasterization)) { 212 !command_line.HasSwitch(switches::kEnableGpuRasterization)) {
213 command_line.AppendSwitch(switches::kDisableGpuRasterization); 213 command_line.AppendSwitch(switches::kDisableGpuRasterization);
214 } 214 }
215 215
216 // Enable color correct rendering. If the virtual test suite didn't specify 216 // If the virtual test suite didn't specify a color space, then force sRGB.
217 // a color space, then use sRGB.
218 command_line.AppendSwitch(switches::kEnableColorCorrectRendering);
219 if (!command_line.HasSwitch(switches::kForceColorProfile)) 217 if (!command_line.HasSwitch(switches::kForceColorProfile))
220 command_line.AppendSwitchASCII(switches::kForceColorProfile, "srgb"); 218 command_line.AppendSwitchASCII(switches::kForceColorProfile, "srgb");
221 219
222 // We want stable/baseline results when running layout tests. 220 // We want stable/baseline results when running layout tests.
223 command_line.AppendSwitch(switches::kDisableSkiaRuntimeOpts); 221 command_line.AppendSwitch(switches::kDisableSkiaRuntimeOpts);
224 222
225 command_line.AppendSwitch(cc::switches::kDisallowNonExactResourceReuse); 223 command_line.AppendSwitch(cc::switches::kDisallowNonExactResourceReuse);
226 224
227 // Unless/until WebM files are added to the media layout tests, we need to 225 // Unless/until WebM files are added to the media layout tests, we need to
228 // avoid removing MP4/H264/AAC so that layout tests can run on Android. 226 // avoid removing MP4/H264/AAC so that layout tests can run on Android.
229 #if !defined(OS_ANDROID) 227 #if !defined(OS_ANDROID)
230 media::RemoveProprietaryMediaTypesAndCodecsForTests(); 228 media::RemoveProprietaryMediaTypesAndCodecsForTests();
231 #endif 229 #endif
232 230
233 if (!BlinkTestPlatformInitialize()) { 231 if (!BlinkTestPlatformInitialize()) {
234 *exit_code = 1; 232 *exit_code = 1;
235 return true; 233 return true;
236 } 234 }
235
236 // Enable additional base::Features. Note that there already may exist a
237 // list of enabled features from the virtual or physical test suite.
238 std::string enabled_features =
239 command_line.GetSwitchValueASCII(switches::kEnableFeatures);
240 enabled_features = "ColorCorrectRendering," + enabled_features;
241 command_line.AppendSwitchASCII(switches::kEnableFeatures, enabled_features);
237 } 242 }
238 243
239 content_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch( 244 content_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch(
240 switches::kRunLayoutTest) 245 switches::kRunLayoutTest)
241 ? new LayoutTestContentClient 246 ? new LayoutTestContentClient
242 : new ShellContentClient); 247 : new ShellContentClient);
243 SetContentClient(content_client_.get()); 248 SetContentClient(content_client_.get());
244 249
245 return false; 250 return false;
246 } 251 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 386
382 return renderer_client_.get(); 387 return renderer_client_.get();
383 } 388 }
384 389
385 ContentUtilityClient* ShellMainDelegate::CreateContentUtilityClient() { 390 ContentUtilityClient* ShellMainDelegate::CreateContentUtilityClient() {
386 utility_client_.reset(new ShellContentUtilityClient); 391 utility_client_.reset(new ShellContentUtilityClient);
387 return utility_client_.get(); 392 return utility_client_.get();
388 } 393 }
389 394
390 } // namespace content 395 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698