pub struct GlowRenderer { /* private fields */ }renderer_glow only.Expand description
A renderer utilizing OpenGL ES 2 and [glow] on top for easier custom rendering.
Implementations§
Source§impl GlowRenderer
impl GlowRenderer
Sourcepub unsafe fn supported_capabilities(
context: &EGLContext,
) -> Result<Vec<Capability>, GlesError>
pub unsafe fn supported_capabilities( context: &EGLContext, ) -> Result<Vec<Capability>, GlesError>
Get the supported Capabilities of the renderer
§Safety
This operation will cause undefined behavior if the given EGLContext is active in another thread.
Sourcepub unsafe fn new(context: EGLContext) -> Result<GlowRenderer, GlesError>
pub unsafe fn new(context: EGLContext) -> Result<GlowRenderer, GlesError>
Creates a new OpenGL ES 2 + Glow renderer from a given EGLContext
with all supported capabilities.
§Safety
This operation will cause undefined behavior if the given EGLContext is active in another thread.
See: with_capabilities for more information
Sourcepub unsafe fn with_capabilities(
context: EGLContext,
capabilities: impl IntoIterator<Item = Capability>,
) -> Result<GlowRenderer, GlesError>
pub unsafe fn with_capabilities( context: EGLContext, capabilities: impl IntoIterator<Item = Capability>, ) -> Result<GlowRenderer, GlesError>
Creates a new OpenGL ES 2 + Glow renderer from a given EGLContext
with the specified Capabilities. If a requested Capability is not supported an
error will be returned.
§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
EGLContextshared with the given one (seeEGLContext::new_shared) and can be used on any of these renderers. - This renderer has no default framebuffer, use
Bind::bindbefore 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.
- Texture filtering starts with Linear-downscaling and Linear-upscaling
Sourcepub fn egl_context(&self) -> &EGLContext
pub fn egl_context(&self) -> &EGLContext
Get access to the underlying EGLContext.
Note: Modifying the context state, might result in rendering issues. The context state is considered an implementation detail and no guarantee is made about what can or cannot be changed. To make sure a certain modification does not interfere with the renderer’s behaviour, check the source.
Sourcepub fn with_context<F, R>(&mut self, func: F) -> Result<R, GlesError>
pub fn with_context<F, R>(&mut self, func: F) -> Result<R, GlesError>
Run custom code in the GL context owned by this renderer.
The OpenGL state of the renderer is considered an implementation detail and no guarantee is made about what can or cannot be changed, as such you should reset everything you change back to its previous value or check the source code of the version of Smithay you are using to ensure your changes don’t interfere with the renderer’s behavior. Doing otherwise can lead to rendering errors while using other functions of this renderer.
Trait Implementations§
Source§impl AsMut<GlowRenderer> for GlowFrameGuard<'_, '_, '_>
impl AsMut<GlowRenderer> for GlowFrameGuard<'_, '_, '_>
Source§fn as_mut(&mut self) -> &mut GlowRenderer
fn as_mut(&mut self) -> &mut GlowRenderer
Source§impl AsRef<GlowRenderer> for GlowFrameGuard<'_, '_, '_>
impl AsRef<GlowRenderer> for GlowFrameGuard<'_, '_, '_>
Source§fn as_ref(&self) -> &GlowRenderer
fn as_ref(&self) -> &GlowRenderer
Source§impl<T> Bind<T> for GlowRendererwhere
GlesRenderer: Bind<T>,
impl<T> Bind<T> for GlowRendererwhere
GlesRenderer: Bind<T>,
Source§impl Blit for GlowRenderer
impl Blit for GlowRenderer
Source§fn blit(
&mut self,
from: &GlesTarget<'_>,
to: &mut GlesTarget<'_>,
src: Rectangle<i32, Physical>,
dst: Rectangle<i32, Physical>,
filter: TextureFilter,
) -> Result<SyncPoint, GlesError>
fn blit( &mut self, from: &GlesTarget<'_>, to: &mut GlesTarget<'_>, src: Rectangle<i32, Physical>, dst: Rectangle<i32, Physical>, filter: TextureFilter, ) -> Result<SyncPoint, GlesError>
src from one provided target to dst in the other provided target,
applying filter if necessary. Read moreSource§impl Borrow<GlesRenderer> for GlowRenderer
impl Borrow<GlesRenderer> for GlowRenderer
Source§fn borrow(&self) -> &GlesRenderer
fn borrow(&self) -> &GlesRenderer
Source§impl BorrowMut<GlesRenderer> for GlowRenderer
impl BorrowMut<GlesRenderer> for GlowRenderer
Source§fn borrow_mut(&mut self) -> &mut GlesRenderer
fn borrow_mut(&mut self) -> &mut GlesRenderer
Source§impl Debug for GlowRenderer
impl Debug for GlowRenderer
Source§impl ExportMem for GlowRenderer
impl ExportMem for GlowRenderer
Source§type TextureMapping = GlesMapping
type TextureMapping = GlesMapping
Source§fn copy_framebuffer(
&mut self,
from: &GlesTarget<'_>,
region: Rectangle<i32, BufferCoord>,
format: Fourcc,
) -> Result<Self::TextureMapping, Self::Error>
fn copy_framebuffer( &mut self, from: &GlesTarget<'_>, region: Rectangle<i32, BufferCoord>, format: Fourcc, ) -> Result<Self::TextureMapping, Self::Error>
Source§fn copy_texture(
&mut self,
texture: &Self::TextureId,
region: Rectangle<i32, BufferCoord>,
format: Fourcc,
) -> Result<Self::TextureMapping, Self::Error>
fn copy_texture( &mut self, texture: &Self::TextureId, region: Rectangle<i32, BufferCoord>, format: Fourcc, ) -> Result<Self::TextureMapping, Self::Error>
Source§fn can_read_texture(
&mut self,
texture: &Self::TextureId,
) -> Result<bool, Self::Error>
fn can_read_texture( &mut self, texture: &Self::TextureId, ) -> Result<bool, Self::Error>
Source§fn map_texture<'a>(
&mut self,
texture_mapping: &'a Self::TextureMapping,
) -> Result<&'a [u8], Self::Error>
fn map_texture<'a>( &mut self, texture_mapping: &'a Self::TextureMapping, ) -> Result<&'a [u8], Self::Error>
Source§impl<'a, 'frame, 'buffer> FrameContext<'a, 'frame, 'buffer, GlowRenderer> for GlowFrame<'frame, 'buffer>where
'frame: 'a,
impl<'a, 'frame, 'buffer> FrameContext<'a, 'frame, 'buffer, GlowRenderer> for GlowFrame<'frame, 'buffer>where
'frame: 'a,
Source§impl From<GlesRenderer> for GlowRenderer
impl From<GlesRenderer> for GlowRenderer
Source§fn from(renderer: GlesRenderer) -> GlowRenderer
fn from(renderer: GlesRenderer) -> GlowRenderer
Source§impl ImportDma for GlowRenderer
impl ImportDma for GlowRenderer
Source§fn import_dmabuf(
&mut self,
buffer: &Dmabuf,
damage: Option<&[Rectangle<i32, BufferCoord>]>,
) -> Result<GlesTexture, GlesError>
fn import_dmabuf( &mut self, buffer: &Dmabuf, damage: Option<&[Rectangle<i32, BufferCoord>]>, ) -> Result<GlesTexture, GlesError>
Source§fn dmabuf_formats(&self) -> FormatSet
fn dmabuf_formats(&self) -> FormatSet
Source§impl ImportDmaWl for GlowRenderer
Available on crate feature wayland_frontend only.
impl ImportDmaWl for GlowRenderer
wayland_frontend only.Source§fn import_dma_buffer(
&mut self,
buffer: &WlBuffer,
_surface: Option<&SurfaceData>,
damage: &[Rectangle<i32, BufferCoord>],
) -> Result<Self::TextureId, Self::Error>
fn import_dma_buffer( &mut self, buffer: &WlBuffer, _surface: Option<&SurfaceData>, damage: &[Rectangle<i32, BufferCoord>], ) -> Result<Self::TextureId, Self::Error>
buffer_type). Read moreSource§impl ImportEgl for GlowRenderer
Available on crate features wayland_frontend and backend_egl and use_system_lib only.
impl ImportEgl for GlowRenderer
wayland_frontend and backend_egl and use_system_lib only.Source§fn bind_wl_display(&mut self, display: &DisplayHandle) -> Result<(), Error>
fn bind_wl_display(&mut self, display: &DisplayHandle) -> Result<(), Error>
Source§fn unbind_wl_display(&mut self)
fn unbind_wl_display(&mut self)
Source§fn egl_reader(&self) -> Option<&EGLBufferReader>
fn egl_reader(&self) -> Option<&EGLBufferReader>
EGLBufferReader. Read moreSource§fn import_egl_buffer(
&mut self,
buffer: &WlBuffer,
surface: Option<&SurfaceData>,
damage: &[Rectangle<i32, BufferCoord>],
) -> Result<GlesTexture, GlesError>
fn import_egl_buffer( &mut self, buffer: &WlBuffer, surface: Option<&SurfaceData>, damage: &[Rectangle<i32, BufferCoord>], ) -> Result<GlesTexture, GlesError>
buffer_type). Read moreSource§impl ImportMem for GlowRenderer
impl ImportMem for GlowRenderer
Source§fn import_memory(
&mut self,
data: &[u8],
format: Fourcc,
size: Size<i32, BufferCoord>,
flipped: bool,
) -> Result<GlesTexture, GlesError>
fn import_memory( &mut self, data: &[u8], format: Fourcc, size: Size<i32, BufferCoord>, flipped: bool, ) -> Result<GlesTexture, GlesError>
Source§impl ImportMemWl for GlowRenderer
Available on crate feature wayland_frontend only.
impl ImportMemWl for GlowRenderer
wayland_frontend only.Source§fn import_shm_buffer(
&mut self,
buffer: &WlBuffer,
surface: Option<&SurfaceData>,
damage: &[Rectangle<i32, BufferCoord>],
) -> Result<GlesTexture, GlesError>
fn import_shm_buffer( &mut self, buffer: &WlBuffer, surface: Option<&SurfaceData>, damage: &[Rectangle<i32, BufferCoord>], ) -> Result<GlesTexture, GlesError>
buffer_type). Read moreSource§impl<T> Offscreen<T> for GlowRendererwhere
GlesRenderer: Offscreen<T>,
impl<T> Offscreen<T> for GlowRendererwhere
GlesRenderer: Offscreen<T>,
Source§fn create_buffer(
&mut self,
format: Fourcc,
size: Size<i32, BufferCoord>,
) -> Result<T, GlesError>
fn create_buffer( &mut self, format: Fourcc, size: Size<i32, BufferCoord>, ) -> Result<T, GlesError>
Source§impl RenderElement<GlowRenderer> for PixelShaderElement
impl RenderElement<GlowRenderer> for PixelShaderElement
Source§fn draw(
&self,
frame: &mut GlowFrame<'_, '_>,
src: Rectangle<f64, BufferCoord>,
dst: Rectangle<i32, Physical>,
damage: &[Rectangle<i32, Physical>],
opaque_regions: &[Rectangle<i32, Physical>],
cache: Option<&UserDataMap>,
) -> Result<(), GlesError>
fn draw( &self, frame: &mut GlowFrame<'_, '_>, src: Rectangle<f64, BufferCoord>, dst: Rectangle<i32, Physical>, damage: &[Rectangle<i32, Physical>], opaque_regions: &[Rectangle<i32, Physical>], cache: Option<&UserDataMap>, ) -> Result<(), GlesError>
Source§fn underlying_storage(
&self,
renderer: &mut GlowRenderer,
) -> Option<UnderlyingStorage<'_>>
fn underlying_storage( &self, renderer: &mut GlowRenderer, ) -> Option<UnderlyingStorage<'_>>
Source§fn capture_framebuffer(
&self,
frame: &mut R::Frame<'_, '_>,
src: Rectangle<f64, BufferCoords>,
dst: Rectangle<i32, Physical>,
cache: &UserDataMap,
) -> Result<(), R::Error>
fn capture_framebuffer( &self, frame: &mut R::Frame<'_, '_>, src: Rectangle<f64, BufferCoords>, dst: Rectangle<i32, Physical>, cache: &UserDataMap, ) -> Result<(), R::Error>
frame. Read moreSource§impl RenderElement<GlowRenderer> for TextureShaderElement
impl RenderElement<GlowRenderer> for TextureShaderElement
Source§fn draw(
&self,
frame: &mut GlowFrame<'_, '_>,
src: Rectangle<f64, BufferCoord>,
dst: Rectangle<i32, Physical>,
damage: &[Rectangle<i32, Physical>],
opaque_regions: &[Rectangle<i32, Physical>],
cache: Option<&UserDataMap>,
) -> Result<(), GlesError>
fn draw( &self, frame: &mut GlowFrame<'_, '_>, src: Rectangle<f64, BufferCoord>, dst: Rectangle<i32, Physical>, damage: &[Rectangle<i32, Physical>], opaque_regions: &[Rectangle<i32, Physical>], cache: Option<&UserDataMap>, ) -> Result<(), GlesError>
Source§fn underlying_storage(
&self,
renderer: &mut GlowRenderer,
) -> Option<UnderlyingStorage<'_>>
fn underlying_storage( &self, renderer: &mut GlowRenderer, ) -> Option<UnderlyingStorage<'_>>
Source§fn capture_framebuffer(
&self,
frame: &mut R::Frame<'_, '_>,
src: Rectangle<f64, BufferCoords>,
dst: Rectangle<i32, Physical>,
cache: &UserDataMap,
) -> Result<(), R::Error>
fn capture_framebuffer( &self, frame: &mut R::Frame<'_, '_>, src: Rectangle<f64, BufferCoords>, dst: Rectangle<i32, Physical>, cache: &UserDataMap, ) -> Result<(), R::Error>
frame. Read moreSource§impl Renderer for GlowRenderer
impl Renderer for GlowRenderer
Source§fn context_id(&self) -> ContextId<GlesTexture>
fn context_id(&self) -> ContextId<GlesTexture>
Source§fn downscale_filter(&mut self, filter: TextureFilter) -> Result<(), Self::Error>
fn downscale_filter(&mut self, filter: TextureFilter) -> Result<(), Self::Error>
Source§fn upscale_filter(&mut self, filter: TextureFilter) -> Result<(), Self::Error>
fn upscale_filter(&mut self, filter: TextureFilter) -> Result<(), Self::Error>
Source§fn set_debug_flags(&mut self, flags: DebugFlags)
fn set_debug_flags(&mut self, flags: DebugFlags)
DebugFlagsSource§fn debug_flags(&self) -> DebugFlags
fn debug_flags(&self) -> DebugFlags
DebugFlagsSource§fn render<'frame, 'buffer>(
&'frame mut self,
target: &'frame mut GlesTarget<'buffer>,
output_size: Size<i32, Physical>,
transform: Transform,
) -> Result<GlowFrame<'frame, 'buffer>, Self::Error>where
'buffer: 'frame,
fn render<'frame, 'buffer>(
&'frame mut self,
target: &'frame mut GlesTarget<'buffer>,
output_size: Size<i32, Physical>,
transform: Transform,
) -> Result<GlowFrame<'frame, 'buffer>, Self::Error>where
'buffer: 'frame,
Source§impl RendererSuper for GlowRenderer
impl RendererSuper for GlowRenderer
Source§type TextureId = GlesTexture
type TextureId = GlesTexture
Source§type Framebuffer<'buffer> = GlesTarget<'buffer>
type Framebuffer<'buffer> = GlesTarget<'buffer>
Source§type Frame<'frame, 'buffer> = GlowFrame<'frame, 'buffer>
where
Self: 'frame,
'buffer: 'frame
type Frame<'frame, 'buffer> = GlowFrame<'frame, 'buffer> where Self: 'frame, 'buffer: 'frame
Renderer::render-callAuto Trait Implementations§
impl Freeze for GlowRenderer
impl !RefUnwindSafe for GlowRenderer
impl !Send for GlowRenderer
impl !Sync for GlowRenderer
impl Unpin for GlowRenderer
impl !UnwindSafe for GlowRenderer
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.Source§impl<R> ImportAll for R
impl<R> ImportAll for R
Source§fn import_buffer(
&mut self,
buffer: &WlBuffer,
surface: Option<&SurfaceData>,
damage: &[Rectangle<i32, Buffer>],
) -> Option<Result<<R as RendererSuper>::TextureId, <R as RendererSuper>::Error>>
fn import_buffer( &mut self, buffer: &WlBuffer, surface: Option<&SurfaceData>, damage: &[Rectangle<i32, Buffer>], ) -> Option<Result<<R as RendererSuper>::TextureId, <R as RendererSuper>::Error>>
wayland_frontend only.