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

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

Issue 2480583002: Mac: Workaround IOSurface color behavior change in 10.12 (Closed)
Patch Set: Created 4 years, 1 month 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 | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | ui/gfx/mac/io_surface.cc » ('j') | 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 08eb61de60974073d84899ef43147e11913b6d3d..366662805fe4fc80a777fe9dc272278068326cb6 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -12,6 +12,7 @@
#include <memory>
#include "base/logging.h"
+#include "base/mac/mac_util.h"
#include "base/mac/sdk_forward_declarations.h"
#include "base/macros.h"
#include "base/timer/timer.h"
@@ -76,8 +77,14 @@ Display GetDisplayForScreen(NSScreen* screen) {
display.set_device_scale_factor(scale);
- display.set_icc_profile(
- gfx::ICCProfile::FromCGColorSpace([[screen colorSpace] CGColorSpace]));
+ // On Sierra, we need to operate in a single screen's color space because
+ // IOSurfaces do not opt-out of color correction.
+ // https://crbug.com/654488
+ CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace];
+ if (base::mac::IsAtLeastOS10_12())
+ color_space = base::mac::GetSystemColorSpace();
+
+ display.set_icc_profile(gfx::ICCProfile::FromCGColorSpace(color_space));
display.set_color_depth(NSBitsPerPixelFromDepth([screen depth]));
display.set_depth_per_component(NSBitsPerSampleFromDepth([screen depth]));
display.set_is_monochrome(CGDisplayUsesForceToGray());
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | ui/gfx/mac/io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698