Skip to main content

GpuEditor

Struct GpuEditor 

Source
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>

Source

pub fn new(inner: BuiltinEditor<P>) -> Self

Source

pub fn new_shared(inner: Arc<Mutex<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>

Source§

fn size(&self) -> (u32, u32)

Initial window size in logical points. Read more
Source§

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)

Host notifies the editor of a new content scale factor. Read more
Source§

fn close(&mut self)

Destroy the GUI.
Source§

fn idle(&mut self)

Called ~60fps on the host’s UI thread for repaint/animation.
Source§

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)>

Render a headless screenshot of the editor at its natural size. Read more
Source§

fn set_size(&mut self, _width: u32, _height: u32) -> bool

Host requests a resize. Return true to accept.
Source§

fn can_resize(&self) -> bool

Whether the plugin supports resizing.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,