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 25 matching lines...) Expand all Loading... | |
36 rect.left + border.width(), | 36 rect.left + border.width(), |
37 rect.top, | 37 rect.top, |
38 rect.right - border.width(), | 38 rect.right - border.width(), |
39 rect.bottom - border.height()); | 39 rect.bottom - border.height()); |
40 } else { | 40 } else { |
41 *cropped_rect = *original_rect; | 41 *cropped_rect = *original_rect; |
42 } | 42 } |
43 return true; | 43 return true; |
44 } | 44 } |
45 | 45 |
46 AeroChecker::AeroChecker() : dwmapi_library_(NULL), func_(NULL) {} | |
Sergey Ulanov
2015/07/14 23:11:16
nit: s/NULL/nullptr/
jiayl2
2015/07/15 23:15:21
Done.
| |
47 | |
48 AeroChecker::~AeroChecker() { | |
49 if (dwmapi_library_) { | |
50 FreeLibrary(dwmapi_library_); | |
51 } | |
52 } | |
53 | |
54 bool AeroChecker::IsAeroEnabled() { | |
55 // Try to load dwmapi.dll dynamically since it is not available on XP. | |
56 if (dwmapi_library_ == NULL) { | |
57 dwmapi_library_ = LoadLibrary(L"dwmapi.dll"); | |
Sergey Ulanov
2015/07/14 23:11:16
Move this to the constructor so you don't try to l
jiayl2
2015/07/15 23:15:21
Done.
| |
58 if (dwmapi_library_) { | |
59 func_ = reinterpret_cast<DwmIsCompositionEnabledFunc>( | |
60 GetProcAddress(dwmapi_library_, "DwmIsCompositionEnabled")); | |
61 } | |
62 } | |
63 BOOL result = FALSE; | |
64 if (func_) { | |
65 func_(&result); | |
66 } | |
67 return result != FALSE; | |
68 } | |
69 | |
46 } // namespace webrtc | 70 } // namespace webrtc |
OLD | NEW |