Skip to content
SiteEmail

ICompositorInterfaceUnreal

Inherits from IRenoirSublayerCompositor

Inherited by UCohCompositor, UHUDSurfacePartitioningCompositor, UMultithreadAwareCompositorWrapper, UWidgetSurfacePartitioningCompositor

Name
structFFrameState
Name
using uint32_tFrameId
Name
virtual uint32_tPrepareForAdvance()
Should be called once per frame, before the View gets advanced. Will update the current frame.
voidSignalFrameComplete(uint32_t FrameId)
Should be called when the view’s advance/layout is finished, so we can start processing the composited elements of the page we’ve received during the layout/advance.
virtual voidProcessDrawData(const FDrawData & DrawData, int32_t IndexToProcess)
Called on the GameThread, used to create/update textures based on the draw data received for them. Should be overridden by child classes depending on where/how they want to draw the textures.
virtual voidEnqueueRenderingCommands(uint32_t FrameId)
Usually called at the end of the frame during paint.
virtual voidOnDrawSubLayer(const renoir::ISubLayerCompositor::DrawData & DrawData)
Should be called on the layout thread. Since we cannot create/update textures there, we just save them for processing on the GameThread.
virtual voidOnCompositionAdded(unsigned ViewId, const char * CompositionId, void * Metadata) =0
Called on GameThread whenever a new composition is found in the HTML. Should initialize the relevant materials that the texture will be drawn into.
virtual voidOnCompositionVisibility(unsigned , const char * , void * , bool ) =0
Called on Game Thread whenever the visibility of the composition has changed.
virtual voidOnCompositionTransform(unsigned , const char * , void * , const renoir::float4x4 & )
Called on GameThread whenever the transform of the composition has changed.
virtual voidOnCompositionRemoved(unsigned ViewId, const char * CompositionId, void * Metadata) =0
Called on GameThread whenever a new composition is found in the HTML. Should destroy the relevant materials that the texture will be drawn into.
virtual voidSetViewSize(int32_t Width, int32_t Height)
Helper method for compositors that care about size.
voidAdvanceCompositor()
Will block until the view’s advance/layout is finished, then start processing the DrawData(s) collected during (likely done by child classes)
virtual voidPrepareAllMeshMaterial(uint32_t FrameId)
virtual voidProcessRenderData(const FRenderData & RenderData)
virtual voidCreateCompositions()
Executed during AdvanceCompositor after we have waited for cohtml::View::Advance and Layout.
virtual voidDiscardCurrentFrameState()
Helper method to discard the current compositor frame.
virtual boolHasCompositions() =0
Helper method to save on computation when there are no compositions.
virtual boolIsValidObject() =0
Helper method to catch some invalid creation/destruction edge cases.
virtual boolShouldSkipFrame()
Helper method to combine multiple conditions to determine if the current compositor frame should be skipped.
virtual voidCompleteFrameState(uint32_t CompositorFrame)
Should be called when the cohtml::View::Advance and Layout is completed, so that work can be done on the Game Thread.
virtual FrameIdGetCurrentCompositorFrameId()
virtual FFrameState *GetCurrentFrameState()
virtual FCriticalSection &GetCriticalSectionFrameStates()
virtual const TMap< FString, FDrawData > &GetDrawDataInfoMap() const
Name
UTexture2D *CreateTexture(const FDrawData & DrawData, IRenderingBackend * InterfaceBackend, int32_t IndexToProcess)
Name
FCriticalSectionCriticalSectionFrameStates
FrameIdCompositorFrameId
TMap< FrameId, FFrameState >FrameStates
TMap< FrameId, TArray< FRenderData > >RenderDataInfosMap
TMap< FString, FDrawData >DrawDataInfoMap
using ICompositorInterfaceUnreal::FrameId = uint32_t;
virtual uint32_t PrepareForAdvance()

Should be called once per frame, before the View gets advanced. Will update the current frame.

Reimplemented by: UMultithreadAwareCompositorWrapper::PrepareForAdvance

void SignalFrameComplete(
uint32_t FrameId
)

Should be called when the view’s advance/layout is finished, so we can start processing the composited elements of the page we’ve received during the layout/advance.

inline virtual void ProcessDrawData(
const FDrawData & DrawData,
int32_t IndexToProcess
)

Called on the GameThread, used to create/update textures based on the draw data received for them. Should be overridden by child classes depending on where/how they want to draw the textures.

Reimplemented by: UHUDSurfacePartitioningCompositor::ProcessDrawData, UWidgetSurfacePartitioningCompositor::ProcessDrawData, UMultithreadAwareCompositorWrapper::ProcessDrawData, UCohCompositor::ProcessDrawData

virtual void EnqueueRenderingCommands(
uint32_t FrameId
)

Usually called at the end of the frame during paint.

Reimplemented by: UMultithreadAwareCompositorWrapper::EnqueueRenderingCommands

virtual void OnDrawSubLayer(
const renoir::ISubLayerCompositor::DrawData & DrawData
)

Should be called on the layout thread. Since we cannot create/update textures there, we just save them for processing on the GameThread.

Reimplemented by: UMultithreadAwareCompositorWrapper::OnDrawSubLayer, UCohCompositor::OnDrawSubLayer

virtual void OnCompositionAdded(
unsigned ViewId,
const char * CompositionId,
void * Metadata
) =0

Called on GameThread whenever a new composition is found in the HTML. Should initialize the relevant materials that the texture will be drawn into.

Reimplemented by: UHUDSurfacePartitioningCompositor::OnCompositionAdded, UWidgetSurfacePartitioningCompositor::OnCompositionAdded, UMultithreadAwareCompositorWrapper::OnCompositionAdded, UCohCompositor::OnCompositionAdded

virtual void OnCompositionVisibility(
unsigned ,
const char * ,
void * ,
bool
) =0

Called on Game Thread whenever the visibility of the composition has changed.

Reimplemented by: UHUDSurfacePartitioningCompositor::OnCompositionVisibility, UWidgetSurfacePartitioningCompositor::OnCompositionVisibility, UMultithreadAwareCompositorWrapper::OnCompositionVisibility, UCohCompositor::OnCompositionVisibility

virtual void OnCompositionTransform(
unsigned ,
const char * ,
void * ,
const renoir::float4x4 &
)

Called on GameThread whenever the transform of the composition has changed.

Reimplemented by: UMultithreadAwareCompositorWrapper::OnCompositionTransform

virtual void OnCompositionRemoved(
unsigned ViewId,
const char * CompositionId,
void * Metadata
) =0

Called on GameThread whenever a new composition is found in the HTML. Should destroy the relevant materials that the texture will be drawn into.

Reimplemented by: UHUDSurfacePartitioningCompositor::OnCompositionRemoved, UWidgetSurfacePartitioningCompositor::OnCompositionRemoved, UMultithreadAwareCompositorWrapper::OnCompositionRemoved, UCohCompositor::OnCompositionRemoved

inline virtual void SetViewSize(
int32_t Width,
int32_t Height
)

Helper method for compositors that care about size.

Reimplemented by: UMultithreadAwareCompositorWrapper::SetViewSize, UCohCompositor::SetViewSize

void AdvanceCompositor()

Will block until the view’s advance/layout is finished, then start processing the DrawData(s) collected during (likely done by child classes)

virtual void PrepareAllMeshMaterial(
uint32_t FrameId
)
virtual void ProcessRenderData(
const FRenderData & RenderData
)
virtual void CreateCompositions()

Executed during AdvanceCompositor after we have waited for cohtml::View::Advance and Layout.

Reimplemented by: UMultithreadAwareCompositorWrapper::CreateCompositions

virtual void DiscardCurrentFrameState()

Helper method to discard the current compositor frame.

Reimplemented by: UMultithreadAwareCompositorWrapper::DiscardCurrentFrameState

virtual bool HasCompositions() =0

Helper method to save on computation when there are no compositions.

Reimplemented by: UHUDSurfacePartitioningCompositor::HasCompositions, UWidgetSurfacePartitioningCompositor::HasCompositions, UMultithreadAwareCompositorWrapper::HasCompositions, UCohCompositor::HasCompositions

virtual bool IsValidObject() =0

Helper method to catch some invalid creation/destruction edge cases.

Reimplemented by: UHUDSurfacePartitioningCompositor::IsValidObject, UWidgetSurfacePartitioningCompositor::IsValidObject, UMultithreadAwareCompositorWrapper::IsValidObject, UCohCompositor::IsValidObject

virtual bool ShouldSkipFrame()

Helper method to combine multiple conditions to determine if the current compositor frame should be skipped.

Reimplemented by: UMultithreadAwareCompositorWrapper::ShouldSkipFrame

virtual void CompleteFrameState(
uint32_t CompositorFrame
)

Should be called when the cohtml::View::Advance and Layout is completed, so that work can be done on the Game Thread.

Reimplemented by: UMultithreadAwareCompositorWrapper::CompleteFrameState

virtual FrameId GetCurrentCompositorFrameId()

Reimplemented by: UMultithreadAwareCompositorWrapper::GetCurrentCompositorFrameId

virtual FFrameState * GetCurrentFrameState()

Reimplemented by: UMultithreadAwareCompositorWrapper::GetCurrentFrameState

virtual FCriticalSection & GetCriticalSectionFrameStates()

Reimplemented by: UMultithreadAwareCompositorWrapper::GetCriticalSectionFrameStates

virtual const TMap< FString, FDrawData > & GetDrawDataInfoMap() const

Reimplemented by: UMultithreadAwareCompositorWrapper::GetDrawDataInfoMap

UTexture2D * CreateTexture(
const FDrawData & DrawData,
IRenderingBackend * InterfaceBackend,
int32_t IndexToProcess
)
FCriticalSection CriticalSectionFrameStates;
FrameId CompositorFrameId;
TMap< FrameId, FFrameState > FrameStates;
TMap< FrameId, TArray< FRenderData > > RenderDataInfosMap;
TMap< FString, FDrawData > DrawDataInfoMap;