pub enum StageId {
Show 17 variants
EventDispatch,
Layout,
AfterFrame,
RenderPrepare,
CommandGen,
CpuRaster,
Upload,
BackendSubmit,
PixelConvert,
ImageAlloc,
PixelCopy,
CanvasBlit,
PresentBlocking,
AfterPresent,
GpuExecute,
Compositor,
TotalFrame,
}Expand description
全部阶段标识。
枚举而不是字符串:拼错会被编译器挡住,且 StageTimes 的 set/get 可以穷尽匹配。
Variants§
EventDispatch
事件分发(含命令处理、idle、动画推进、主题切换)。
Layout
布局。
AfterFrame
after_frame 钩子。
RenderPrepare
渲染准备(脏区规划、批次构建、清屏、实例缓冲 arrnge 等 CPU 侧准备)。
CommandGen
命令生成(UiTree::render 把控件调用变成后端命令)。
CpuRaster
CPU 光栅化(软渲染:命令生成与像素执行在同一调用里,不可分离)。
Upload
上传(图集/纹理;X11 上“上传 + Present“合并计入此项)。
BackendSubmit
后端提交(D3D11:CB 更新 + 实例缓冲 Map/memcpy + draw + blit)。
PixelConvert
BGRA→RGBA 转换(仅 Web)。
ImageAlloc
ImageData 分配(仅 Web)。
PixelCopy
像素批量拷贝(仅 Web:wasm → JS 堆)。
CanvasBlit
Canvas putImageData 调用(仅 Web,不含浏览器合成)。
PresentBlocking
阻塞式上屏调用(D3D11 Present / GDI blit;含 vsync 等待,不含合成器)。
AfterPresent
after_present 钩子。
GpuExecute
GPU 执行(本阶段不可测:需要新增 D3D11 timestamp query)。
Compositor
合成器(DWM / X server / 浏览器;在我们返回之后异步发生)。
TotalFrame
整帧(工作耗时,不含 wait_events 等待)。
Implementations§
Trait Implementations§
impl Copy for StageId
impl Eq for StageId
impl StructuralPartialEq for StageId
Auto Trait Implementations§
impl Forget for StageId
impl Freeze for StageId
impl Move for StageId
impl RefUnwindSafe for StageId
impl Send for StageId
impl Sync for StageId
impl Unpin for StageId
impl UnsafeUnpin for StageId
impl UnwindSafe for StageId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more