Loading...
Searching...
No Matches
OFT.Rendering.DrawingLayout Class Reference

Represents a layout used for drawing operations. More...

Public Member Functions

 DrawingLayout ()
 Initializes a new instance of the DrawingLayout class.
 
RenderContext BeginRender (RenderContext parentRenderContext)
 Begins rendering the layout using the specified parent render context.
 
void EndRender (RenderContext renderContext)
 Ends rendering the layout using the specified render context.
 
override string ToString ()
 
bool SetSizeAndCheckIsNeedToRedraw (RenderContext parentRenderContext, int width, int height)
 Sets the size of the layout and checks if the layout needs to be redrawn.
 
void Invalidate ()
 Marks the layout content as changed so it will be re-rendered.
 
void CommitRenderedVersion (long version)
 Commits a rendered content version after the frame that carried it was successfully presented. Monotonic: an older version never overwrites a newer commit.
 
void Clear ()
 Marks the layout as modified, indicating that it needs to be redrawn.
 

Public Attributes

readonly int ID = ++MaxID
 

Properties

long ContentVersion [get]
 Gets the version of the layout content. Producers bump it (via Invalidate) whenever the content changes.
 
bool Modified [get, set]
 Gets or sets flag that this layout must be re-rendered. Invalidation needed if one of child layouts was changed or cached bitmaps were lost (resize). Setting true is an alias for Invalidate; setting false is a no-op — dirtiness is cleared only by committing a rendered version, never by the producer, so a dropped frame cannot mark stale content as valid.
 
string Name [get, set]
 Gets or sets the name of layout for debugging.
 
int Width = 10 [get]
 Gets the width of the drawing layout.
 
int Height = 10 [get]
 Gets the height of the drawing layout.
 
Size Size [get]
 Gets the size of the drawing layout as a Size object.
 

Detailed Description

Represents a layout used for drawing operations.

Threading: producers may bump the content version (Invalidate / Modified) from any thread, but rendering a layout is single-threaded by contract — BeginRender/EndRender of the same layout must not overlap (the version staged for commit is a single slot). WPF serializes frames per control, PlatformX per chart.

Constructor & Destructor Documentation

◆ DrawingLayout()

OFT.Rendering.DrawingLayout.DrawingLayout ( )

Initializes a new instance of the DrawingLayout class.

Member Function Documentation

◆ BeginRender()

RenderContext OFT.Rendering.DrawingLayout.BeginRender ( RenderContext  parentRenderContext)

Begins rendering the layout using the specified parent render context.

Parameters
parentRenderContextThe parent render context to use for rendering.
Returns
The render context used for rendering the layout.
Exceptions
ArgumentNullExceptionThrown if the parentRenderContext is null.
RenderExceptionThrown if the render context creation fails.

◆ Clear()

void OFT.Rendering.DrawingLayout.Clear ( )

Marks the layout as modified, indicating that it needs to be redrawn.

◆ CommitRenderedVersion()

void OFT.Rendering.DrawingLayout.CommitRenderedVersion ( long  version)

Commits a rendered content version after the frame that carried it was successfully presented. Monotonic: an older version never overwrites a newer commit.

◆ EndRender()

void OFT.Rendering.DrawingLayout.EndRender ( RenderContext  renderContext)

Ends rendering the layout using the specified render context.

Parameters
renderContextThe render context used for rendering the layout.
Exceptions
RenderExceptionThrown if the specified renderContext is null. Make sure to call BeginRender(RenderContext) before calling this method.

◆ Invalidate()

void OFT.Rendering.DrawingLayout.Invalidate ( )

Marks the layout content as changed so it will be re-rendered.

◆ SetSizeAndCheckIsNeedToRedraw()

bool OFT.Rendering.DrawingLayout.SetSizeAndCheckIsNeedToRedraw ( RenderContext  parentRenderContext,
int  width,
int  height 
)

Sets the size of the layout and checks if the layout needs to be redrawn.

Parameters
parentRenderContextThe parent render context used for checking font anti-aliasing settings.
widthThe new width of the layout.
heightThe new height of the layout.
Returns
True if the layout needs to be redrawn, otherwise false.

◆ ToString()

override string OFT.Rendering.DrawingLayout.ToString ( )

Member Data Documentation

◆ ID

readonly int OFT.Rendering.DrawingLayout.ID = ++MaxID

Property Documentation

◆ ContentVersion

long OFT.Rendering.DrawingLayout.ContentVersion
get

Gets the version of the layout content. Producers bump it (via Invalidate) whenever the content changes.

◆ Height

int OFT.Rendering.DrawingLayout.Height = 10
get

Gets the height of the drawing layout.

◆ Modified

bool OFT.Rendering.DrawingLayout.Modified
getset

Gets or sets flag that this layout must be re-rendered. Invalidation needed if one of child layouts was changed or cached bitmaps were lost (resize). Setting true is an alias for Invalidate; setting false is a no-op — dirtiness is cleared only by committing a rendered version, never by the producer, so a dropped frame cannot mark stale content as valid.

◆ Name

string OFT.Rendering.DrawingLayout.Name
getset

Gets or sets the name of layout for debugging.

◆ Size

Size OFT.Rendering.DrawingLayout.Size
get

Gets the size of the drawing layout as a Size object.

◆ Width

int OFT.Rendering.DrawingLayout.Width = 10
get

Gets the width of the drawing layout.


The documentation for this class was generated from the following file: