pub struct WgpuSwapchainPresenter {
pub presented_frames: u64,
pub damage_clipped_frames: u64,
/* private fields */
}Expand description
Hardware wgpu Swapchain Presenter wiring UnifiedGpuCollector,
GpuStencilClipPipeline, and Wgpu2DRenderer into strata_platform’s swapchain layer.
Fields§
§presented_frames: u64§damage_clipped_frames: u64Implementations§
Source§impl WgpuSwapchainPresenter
impl WgpuSwapchainPresenter
Sourcepub fn new_offscreen(config: SurfaceConfig) -> Result<Self, String>
pub fn new_offscreen(config: SurfaceConfig) -> Result<Self, String>
Creates a headless/offscreen hardware GPU swapchain presenter.
Sourcepub unsafe fn from_raw_handles(
window_handle: RawWindowHandle,
display_handle: RawDisplayHandle,
config: SurfaceConfig,
) -> Result<Self, String>
pub unsafe fn from_raw_handles( window_handle: RawWindowHandle, display_handle: RawDisplayHandle, config: SurfaceConfig, ) -> Result<Self, String>
Creates a hardware GPU swapchain presenter bound directly to a native window handle pair.
§Safety
window_handle and display_handle must remain valid for the lifetime of this presenter.
pub fn config(&self) -> &SurfaceConfig
pub fn presenter(&self) -> &WgpuWindowPresenter
pub fn presenter_mut(&mut self) -> &mut WgpuWindowPresenter
pub fn batch_collector(&self) -> &UnifiedGpuCollector
pub fn last_batch_summary(&self) -> GpuBatchSummary
pub fn stencil_clip_pipeline(&self) -> &GpuStencilClipPipeline
Sourcepub fn present_display_list(
&mut self,
list: &DisplayList,
damage: Option<Rect>,
clear_color: [f32; 4],
) -> Result<GpuBatchSummary, PresentError>
pub fn present_display_list( &mut self, list: &DisplayList, damage: Option<Rect>, clear_color: [f32; 4], ) -> Result<GpuBatchSummary, PresentError>
Compiles and presents a DisplayList directly via Wgpu2DRenderer + GpuStencilClipPipeline
onto the configured swapchain (or offscreen target when headless).
Sourcepub fn render_display_list_to_bgra(
&mut self,
list: &DisplayList,
damage: Option<Rect>,
clear_color: [f32; 4],
) -> Result<(GpuBatchSummary, Vec<u8>), PresentError>
pub fn render_display_list_to_bgra( &mut self, list: &DisplayList, damage: Option<Rect>, clear_color: [f32; 4], ) -> Result<(GpuBatchSummary, Vec<u8>), PresentError>
Renders a DisplayList into BGRA8 pixels via the GPU 2D + stencil clip + 3D pipelines.
Trait Implementations§
Source§impl SurfacePresenter for WgpuSwapchainPresenter
impl SurfacePresenter for WgpuSwapchainPresenter
Source§fn present(
&mut self,
buffer: &FrameBuffer,
damage: Option<Rect>,
) -> Result<(), PresentError>
fn present( &mut self, buffer: &FrameBuffer, damage: Option<Rect>, ) -> Result<(), PresentError>
Presents the contents of the given framebuffer to the display surface, optionally clipped to damage.
Source§fn resize(&mut self, width: u32, height: u32) -> Result<(), PresentError>
fn resize(&mut self, width: u32, height: u32) -> Result<(), PresentError>
Notifies the presentation surface of a dimension resize.
Source§fn surface_size(&self) -> (u32, u32)
fn surface_size(&self) -> (u32, u32)
Returns physical surface dimensions as (width, height).
Auto Trait Implementations§
impl !Freeze for WgpuSwapchainPresenter
impl !RefUnwindSafe for WgpuSwapchainPresenter
impl !UnwindSafe for WgpuSwapchainPresenter
impl Forget for WgpuSwapchainPresenter
impl Move for WgpuSwapchainPresenter
impl Send for WgpuSwapchainPresenter
impl Sync for WgpuSwapchainPresenter
impl Unpin for WgpuSwapchainPresenter
impl UnsafeUnpin for WgpuSwapchainPresenter
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