Browse Source

Schedule a full render pass on CompositionBatchCompletion to prevent tearing (#19487)

release/11.3.5
Nikita Tsukanov 6 months ago
committed by Julien Lebosquain
parent
commit
546a95c673
  1. 18
      src/Avalonia.Base/Media/MediaContext.Compositor.cs

18
src/Avalonia.Base/Media/MediaContext.Compositor.cs

@ -49,24 +49,12 @@ partial class MediaContext
{
_animationsAreWaitingForComposition = false;
// Check if we have uncommited changes
if (_requestedCommits.Count != 0)
{
if (!CommitCompositorsWithThrottling())
ScheduleRenderForAnimationsIfNeeded();
}
// Check if there are active animations and schedule the next render
else
ScheduleRenderForAnimationsIfNeeded();
// Check if we have requested commits or active animations and schedule a new render pass
if (_requestedCommits.Count != 0 || _clock.HasSubscriptions)
ScheduleRender(false);
}
}
void ScheduleRenderForAnimationsIfNeeded()
{
if (_clock.HasSubscriptions)
ScheduleRender(false);
}
/// <summary>
/// Triggers a composition commit if any batches are waiting to be sent,

Loading…
Cancel
Save