| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 callback_ = callback; | 79 callback_ = callback; |
| 80 mode_ = mode; | 80 mode_ = mode; |
| 81 | 81 |
| 82 desktop_dc_ = GetDC(NULL); | 82 desktop_dc_ = GetDC(NULL); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void MouseCursorMonitorWin::Capture() { | 85 void MouseCursorMonitorWin::Capture() { |
| 86 assert(callback_); | 86 assert(callback_); |
| 87 | 87 |
| 88 CURSORINFO cursor_info; | 88 CURSORINFO cursor_info = { 0 }; |
| 89 cursor_info.cbSize = sizeof(CURSORINFO); | 89 cursor_info.cbSize = sizeof(CURSORINFO); |
| 90 if (!GetCursorInfo(&cursor_info)) { | 90 if (!GetCursorInfo(&cursor_info)) { |
| 91 LOG_F(LS_ERROR) << "Unable to get cursor info. Error = " << GetLastError(); | 91 LOG_F(LS_ERROR) << "Unable to get cursor info. Error = " << GetLastError(); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 if (last_cursor_ != cursor_info.hCursor) { | 95 if (last_cursor_ != cursor_info.hCursor) { |
| 96 last_cursor_ = cursor_info.hCursor; | 96 last_cursor_ = cursor_info.hCursor; |
| 97 // Note that |cursor_info.hCursor| does not need to be freed. | 97 // Note that |cursor_info.hCursor| does not need to be freed. |
| 98 std::unique_ptr<MouseCursor> cursor( | 98 std::unique_ptr<MouseCursor> cursor( |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 return new MouseCursorMonitorWin(reinterpret_cast<HWND>(window)); | 166 return new MouseCursorMonitorWin(reinterpret_cast<HWND>(window)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( | 169 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( |
| 170 const DesktopCaptureOptions& options, | 170 const DesktopCaptureOptions& options, |
| 171 ScreenId screen) { | 171 ScreenId screen) { |
| 172 return new MouseCursorMonitorWin(screen); | 172 return new MouseCursorMonitorWin(screen); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace webrtc | 175 } // namespace webrtc |
| OLD | NEW |