|
|
@ -40,10 +40,10 @@ partial class MediaContext |
|
|
_animationsAreWaitingForComposition = false; |
|
|
_animationsAreWaitingForComposition = false; |
|
|
|
|
|
|
|
|
// Check if we have uncommited changes
|
|
|
// Check if we have uncommited changes
|
|
|
if (_scheduleCommitOnLastCompositionBatchCompletion && _pendingCompositionBatches.Count > 0) |
|
|
if (_scheduleCommitOnLastCompositionBatchCompletion) |
|
|
{ |
|
|
{ |
|
|
CommitCompositorsWithThrottling(); |
|
|
|
|
|
_scheduleCommitOnLastCompositionBatchCompletion = false; |
|
|
_scheduleCommitOnLastCompositionBatchCompletion = false; |
|
|
|
|
|
CommitCompositorsWithThrottling(); |
|
|
} |
|
|
} |
|
|
// Check if there are active animations and schedule the next render
|
|
|
// Check if there are active animations and schedule the next render
|
|
|
else if(_clock.HasSubscriptions) |
|
|
else if(_clock.HasSubscriptions) |
|
|
@ -52,16 +52,23 @@ partial class MediaContext |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Triggers a composition commit if any batches are waiting to be sent,
|
|
|
|
|
|
/// handles throttling
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>true if there are pending commits in-flight and there will be a "all-done" callback later</returns>
|
|
|
private bool CommitCompositorsWithThrottling() |
|
|
private bool CommitCompositorsWithThrottling() |
|
|
{ |
|
|
{ |
|
|
// Check if we are still waiting for previous composition batches
|
|
|
// Check if we are still waiting for previous composition batches
|
|
|
if (_pendingCompositionBatches.Count > 0) |
|
|
if (_pendingCompositionBatches.Count > 0) |
|
|
{ |
|
|
{ |
|
|
_scheduleCommitOnLastCompositionBatchCompletion = true; |
|
|
_scheduleCommitOnLastCompositionBatchCompletion = true; |
|
|
|
|
|
// Previous commit isn't handled yet
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (_requestedCommits.Count == 0) |
|
|
if (_requestedCommits.Count == 0) |
|
|
|
|
|
// Nothing to do, and there are no pending commits
|
|
|
return false; |
|
|
return false; |
|
|
|
|
|
|
|
|
foreach (var c in _requestedCommits) |
|
|
foreach (var c in _requestedCommits) |
|
|
|