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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace webrtc { | 31 namespace webrtc { |
32 | 32 |
33 namespace { | 33 namespace { |
34 // Paint the image, so that we can get a bitmap representation compatible with | 34 // Paint the image, so that we can get a bitmap representation compatible with |
35 // current context. For example, in the retina display, we are going to get an | 35 // current context. For example, in the retina display, we are going to get an |
36 // image with same visual size but underlying pixel size conforms to the retina | 36 // image with same visual size but underlying pixel size conforms to the retina |
37 // setting. | 37 // setting. |
38 NSImage* PaintInCurrentContext(NSImage* source) { | 38 NSImage* PaintInCurrentContext(NSImage* source) { |
39 NSSize size = [source size]; | 39 NSSize size = [source size]; |
40 NSImage* new_image = [[[NSImage alloc] initWithSize:size] autorelease]; | 40 NSImage* new_image = [[NSImage alloc] initWithSize:size]; |
41 [new_image lockFocus]; | 41 [new_image lockFocus]; |
42 NSRect frame = NSMakeRect(0, 0, size.width, size.height); | 42 NSRect frame = NSMakeRect(0, 0, size.width, size.height); |
43 [source drawInRect:frame | 43 [source drawInRect:frame |
44 fromRect:frame | 44 fromRect:frame |
45 operation:NSCompositeCopy | 45 operation:NSCompositeCopy |
46 fraction:1.0]; | 46 fraction:1.0]; |
47 [new_image unlockFocus]; | 47 [new_image unlockFocus]; |
48 return new_image; | 48 return new_image; |
49 } | 49 } |
50 } // namespace | 50 } // namespace |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 return new MouseCursorMonitorMac(options, window, kInvalidScreenId); | 318 return new MouseCursorMonitorMac(options, window, kInvalidScreenId); |
319 } | 319 } |
320 | 320 |
321 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( | 321 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( |
322 const DesktopCaptureOptions& options, | 322 const DesktopCaptureOptions& options, |
323 ScreenId screen) { | 323 ScreenId screen) { |
324 return new MouseCursorMonitorMac(options, kCGNullWindowID, screen); | 324 return new MouseCursorMonitorMac(options, kCGNullWindowID, screen); |
325 } | 325 } |
326 | 326 |
327 } // namespace webrtc | 327 } // namespace webrtc |
OLD | NEW |