Bug 1143575. Exit composition early if nothing is invalid. r=mattwoodrow

We need this change so that when ImageHost has a next image to display
more than one composition-interval in the future, we skip the actual
compositing work in those intermediate composition(s) if nothing else
has changed.

This change is a little bit scary since it breaks any code that was
previously assuming ScheduleComposition would actually update the screen.
However, that code was already broken for BasicCompositor.

--HG--
extra : commitid : FUFFaJDSwfu
extra : rebase_source : eb2d5fadd5dbd417e7a25c05b148bd8964e8c2a3
This commit is contained in:
Robert O'Callahan 2015-05-15 18:27:04 +12:00
Родитель 008359665e
Коммит 66a72d1a69
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -283,7 +283,12 @@ LayerManagerComposite::EndTransaction(const TimeStamp& aTimeStamp,
mInvalidRegion.Or(mInvalidRegion, mRenderBounds);
}
if (mRoot && !(aFlags & END_NO_IMMEDIATE_REDRAW)) {
if (mInvalidRegion.IsEmpty() && !mTarget) {
// Composition requested, but nothing has changed. Don't do any work.
return;
}
if (mRoot && !(aFlags & END_NO_IMMEDIATE_REDRAW)) {
MOZ_ASSERT(!aTimeStamp.IsNull());
// Set composition timestamp here because we need it in
// ComputeEffectiveTransforms (so the correct video frame size is picked)