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

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

Issue 2325773003: cc: Plumb the monitor color profile to renderer for rasterization (Closed)
Patch Set: Make public_deps instead of deps 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 unified diff | Download patch
« ui/display/display.h ('K') | « ui/display/display.h ('k') | no next file » | 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } else { 64 } else {
65 display.set_bounds(gfx::ScreenRectFromNSRect(frame)); 65 display.set_bounds(gfx::ScreenRectFromNSRect(frame));
66 display.set_work_area(gfx::ScreenRectFromNSRect(visible_frame)); 66 display.set_work_area(gfx::ScreenRectFromNSRect(visible_frame));
67 } 67 }
68 CGFloat scale = [screen backingScaleFactor]; 68 CGFloat scale = [screen backingScaleFactor];
69 69
70 if (Display::HasForceDeviceScaleFactor()) 70 if (Display::HasForceDeviceScaleFactor())
71 scale = Display::GetForcedDeviceScaleFactor(); 71 scale = Display::GetForcedDeviceScaleFactor();
72 72
73 display.set_device_scale_factor(scale); 73 display.set_device_scale_factor(scale);
74
75 display.set_icc_profile(
76 gfx::ICCProfile::FromCGColorSpace([[screen colorSpace] CGColorSpace]));
77 display.set_color_depth(NSBitsPerPixelFromDepth([screen depth]));
78 display.set_depth_per_component(NSBitsPerSampleFromDepth([screen depth]));
79
74 // CGDisplayRotation returns a double. Display::SetRotationAsDegree will 80 // CGDisplayRotation returns a double. Display::SetRotationAsDegree will
75 // handle the unexpected situations were the angle is not a multiple of 90. 81 // handle the unexpected situations were the angle is not a multiple of 90.
76 display.SetRotationAsDegree(static_cast<int>(CGDisplayRotation(display_id))); 82 display.SetRotationAsDegree(static_cast<int>(CGDisplayRotation(display_id)));
77 return display; 83 return display;
78 } 84 }
79 85
80 // Returns the minimum Manhattan distance from |point| to corners of |screen| 86 // Returns the minimum Manhattan distance from |point| to corners of |screen|
81 // frame. 87 // frame.
82 CGFloat GetMinimumDistanceToCorner(const NSPoint& point, NSScreen* screen) { 88 CGFloat GetMinimumDistanceToCorner(const NSPoint& point, NSScreen* screen) {
83 NSRect frame = [screen frame]; 89 NSRect frame = [screen frame];
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 286
281 } // namespace 287 } // namespace
282 288
283 #if !defined(USE_AURA) 289 #if !defined(USE_AURA)
284 Screen* CreateNativeScreen() { 290 Screen* CreateNativeScreen() {
285 return new ScreenMac; 291 return new ScreenMac;
286 } 292 }
287 #endif 293 #endif
288 294
289 } // namespace display 295 } // namespace display
OLDNEW
« ui/display/display.h ('K') | « ui/display/display.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698