class

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

ReturnsNameDescription
ARC_WIDGET_ARGS
voidSetRenderOpacity
voidSetRetainRender
voidSetPhase
floatGetRenderOpacity
boolGetRetainRender
boolShouldRenderThisFrameWhether this frame index (CArcUIRenderer::GetFrameNumber) owns a redraw under the phase throttle.
boolCanCacheDesiredSize
boolCanSkipArrangeRefused: the retainer decides per frame whether its subtree renders, and that decision is taken against the arrange it just did.
boolCanRetainPaintRefused: it already owns a retention policy of its own, decided per frame.
ArcVec2ComputeDesiredSize
voidArrangeChildren
int32_tOnPaint
const char*GetTypeName

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(ARetainerBox) ARC_ATTR(float, RenderOpacity) ARC_CONTENT(ARetainerBox, Content) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetRenderOpacity

C++
void SetRenderOpacity(float opacity)

SetRetainRender

C++
void SetRetainRender(bool retain)

SetPhase

C++
void SetPhase(int32_t phase, int32_t phaseCount)

GetRenderOpacity

C++
float GetRenderOpacity() const

GetRetainRender

C++
bool GetRetainRender() const

ShouldRenderThisFrame

C++
bool ShouldRenderThisFrame(int64_t frameIndex) const

Whether this frame index (CArcUIRenderer::GetFrameNumber) owns a redraw under the phase throttle.

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

CanSkipArrange

C++
bool CanSkipArrange() const override

Refused: the retainer decides per frame whether its subtree renders, and that decision is taken against the arrange it just did.

CanRetainPaint

C++
bool CanRetainPaint() const override

Refused: 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

C++
ArcVec2 ComputeDesiredSize(float scale) const override

ArrangeChildren

C++
void ArrangeChildren(const CGeometry& geo) override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

GetTypeName

C++
const char* GetTypeName() const override
Generated from Arc/Widgets/ARetainerBox.h via arc.json · Nov 5, 2026Version 1.0.0