pub struct EglSurface {
pub egl_window: WlEglSurface,
pub surface: Surface,
/* private fields */
}Expand description
Per-Wayland-surface EGL window. egl_window owns the wl_egl_window; it
must outlive surface because EGL keeps a raw pointer into it. egl and
display are kept so that Drop can call eglDestroySurface without
requiring a &EglContext at the call site.
Fields§
§egl_window: WlEglSurfaceThe wl_egl_window backing this surface. EGL holds a raw pointer into
it, so it must not be dropped while surface is alive.
surface: SurfaceThe EGLSurface bound to the Wayland surface, current target for GL
rendering once EglContext::make_current selects it.
Implementations§
Source§impl EglSurface
impl EglSurface
Sourcepub fn resize(&self, width: i32, height: i32)
pub fn resize(&self, width: i32, height: i32)
Resize the backing wl_egl_window to width x height physical
pixels, so the next swap allocates a buffer of the new size. Must be
called whenever the Wayland surface changes size. Dimensions are
clamped to a minimum of 1; this only resizes the buffer and does not
set the GL viewport — the caller updates glViewport separately.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EglSurface
impl RefUnwindSafe for EglSurface
impl !Send for EglSurface
impl !Sync for EglSurface
impl Unpin for EglSurface
impl UnwindSafe for EglSurface
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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