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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/display/mac/screen_mac.mm » ('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 "content/browser/renderer_host/render_widget_host_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <OpenGL/gl.h> 8 #include <OpenGL/gl.h>
9 #include <QuartzCore/QuartzCore.h> 9 #include <QuartzCore/QuartzCore.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 3175 matching lines...) Expand 10 before | Expand all | Expand 10 after
3186 event.button = WebMouseEvent::Button::Left; 3186 event.button = WebMouseEvent::Button::Left;
3187 renderWidgetHostView_->ForwardMouseEvent(event); 3187 renderWidgetHostView_->ForwardMouseEvent(event);
3188 3188
3189 hasOpenMouseDown_ = NO; 3189 hasOpenMouseDown_ = NO;
3190 } 3190 }
3191 } 3191 }
3192 3192
3193 - (void)viewDidChangeBackingProperties { 3193 - (void)viewDidChangeBackingProperties {
3194 NSScreen* screen = [[self window] screen]; 3194 NSScreen* screen = [[self window] screen];
3195 if (screen) { 3195 if (screen) {
3196 CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace];
3197 // On Sierra, we need to operate in a single screen's color space because
3198 // IOSurfaces do not opt-out of color correction.
3199 // https://crbug.com/654488
3200 if (base::mac::IsAtLeastOS10_12())
3201 color_space = base::mac::GetSystemColorSpace();
3196 gfx::ICCProfile icc_profile = 3202 gfx::ICCProfile icc_profile =
3197 gfx::ICCProfile::FromCGColorSpace([[screen colorSpace] CGColorSpace]); 3203 gfx::ICCProfile::FromCGColorSpace(color_space);
3198 renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace( 3204 renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace(
3199 icc_profile.GetColorSpace()); 3205 icc_profile.GetColorSpace());
3200 } 3206 }
3201 } 3207 }
3202 3208
3203 - (void)undo:(id)sender { 3209 - (void)undo:(id)sender {
3204 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); 3210 WebContents* web_contents = renderWidgetHostView_->GetWebContents();
3205 if (web_contents) 3211 if (web_contents)
3206 web_contents->Undo(); 3212 web_contents->Undo();
3207 } 3213 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
3362 3368
3363 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3369 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3364 // regions that are not draggable. (See ControlRegionView in 3370 // regions that are not draggable. (See ControlRegionView in
3365 // native_app_window_cocoa.mm). This requires the render host view to be 3371 // native_app_window_cocoa.mm). This requires the render host view to be
3366 // draggable by default. 3372 // draggable by default.
3367 - (BOOL)mouseDownCanMoveWindow { 3373 - (BOOL)mouseDownCanMoveWindow {
3368 return YES; 3374 return YES;
3369 } 3375 }
3370 3376
3371 @end 3377 @end
OLDNEW
« 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