Index: webrtc/modules/desktop_capture/win/window_capture_utils.cc |
diff --git a/webrtc/modules/desktop_capture/win/window_capture_utils.cc b/webrtc/modules/desktop_capture/win/window_capture_utils.cc |
index bfe7363f32d8c69b64a59e2388b47cb1a6c08ef5..1acc5a89b9ebfd445dfe73153665868501d27752 100644 |
--- a/webrtc/modules/desktop_capture/win/window_capture_utils.cc |
+++ b/webrtc/modules/desktop_capture/win/window_capture_utils.cc |
@@ -43,4 +43,28 @@ GetCroppedWindowRect(HWND window, |
return true; |
} |
+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.
|
+ |
+AeroChecker::~AeroChecker() { |
+ if (dwmapi_library_) { |
+ FreeLibrary(dwmapi_library_); |
+ } |
+} |
+ |
+bool AeroChecker::IsAeroEnabled() { |
+ // Try to load dwmapi.dll dynamically since it is not available on XP. |
+ if (dwmapi_library_ == NULL) { |
+ 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.
|
+ if (dwmapi_library_) { |
+ func_ = reinterpret_cast<DwmIsCompositionEnabledFunc>( |
+ GetProcAddress(dwmapi_library_, "DwmIsCompositionEnabled")); |
+ } |
+ } |
+ BOOL result = FALSE; |
+ if (func_) { |
+ func_(&result); |
+ } |
+ return result != FALSE; |
+} |
+ |
} // namespace webrtc |