ARetainerBox
A retainer: it renders its child subtree into an offscreen layer and composites that image once, so the group opacity applies to the subtree as a whole rather than to each child in turn. With a phase count above one the image persists between frames: the subtree is painted only on the frames its phase owns, and every other frame redraws the kept image without walking the subtree. Without layer support (no device, a transformed ancestor) it falls back to per-child opacity and paints every frame.
- Module
- Arc
- Header
#include "Arc/Widgets/ARetainerBox.h"- Namespace
Arcf
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
void | SetRenderOpacity | |
void | SetRetainRender | |
void | SetPhase | |
float | GetRenderOpacity | |
bool | GetRetainRender | |
bool | ShouldRenderThisFrame | Whether this frame index (CArcUIRenderer::GetFrameNumber) owns a redraw under the phase throttle. |
bool | CanCacheDesiredSize | |
bool | CanSkipArrange | Refused: the retainer decides per frame whether its subtree renders, and that decision is taken against the arrange it just did. |
bool | CanRetainPaint | Refused: it already owns a retention policy of its own, decided per frame. |
ArcVec2 | ComputeDesiredSize | |
void | ArrangeChildren | |
int32_t | OnPaint | |
const char* | GetTypeName |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(ARetainerBox) ARC_ATTR(float, RenderOpacity) ARC_CONTENT(ARetainerBox, Content) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)SetRenderOpacity
void SetRenderOpacity(float opacity)SetRetainRender
void SetRetainRender(bool retain)SetPhase
void SetPhase(int32_t phase, int32_t phaseCount)GetRenderOpacity
float GetRenderOpacity() constGetRetainRender
bool GetRetainRender() constShouldRenderThisFrame
bool ShouldRenderThisFrame(int64_t frameIndex) constWhether this frame index (CArcUIRenderer::GetFrameNumber) owns a redraw under the phase throttle.
CanCacheDesiredSize
bool CanCacheDesiredSize() const overrideCanSkipArrange
bool CanSkipArrange() const overrideRefused: the retainer decides per frame whether its subtree renders, and that decision is taken against the arrange it just did.
CanRetainPaint
bool CanRetainPaint() const overrideRefused: it already owns a retention policy of its own, decided per frame. Two caches over the same subtree would each believe the other had painted it.
ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float scale) const overrideArrangeChildren
void ArrangeChildren(const CGeometry& geo) overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideGetTypeName
const char* GetTypeName() const override