| 1034 | } |
| 1035 | |
| 1036 | bool RenderDoc::MatchClosestWindow(DeviceOwnedWindow &devWnd) |
| 1037 | { |
| 1038 | SCOPED_LOCK(m_CapturerListLock); |
| 1039 | |
| 1040 | // lower_bound and the DeviceWnd ordering (pointer compares, dev over wnd) means that if either |
| 1041 | // element in devWnd is NULL we can go forward from this iterator and find the first wildcardMatch |
| 1042 | // note that if dev is specified and wnd is NULL, this will actually point at the first |
| 1043 | // wildcardMatch already and we can use it immediately (since which window of multiple we |
| 1044 | // choose is undefined, so up to us). If dev is NULL there is no window ordering (since dev is |
| 1045 | // the primary sorting value) so we just iterate through the whole map. It should be small in |
| 1046 | // the majority of cases |
| 1047 | auto it = m_WindowFrameCapturers.lower_bound(devWnd); |
| 1048 | |
| 1049 | while(it != m_WindowFrameCapturers.end()) |
| 1050 | { |
| 1051 | if(it->first.wildcardMatch(devWnd)) |
| 1052 | break; |
| 1053 | ++it; |
| 1054 | } |
| 1055 | |
| 1056 | if(it != m_WindowFrameCapturers.end()) |
| 1057 | { |
| 1058 | devWnd = it->first; |
| 1059 | return true; |
| 1060 | } |
| 1061 | |
| 1062 | return false; |
| 1063 | } |
| 1064 | |
| 1065 | bool RenderDoc::IsActiveWindow(DeviceOwnedWindow devWnd) |
| 1066 | { |
no test coverage detected