AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
Render context passed to AView::render. More...
Render context passed to AView::render.
View containers are responsible to modify (by withShiftedPosition) and passthrough clip optimization context in order to determine which views do not affect actual renderbuffer image and thus should not be rendered either. It's applicable for AScrollArea in the first place, or any other container with AOverflow::HIDDEN and a possibility to either direct or indirect children to run out (render outside) of that container.
View containers are also responsible to skip rendering of views that are outside of the clipping.
ARenderContext is useful only for container views.
ARenderContext passed to the view (possibly AViewContainer) describes an axis aligned bounding box relative to it's coordinate space (position).
Root (window) and AOverflow::HIDDEN containers should create ARenderContext with position = {0, 0} and size = it's size. Other containers should not affect ARenderContext and pass it to it's children as is, in exception to position, which should be subtracted by view's position.
See UIRenderOptimizationTest for tests.
Public Types | |
using | Rectangles = AStaticVector< ARect< int >, 8 > |
Public Member Functions | |
void | clip (ARect< int > clipping) |
ARenderContext | withShiftedPosition (glm::ivec2 by) const noexcept |
Signals and public fields | |
Rectangles | clippingRects |
Axis aligned bounding boxes where the rendering is performed in, used for optimization. | |
IRenderer & | render |
#include <AUI/Render/ARenderContext.h>