ICompositorInterfaceUnreal
Inherits from IRenoirSublayerCompositor
Inherited by UCohCompositor, UHUDSurfacePartitioningCompositor, UMultithreadAwareCompositorWrapper, UWidgetSurfacePartitioningCompositor
Public Classes
Name | |
---|---|
struct | FFrameState |
Public Types
Name | |
---|---|
using uint32_t | FrameId |
Public Functions
Name | |
---|---|
virtual uint32_t | PrepareForAdvance() Should be called once per frame, before the View gets advanced. Will update the current frame. |
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. |
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. |
virtual void | EnqueueRenderingCommands(uint32_t FrameId) Usually called at the end of the frame during paint. |
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. |
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. |
virtual void | OnCompositionVisibility(unsigned , const char * , void * , bool ) =0 Called on Game Thread whenever the visibility of the composition has changed. |
virtual void | OnCompositionTransform(unsigned , const char * , void * , const renoir::float4x4 & ) Called on GameThread whenever the transform of the composition has changed. |
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. |
virtual void | SetViewSize(int32_t Width, int32_t Height) Helper method for compositors that care about size. |
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. |
virtual void | DiscardCurrentFrameState() Helper method to discard the current compositor frame. |
virtual bool | HasCompositions() =0 Helper method to save on computation when there are no compositions. |
virtual bool | IsValidObject() =0 Helper method to catch some invalid creation/destruction edge cases. |
virtual bool | ShouldSkipFrame() Helper method to combine multiple conditions to determine if the current compositor frame should be skipped. |
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. |
virtual FrameId | GetCurrentCompositorFrameId() |
virtual FFrameState * | GetCurrentFrameState() |
virtual FCriticalSection & | GetCriticalSectionFrameStates() |
virtual const TMap< FString, FDrawData > & | GetDrawDataInfoMap() const |
Protected Functions
Name | |
---|---|
UTexture2D * | CreateTexture(const FDrawData & DrawData, IRenderingBackend * InterfaceBackend, int32_t IndexToProcess) |
Protected Attributes
Name | |
---|---|
FCriticalSection | CriticalSectionFrameStates |
FrameId | CompositorFrameId |
TMap< FrameId, FFrameState > | FrameStates |
TMap< FrameId, TArray< FRenderData > > | RenderDataInfosMap |
TMap< FString, FDrawData > | DrawDataInfoMap |
Public Types Documentation
using FrameId
using ICompositorInterfaceUnreal::FrameId = uint32_t;
Public Functions Documentation
function PrepareForAdvance
virtual uint32_t PrepareForAdvance()
Should be called once per frame, before the View gets advanced. Will update the current frame.
Reimplemented by: UMultithreadAwareCompositorWrapper::PrepareForAdvance
function SignalFrameComplete
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.
function ProcessDrawData
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
function EnqueueRenderingCommands
virtual void EnqueueRenderingCommands(
uint32_t FrameId
)
Usually called at the end of the frame during paint.
Reimplemented by: UMultithreadAwareCompositorWrapper::EnqueueRenderingCommands
function OnDrawSubLayer
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
function OnCompositionAdded
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
function OnCompositionVisibility
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
function OnCompositionTransform
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
function OnCompositionRemoved
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
function SetViewSize
inline virtual void SetViewSize(
int32_t Width,
int32_t Height
)
Helper method for compositors that care about size.
Reimplemented by: UMultithreadAwareCompositorWrapper::SetViewSize, UCohCompositor::SetViewSize
function AdvanceCompositor
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)
function PrepareAllMeshMaterial
virtual void PrepareAllMeshMaterial(
uint32_t FrameId
)
function ProcessRenderData
virtual void ProcessRenderData(
const FRenderData & RenderData
)
function CreateCompositions
virtual void CreateCompositions()
Executed during AdvanceCompositor after we have waited for cohtml::View::Advance and Layout.
Reimplemented by: UMultithreadAwareCompositorWrapper::CreateCompositions
function DiscardCurrentFrameState
virtual void DiscardCurrentFrameState()
Helper method to discard the current compositor frame.
Reimplemented by: UMultithreadAwareCompositorWrapper::DiscardCurrentFrameState
function HasCompositions
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
function IsValidObject
virtual bool IsValidObject() =0
Helper method to catch some invalid creation/destruction edge cases.
Reimplemented by: UHUDSurfacePartitioningCompositor::IsValidObject, UWidgetSurfacePartitioningCompositor::IsValidObject, UMultithreadAwareCompositorWrapper::IsValidObject, UCohCompositor::IsValidObject
function ShouldSkipFrame
virtual bool ShouldSkipFrame()
Helper method to combine multiple conditions to determine if the current compositor frame should be skipped.
Reimplemented by: UMultithreadAwareCompositorWrapper::ShouldSkipFrame
function CompleteFrameState
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
function GetCurrentCompositorFrameId
virtual FrameId GetCurrentCompositorFrameId()
Reimplemented by: UMultithreadAwareCompositorWrapper::GetCurrentCompositorFrameId
function GetCurrentFrameState
virtual FFrameState * GetCurrentFrameState()
Reimplemented by: UMultithreadAwareCompositorWrapper::GetCurrentFrameState
function GetCriticalSectionFrameStates
virtual FCriticalSection & GetCriticalSectionFrameStates()
Reimplemented by: UMultithreadAwareCompositorWrapper::GetCriticalSectionFrameStates
function GetDrawDataInfoMap
virtual const TMap< FString, FDrawData > & GetDrawDataInfoMap() const
Reimplemented by: UMultithreadAwareCompositorWrapper::GetDrawDataInfoMap
Protected Functions Documentation
function CreateTexture
UTexture2D * CreateTexture(
const FDrawData & DrawData,
IRenderingBackend * InterfaceBackend,
int32_t IndexToProcess
)
Protected Attributes Documentation
variable CriticalSectionFrameStates
FCriticalSection CriticalSectionFrameStates;
variable CompositorFrameId
FrameId CompositorFrameId;
variable FrameStates
TMap< FrameId, FFrameState > FrameStates;
variable RenderDataInfosMap
TMap< FrameId, TArray< FRenderData > > RenderDataInfosMap;
variable DrawDataInfoMap
TMap< FString, FDrawData > DrawDataInfoMap;