pub struct GpuEditor<P: Params> { /* private fields */ }Expand description
GPU-accelerated editor.
On open(), creates a baseview child window with a wgpu surface.
If wgpu adapter / surface acquisition fails, from_window returns
None and on_frame becomes a no-op for that session.
Implementations§
Source§impl<P: Params + 'static> GpuEditor<P>
impl<P: Params + 'static> GpuEditor<P>
pub fn new(inner: BuiltinEditor<P>) -> Self
Create from a pre-existing shared reference.
Used by HotEditor to share the inner BuiltinEditor so it can
swap the layout on hot-reload while GPU rendering continues.
§Panics
Panics if the inner mutex is poisoned (a previous holder
panicked). In normal operation BuiltinEditor never panics
while holding the lock.
Trait Implementations§
Source§impl<P: Params + 'static> Editor for GpuEditor<P>
impl<P: Params + 'static> Editor for GpuEditor<P>
Source§fn open(&mut self, parent: RawWindowHandle, context: PluginContext)
fn open(&mut self, parent: RawWindowHandle, context: PluginContext)
Create the GUI as a child of the host-provided parent window.
Source§fn set_scale_factor(&mut self, factor: f64)
fn set_scale_factor(&mut self, factor: f64)
Host notifies the editor of a new content scale factor. Read more
Source§fn state_changed(&mut self)
fn state_changed(&mut self)
Plugin state was restored (preset recall, undo, session load). Read more
Source§fn screenshot(
&mut self,
_params: Arc<dyn Params>,
) -> Option<(Vec<u8>, u32, u32)>
fn screenshot( &mut self, _params: Arc<dyn Params>, ) -> Option<(Vec<u8>, u32, u32)>
Render a headless screenshot of the editor at its natural size. Read more
Source§fn set_size(&mut self, _width: u32, _height: u32) -> bool
fn set_size(&mut self, _width: u32, _height: u32) -> bool
Host requests a resize. Return true to accept.
Source§fn can_resize(&self) -> bool
fn can_resize(&self) -> bool
Whether the plugin supports resizing.
impl<P: Params> Send for GpuEditor<P>
Auto Trait Implementations§
impl<P> Freeze for GpuEditor<P>
impl<P> !RefUnwindSafe for GpuEditor<P>
impl<P> !Sync for GpuEditor<P>
impl<P> Unpin for GpuEditor<P>
impl<P> UnsafeUnpin for GpuEditor<P>
impl<P> !UnwindSafe for GpuEditor<P>
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