Bug 1388466 - Sync focus sequence numbers when the compositor is reset. r=kats

When a compositor is recreated, either from a driver reset or a GPU process crash, the
focus sequence number in content persists, and when APZ is recreated, content will have
a higher sequence number.

There are two ways of handling this: either resetting all of content's focus sequence
numbers to zero to match the new focus state, or updating the new focus state to the
latest sequence number in content.

This commit does the latter by detecting when the focus state was newly created and
syncing it's sequence number to content if content is ahead.

MozReview-Commit-ID: GkIp7AWyaFw

--HG--
extra : source : b6339570bbd8576447f128359278868fb6d1d8e7
This commit is contained in:
Ryan Hunt 2017-08-10 15:07:35 -05:00
Родитель cd718a6989
Коммит 8013236c20
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -103,6 +103,14 @@ FocusState::Update(uint64_t aRootLayerTreeId,
// Mark what sequence number this target has so we can determine whether
// it is stale or not
mLastContentProcessedEvent = target.mSequenceNumber;
// If this focus state was just created and content has experienced more
// events then us, then assume we were recreated and sync focus sequence
// numbers.
if (mLastAPZProcessedEvent == 1 &&
mLastContentProcessedEvent > mLastAPZProcessedEvent) {
mLastAPZProcessedEvent = mLastContentProcessedEvent;
}
return;
}
case FocusTarget::eNone: {