Skip to content

Commit

Permalink
Add about:flags to force color profile
Browse files Browse the repository at this point in the history
Add an about:flag to force a specific color profile, and add some common
options to this flag. In particular:
  * sRGB, since it's the standard color space
  * Display P3, since it is a common wide gamut profile
  * scRGB Linear, since that will force HDR mode on Windows 10
  * A color spin non-standard gamma space, for testing

Some users who have wide color gamut monitors want the over-saturated
that non-color-correct rendering provided. For these users, on Chrome
61, they must either disable the color correct rendering feature, or
remove their system-installed color profile.

These users who want oversaturated colors on Windows and Linux will have
the option of forcing sRGB as their color profile in about:flags in
Chrome 62 and beyond.

R=hubbe
TBR=holte

Bug: 755747
Change-Id: I80b37432ca42bd0500b443b892bc754727c3f7b7
Reviewed-on: https://chromium-review.googlesource.com/655802
Reviewed-by: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Fredrik Hubinette <hubbe@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500439}
  • Loading branch information
ccameron-chromium authored and Commit Bot committed Sep 7, 2017
1 parent bd6147c commit ceb8727
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
16 changes: 16 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,18 @@ const FeatureEntry::Choice kEnableAudioFocusChoices[] = {
};
#endif // !defined(OS_ANDROID)

const FeatureEntry::Choice kForceColorProfileChoices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
{flag_descriptions::kForceColorProfileSRGB, switches::kForceColorProfile,
"srgb"},
{flag_descriptions::kForceColorProfileP3, switches::kForceColorProfile,
"display-p3-d65"},
{flag_descriptions::kForceColorProfileColorSpin,
switches::kForceColorProfile, "color-spin-gamma24"},
{flag_descriptions::kForceColorProfileHdr, switches::kForceColorProfile,
"scrgb-linear"},
};

const FeatureEntry::Choice kAutoplayPolicyChoices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
{flag_descriptions::kAutoplayPolicyNoUserGestureRequired,
Expand Down Expand Up @@ -3096,6 +3108,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kColorCorrectRenderingDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kColorCorrectRendering)},

{"force-color-profile", flag_descriptions::kForceColorProfileName,
flag_descriptions::kForceColorProfileDescription, kOsAll,
MULTI_VALUE_TYPE(kForceColorProfileChoices)},

#if defined(OS_CHROMEOS)
{"quick-unlock-pin-signin", flag_descriptions::kQuickUnlockPinSignin,
flag_descriptions::kQuickUnlockPinSigninDescription, kOsCrOS,
Expand Down
10 changes: 10 additions & 0 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ const char kColorCorrectRenderingName[] = "Color correct rendering";
const char kColorCorrectRenderingDescription[] =
"Enables color correct rendering of web content.";

const char kForceColorProfileSRGB[] = "sRGB";
const char kForceColorProfileP3[] = "Display P3 D65";
const char kForceColorProfileColorSpin[] = "Color spin with gamma 2.4";
const char kForceColorProfileHdr[] = "scRGB linear (HDR where available)";

const char kForceColorProfileName[] = "Force color profile";
const char kForceColorProfileDescription[] =
"Forces Chrome to use a specific color profile instead of the color "
"of the window's current monitor, as specified by the operating system.";

const char kCompositedLayerBordersName[] = "Composited render layer borders";
const char kCompositedLayerBordersDescription[] =
"Renders a border around composited Render Layers to help debug and study "
Expand Down
8 changes: 8 additions & 0 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ extern const char kCloudImportDescription[];
extern const char kColorCorrectRenderingName[];
extern const char kColorCorrectRenderingDescription[];

extern const char kForceColorProfileSRGB[];
extern const char kForceColorProfileP3[];
extern const char kForceColorProfileColorSpin[];
extern const char kForceColorProfileHdr[];

extern const char kForceColorProfileName[];
extern const char kForceColorProfileDescription[];

extern const char kCompositedLayerBordersName[];
extern const char kCompositedLayerBordersDescription[];

Expand Down
1 change: 1 addition & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23883,6 +23883,7 @@ from previous Chrome versions.
<int value="605150752" label="WebUSB:disabled"/>
<int value="606288133" label="enable-print-preview-register-promos"/>
<int value="606512202" label="AutofillCreditCardPopupLayout:enabled"/>
<int value="606834606" label="force-color-profile"/>
<int value="609112512" label="touch-selection-strategy"/>
<int value="610545308" label="enable-potentially-annoying-security-features"/>
<int value="624317932" label="print-pdf-as-image"/>
Expand Down
2 changes: 2 additions & 0 deletions ui/display/display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ gfx::ColorSpace Display::GetForcedColorProfile() {
switches::kForceColorProfile);
if (value == "srgb") {
return gfx::ColorSpace::CreateSRGB();
} else if (value == "display-p3-d65") {
return gfx::ColorSpace::CreateDisplayP3D65();
} else if (value == "scrgb-linear") {
return gfx::ColorSpace::CreateSCRGBLinear();
} else if (value == "extended-srgb") {
Expand Down

0 comments on commit ceb8727

Please sign in to comment.