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

Unified Diff: content/browser/renderer_host/render_widget_host_view_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 | « no previous file | ui/display/mac/screen_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index be346a8ed2df94b737dde79f7dad6e34f76af1d8..c81f211e3a5205e6f96f712e7474a290b7b20e5b 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -3193,8 +3193,14 @@ - (void)viewDidMoveToWindow {
- (void)viewDidChangeBackingProperties {
NSScreen* screen = [[self window] screen];
if (screen) {
+ CGColorSpaceRef color_space = [[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
+ if (base::mac::IsAtLeastOS10_12())
+ color_space = base::mac::GetSystemColorSpace();
gfx::ICCProfile icc_profile =
- gfx::ICCProfile::FromCGColorSpace([[screen colorSpace] CGColorSpace]);
+ gfx::ICCProfile::FromCGColorSpace(color_space);
renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace(
icc_profile.GetColorSpace());
}
« no previous file with comments | « no previous file | ui/display/mac/screen_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698