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

Unified Diff: ui/display/mac/screen_mac.mm

Issue 2325773003: cc: Plumb the monitor color profile to renderer for rasterization (Closed)
Patch Set: Unrevert Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/display.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/mac/screen_mac.mm
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 4621dfabc766680ad8cf21748b11d791ba9678e8..08eb61de60974073d84899ef43147e11913b6d3d 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -19,6 +19,10 @@
#include "ui/display/display_change_notifier.h"
#include "ui/gfx/mac/coordinate_conversion.h"
+extern "C" {
+Boolean CGDisplayUsesForceToGray(void);
+}
+
namespace display {
namespace {
@@ -71,6 +75,13 @@ Display GetDisplayForScreen(NSScreen* screen) {
scale = Display::GetForcedDeviceScaleFactor();
display.set_device_scale_factor(scale);
+
+ display.set_icc_profile(
+ gfx::ICCProfile::FromCGColorSpace([[screen colorSpace] CGColorSpace]));
+ display.set_color_depth(NSBitsPerPixelFromDepth([screen depth]));
+ display.set_depth_per_component(NSBitsPerSampleFromDepth([screen depth]));
+ display.set_is_monochrome(CGDisplayUsesForceToGray());
+
// CGDisplayRotation returns a double. Display::SetRotationAsDegree will
// handle the unexpected situations were the angle is not a multiple of 90.
display.SetRotationAsDegree(static_cast<int>(CGDisplayRotation(display_id)));
« no previous file with comments | « ui/display/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698