pub struct SwapchainCompositor {
pub width: u32,
pub height: u32,
pub scale_factor: f32,
pub framebuffer: FrameBuffer,
pub damage_tracker: DamageTracker,
pub frame_count: u64,
pub total_render_duration: Duration,
}Expand description
Orchestrates display list compilation, damage scissoring, and swapchain presentation.
Fields§
§width: u32§height: u32§scale_factor: f32§framebuffer: FrameBuffer§damage_tracker: DamageTracker§frame_count: u64§total_render_duration: DurationImplementations§
Source§impl SwapchainCompositor
impl SwapchainCompositor
Sourcepub fn new(width: u32, height: u32, scale_factor: f32) -> SwapchainCompositor
pub fn new(width: u32, height: u32, scale_factor: f32) -> SwapchainCompositor
Creates a swapchain compositor with backing framebuffer sized to physical pixels.
Sourcepub fn resize(&mut self, width: u32, height: u32, scale_factor: f32)
pub fn resize(&mut self, width: u32, height: u32, scale_factor: f32)
Resizes swapchain dimensions, updating internal framebuffer and registering full dirty damage.
Sourcepub fn render_and_present<P>(
&mut self,
display_list: &DisplayList,
presenter: &mut P,
force_redraw: bool,
) -> Result<bool, PresentError>where
P: SurfacePresenter,
pub fn render_and_present<P>(
&mut self,
display_list: &DisplayList,
presenter: &mut P,
force_redraw: bool,
) -> Result<bool, PresentError>where
P: SurfacePresenter,
Renders display list and presents to target surface. Skips frame if clean and force_redraw is false.
Trait Implementations§
Auto Trait Implementations§
impl Forget for SwapchainCompositor
impl Freeze for SwapchainCompositor
impl Move for SwapchainCompositor
impl RefUnwindSafe for SwapchainCompositor
impl Send for SwapchainCompositor
impl Sync for SwapchainCompositor
impl Unpin for SwapchainCompositor
impl UnsafeUnpin for SwapchainCompositor
impl UnwindSafe for SwapchainCompositor
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