Phase 3 refactor in progress
This commit is contained in:
@@ -3,8 +3,22 @@
|
||||
RenderStateCompositionResult RenderStateComposer::BuildFrameState(const RenderStateCompositionInput& input) const
|
||||
{
|
||||
RenderStateCompositionResult result;
|
||||
result.layerStates = input.baseLayerStates;
|
||||
if (!input.baseLayerStates)
|
||||
return result;
|
||||
|
||||
result.layerStates = *input.baseLayerStates;
|
||||
result.hasLayerStates = !result.layerStates.empty();
|
||||
if (input.liveState)
|
||||
input.liveState->ApplyToLayerStates(result.layerStates, input.liveStateOptions, &result.commitRequests);
|
||||
{
|
||||
RuntimeLiveStateApplyOptions options;
|
||||
options.allowCommit = input.allowLiveCommits;
|
||||
options.smoothing = input.liveSmoothing;
|
||||
options.commitDelay = input.liveCommitDelay;
|
||||
options.now = input.now;
|
||||
input.liveState->ApplyToLayerStates(
|
||||
result.layerStates,
|
||||
options,
|
||||
input.collectLiveCommitRequests ? &result.commitRequests : nullptr);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2,19 +2,25 @@
|
||||
|
||||
#include "RuntimeLiveState.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <vector>
|
||||
|
||||
struct RenderStateCompositionInput
|
||||
{
|
||||
std::vector<RuntimeRenderState> baseLayerStates;
|
||||
const std::vector<RuntimeRenderState>* baseLayerStates = nullptr;
|
||||
RuntimeLiveState* liveState = nullptr;
|
||||
RuntimeLiveStateApplyOptions liveStateOptions;
|
||||
bool allowLiveCommits = false;
|
||||
bool collectLiveCommitRequests = true;
|
||||
double liveSmoothing = 0.0;
|
||||
std::chrono::milliseconds liveCommitDelay = std::chrono::milliseconds(150);
|
||||
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
|
||||
};
|
||||
|
||||
struct RenderStateCompositionResult
|
||||
{
|
||||
std::vector<RuntimeRenderState> layerStates;
|
||||
std::vector<RuntimeLiveOscCommitRequest> commitRequests;
|
||||
bool hasLayerStates = false;
|
||||
};
|
||||
|
||||
class RenderStateComposer
|
||||
|
||||
Reference in New Issue
Block a user