OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace webrtc { | 30 namespace webrtc { |
31 | 31 |
32 namespace { | 32 namespace { |
33 // Paint the image, so that we can get a bitmap representation compatible with | 33 // Paint the image, so that we can get a bitmap representation compatible with |
34 // current context. For example, in the retina display, we are going to get an | 34 // current context. For example, in the retina display, we are going to get an |
35 // image with same visual size but underlying pixel size conforms to the retina | 35 // image with same visual size but underlying pixel size conforms to the retina |
36 // setting. | 36 // setting. |
37 NSImage* PaintInCurrentContext(NSImage* source) { | 37 NSImage* PaintInCurrentContext(NSImage* source) { |
38 NSSize size = [source size]; | 38 NSSize size = [source size]; |
39 NSImage* new_image = [[[NSImage alloc] initWithSize:size] autorelease]; | 39 NSImage* new_image = [[NSImage alloc] initWithSize:size]; |
40 [new_image lockFocus]; | 40 [new_image lockFocus]; |
41 NSRect frame = NSMakeRect(0, 0, size.width, size.height); | 41 NSRect frame = NSMakeRect(0, 0, size.width, size.height); |
42 [source drawInRect:frame | 42 [source drawInRect:frame |
43 fromRect:frame | 43 fromRect:frame |
44 operation:NSCompositeCopy | 44 operation:NSCompositeCopy |
45 fraction:1.0]; | 45 fraction:1.0]; |
46 [new_image unlockFocus]; | 46 [new_image unlockFocus]; |
47 return new_image; | 47 return new_image; |
48 } | 48 } |
49 } // namespace | 49 } // namespace |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 return new MouseCursorMonitorMac(options, window, kInvalidScreenId); | 317 return new MouseCursorMonitorMac(options, window, kInvalidScreenId); |
318 } | 318 } |
319 | 319 |
320 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( | 320 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( |
321 const DesktopCaptureOptions& options, | 321 const DesktopCaptureOptions& options, |
322 ScreenId screen) { | 322 ScreenId screen) { |
323 return new MouseCursorMonitorMac(options, kCGNullWindowID, screen); | 323 return new MouseCursorMonitorMac(options, kCGNullWindowID, screen); |
324 } | 324 } |
325 | 325 |
326 } // namespace webrtc | 326 } // namespace webrtc |
OLD | NEW |