pub struct Scene {
pub shadows: Vec<Shadow>,
pub quads: Vec<Quad>,
pub paths: Vec<PaintedPath>,
pub underlines: Vec<Underline>,
pub monochrome_sprites: Vec<MonochromeSprite>,
pub subpixel_sprites: Vec<SubpixelSprite>,
pub polychrome_sprites: Vec<PolychromeSprite>,
pub surfaces: Vec<PaintSurface>,
/* private fields */
}Expand description
重导出场景系统相关类型 渲染场景 — 收集所有绘制图元(四边形、文本、阴影等),供 GPU 批量渲染。
Fields§
§shadows: Vec<Shadow>阴影图元列表。
quads: Vec<Quad>四边形图元列表。
paths: Vec<PaintedPath>矢量路径图元列表。
underlines: Vec<Underline>下划线图元列表。
monochrome_sprites: Vec<MonochromeSprite>单色精灵图元列表。
subpixel_sprites: Vec<SubpixelSprite>亚像素精灵图元列表。
polychrome_sprites: Vec<PolychromeSprite>多色精灵图元列表。
surfaces: Vec<PaintSurface>平台原生绘制表面列表。
Implementations§
Source§impl Scene
渲染场景的构建和管理方法。
impl Scene
渲染场景的构建和管理方法。
Sourcepub fn push_layer(&mut self)
pub fn push_layer(&mut self)
推入一个新的绘制图层,后续图元将在此图层内绘制。
图层不立刻占用绘制顺序:关闭时以「图层内图元的并集边界」插入排序树, 按与其他图元相同的规则共享或新建绘制顺序;图层内所有图元共用该顺序。
Sourcepub fn insert_primitive(&mut self, primitive: impl Into<Primitive>)
pub fn insert_primitive(&mut self, primitive: impl Into<Primitive>)
插入一个渲染图元到场景中。
不在图层内时立即插入排序树分配绘制顺序;在图层内则并入图层, 关闭时统一落地。
Sourcepub fn batches(&self) -> impl Iterator<Item = PrimitiveBatch> + '_
pub fn batches(&self) -> impl Iterator<Item = PrimitiveBatch> + '_
返回按绘制顺序分批的图元迭代器。
Trait Implementations§
Auto Trait Implementations§
impl !Send for Scene
impl !Sync for Scene
impl Forget for Scene
impl Freeze for Scene
impl Move for Scene
impl RefUnwindSafe for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
impl UnwindSafe for Scene
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more