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

Side by Side Diff: ui/display/mac/screen_mac.mm

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 | « ui/compositor/compositor_util.cc ('k') | ui/gfx/color_space_switches.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 // 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 "ui/display/screen.h" 5 #include "ui/display/screen.h"
6 6
7 #import <ApplicationServices/ApplicationServices.h> 7 #import <ApplicationServices/ApplicationServices.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (Display::HasForceDeviceScaleFactor()) 77 if (Display::HasForceDeviceScaleFactor())
78 scale = Display::GetForcedDeviceScaleFactor(); 78 scale = Display::GetForcedDeviceScaleFactor();
79 79
80 display.set_device_scale_factor(scale); 80 display.set_device_scale_factor(scale);
81 81
82 // On Sierra, we need to operate in a single screen's color space because 82 // On Sierra, we need to operate in a single screen's color space because
83 // IOSurfaces do not opt-out of color correction. 83 // IOSurfaces do not opt-out of color correction.
84 // https://crbug.com/654488 84 // https://crbug.com/654488
85 CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace]; 85 CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace];
86 static bool color_correct_rendering_enabled = 86 static bool color_correct_rendering_enabled =
87 base::CommandLine::ForCurrentProcess()->HasSwitch( 87 base::FeatureList::IsEnabled(features::kColorCorrectRendering);
88 switches::kEnableColorCorrectRendering);
89 if (base::mac::IsAtLeastOS10_12() && !color_correct_rendering_enabled) 88 if (base::mac::IsAtLeastOS10_12() && !color_correct_rendering_enabled)
90 color_space = base::mac::GetSystemColorSpace(); 89 color_space = base::mac::GetSystemColorSpace();
91 90
92 display.set_icc_profile(gfx::ICCProfile::FromCGColorSpace(color_space)); 91 display.set_icc_profile(gfx::ICCProfile::FromCGColorSpace(color_space));
93 display.set_color_depth(NSBitsPerPixelFromDepth([screen depth])); 92 display.set_color_depth(NSBitsPerPixelFromDepth([screen depth]));
94 display.set_depth_per_component(NSBitsPerSampleFromDepth([screen depth])); 93 display.set_depth_per_component(NSBitsPerSampleFromDepth([screen depth]));
95 display.set_is_monochrome(CGDisplayUsesForceToGray()); 94 display.set_is_monochrome(CGDisplayUsesForceToGray());
96 95
97 // CGDisplayRotation returns a double. Display::SetRotationAsDegree will 96 // CGDisplayRotation returns a double. Display::SetRotationAsDegree will
98 // handle the unexpected situations were the angle is not a multiple of 90. 97 // handle the unexpected situations were the angle is not a multiple of 90.
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 return window; 344 return window;
346 } 345 }
347 346
348 #if !defined(USE_AURA) 347 #if !defined(USE_AURA)
349 Screen* CreateNativeScreen() { 348 Screen* CreateNativeScreen() {
350 return new ScreenMac; 349 return new ScreenMac;
351 } 350 }
352 #endif 351 #endif
353 352
354 } // namespace display 353 } // namespace display
OLDNEW
« no previous file with comments | « ui/compositor/compositor_util.cc ('k') | ui/gfx/color_space_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698