| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const DesktopCaptureOptions& options) | 112 const DesktopCaptureOptions& options) |
| 113 : CroppingWindowCapturer(options) {} | 113 : CroppingWindowCapturer(options) {} |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 bool ShouldUseScreenCapturer() override; | 116 bool ShouldUseScreenCapturer() override; |
| 117 DesktopRect GetWindowRectInVirtualScreen() override; | 117 DesktopRect GetWindowRectInVirtualScreen() override; |
| 118 | 118 |
| 119 // The region from GetWindowRgn in the desktop coordinate if the region is | 119 // The region from GetWindowRgn in the desktop coordinate if the region is |
| 120 // rectangular, or the rect from GetWindowRect if the region is not set. | 120 // rectangular, or the rect from GetWindowRect if the region is not set. |
| 121 DesktopRect window_region_rect_; | 121 DesktopRect window_region_rect_; |
| 122 |
| 123 AeroChecker aero_checker_; |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 bool CroppingWindowCapturerWin::ShouldUseScreenCapturer() { | 126 bool CroppingWindowCapturerWin::ShouldUseScreenCapturer() { |
| 125 if (!rtc::IsWindows8OrLater()) | 127 if (!rtc::IsWindows8OrLater() && aero_checker_.IsAeroEnabled()) |
| 126 return false; | 128 return false; |
| 127 | 129 |
| 128 // Check if the window is a translucent layered window. | 130 // Check if the window is a translucent layered window. |
| 129 HWND selected = reinterpret_cast<HWND>(selected_window()); | 131 HWND selected = reinterpret_cast<HWND>(selected_window()); |
| 130 LONG window_ex_style = GetWindowLong(selected, GWL_EXSTYLE); | 132 LONG window_ex_style = GetWindowLong(selected, GWL_EXSTYLE); |
| 131 if (window_ex_style & WS_EX_LAYERED) { | 133 if (window_ex_style & WS_EX_LAYERED) { |
| 132 COLORREF color_ref_key = 0; | 134 COLORREF color_ref_key = 0; |
| 133 BYTE alpha = 0; | 135 BYTE alpha = 0; |
| 134 DWORD flags = 0; | 136 DWORD flags = 0; |
| 135 | 137 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 209 |
| 208 } // namespace | 210 } // namespace |
| 209 | 211 |
| 210 // static | 212 // static |
| 211 WindowCapturer* | 213 WindowCapturer* |
| 212 CroppingWindowCapturer::Create(const DesktopCaptureOptions& options) { | 214 CroppingWindowCapturer::Create(const DesktopCaptureOptions& options) { |
| 213 return new CroppingWindowCapturerWin(options); | 215 return new CroppingWindowCapturerWin(options); |
| 214 } | 216 } |
| 215 | 217 |
| 216 } // namespace webrtc | 218 } // namespace webrtc |
| OLD | NEW |