| 331 | } |
| 332 | |
| 333 | uint32_t LookupFrameId( |
| 334 | PMTraceConsumer* pmConsumer, |
| 335 | uint64_t CompositionSurfaceLuid, |
| 336 | uint64_t PresentCount, |
| 337 | uint64_t BindId) |
| 338 | { |
| 339 | // pmConsumer can complete presents before they've seen all of |
| 340 | // their TokenStateChanged_Info events, so we keep a copy of the |
| 341 | // token->present id map here simply so we can print what present |
| 342 | // the event refers to. |
| 343 | static std::unordered_map< |
| 344 | PMTraceConsumer::Win32KPresentHistoryToken, |
| 345 | uint32_t, |
| 346 | PMTraceConsumer::Win32KPresentHistoryTokenHash> tokenToIdMap; |
| 347 | |
| 348 | PMTraceConsumer::Win32KPresentHistoryToken key(CompositionSurfaceLuid, PresentCount, BindId); |
| 349 | auto ii = pmConsumer->mPresentByWin32KPresentHistoryToken.find(key); |
| 350 | if (ii != pmConsumer->mPresentByWin32KPresentHistoryToken.end()) { |
| 351 | tokenToIdMap[key] = ii->second->FrameId; |
| 352 | return ii->second->FrameId; |
| 353 | } |
| 354 | |
| 355 | auto jj = tokenToIdMap.find(key); |
| 356 | if (jj != tokenToIdMap.end()) { |
| 357 | return jj->second; |
| 358 | } |
| 359 | |
| 360 | return 0; |
| 361 | } |
| 362 | |
| 363 | } |
| 364 |
no test coverage detected