Struct smithay::backend::renderer::gles2::Gles2Renderer [−][src]
pub struct Gles2Renderer { /* fields omitted */ }
Expand description
A renderer utilizing OpenGL ES 2
Implementations
pub unsafe fn new<L>(
context: EGLContext,
logger: L
) -> Result<Gles2Renderer, Gles2Error> where
L: Into<Option<Logger>>,
pub unsafe fn new<L>(
context: EGLContext,
logger: L
) -> Result<Gles2Renderer, Gles2Error> where
L: Into<Option<Logger>>,
Creates a new OpenGL ES 2 renderer from a given EGLContext
.
Safety
This operation will cause undefined behavior if the given EGLContext is active in another thread.
Implementation details
- Texture handles created by the resulting renderer are valid for every rendered created with an
EGLContext
shared with the given one (seeEGLContext::new_shared
) and can be used on any of these renderers. - This renderer has no default framebuffer, use
Bind::bind
before rendering. - Binding a new target, while another one is already bound, will replace the current target.
- Shm buffers can be released after a successful import, without the texture handle becoming invalid.
pub fn with_context<F, R>(&mut self, func: F) -> Result<R, Gles2Error> where
F: FnOnce(&mut Self, &Gles2) -> R,
pub fn with_context<F, R>(&mut self, func: F) -> Result<R, Gles2Error> where
F: FnOnce(&mut Self, &Gles2) -> R,
Run custom code in the GL context owned by this renderer.
Note: Any changes to the GL state should be restored at the end of this function. Otherwise this can lead to rendering errors while using functions of this renderer. Relying on any state set by the renderer may break on any smithay update as the details about how this renderer works are considered an implementation detail.
Trait Implementations
Bind a given rendering target, which will contain the rendering results until unbind
is called. Read more
Supported pixel formats for given targets, if applicable.
Import a given raw dmabuf into the renderer. Read more
Returns supported formats for dmabufs.
Import a given dmabuf-based buffer into the renderer (see buffer_type
). Read more
Binds the underlying EGL display to the given Wayland display. Read more
Unbinds a previously bound egl display, if existing. Read more
Returns the underlying EGLBufferReader
. Read more
Import a given wl_drm-based buffer into the renderer (see buffer_type
). Read more
fn import_shm_buffer(
&mut self,
buffer: &WlBuffer,
surface: Option<&SurfaceData>,
damage: &[Rectangle<i32, Buffer>]
) -> Result<Gles2Texture, Gles2Error>
fn import_shm_buffer(
&mut self,
buffer: &WlBuffer,
surface: Option<&SurfaceData>,
damage: &[Rectangle<i32, Buffer>]
) -> Result<Gles2Texture, Gles2Error>
Import a given shm-based buffer into the renderer (see buffer_type
). Read more
type Error = Gles2Error
type Error = Gles2Error
Error type returned by the rendering operations of this renderer.
type TextureId = Gles2Texture
type TextureId = Gles2Texture
Texture Handle type used by this renderer.
type Frame = Gles2Frame
type Frame = Gles2Frame
Type representing a currently in-progress frame during the Renderer::render
-call
Auto Trait Implementations
impl !RefUnwindSafe for Gles2Renderer
impl !Send for Gles2Renderer
impl !Sync for Gles2Renderer
impl Unpin for Gles2Renderer
impl !UnwindSafe for Gles2Renderer
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert 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
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
pub fn vzip(self) -> V