[][src]Struct webrender::Renderer

pub struct Renderer {
    pub device: Device,
    pub gpu_glyph_renderer: GpuGlyphRenderer,
    pub gpu_profile: GpuProfiler<GpuProfileTag>,
    pub renderer_errors: Vec<RendererError>,
    // some fields omitted
}

The renderer is responsible for submitting to the GPU the work prepared by the RenderBackend.

We have a separate Renderer instance for each instance of WebRender (generally one per OS window), and all instances share the same thread.

Fields

device: Devicegpu_glyph_renderer: GpuGlyphRenderergpu_profile: GpuProfiler<GpuProfileTag>renderer_errors: Vec<RendererError>

Methods

impl Renderer[src]

pub fn new(
    gl: Rc<dyn Gl>,
    notifier: Box<dyn RenderNotifier>,
    options: RendererOptions,
    shaders: Option<&mut WrShaders>
) -> Result<(Self, RenderApiSender), RendererError>
[src]

Initializes WebRender and creates a Renderer and RenderApiSender.

Examples

Initializes a Renderer with some reasonable values. For more information see RendererOptions.

This example is not tested
let opts = webrender::RendererOptions {
   device_pixel_ratio: 1.0,
   resource_override_path: None,
   enable_aa: false,
};
let (renderer, sender) = Renderer::new(opts);

pub fn set_cursor_position(&mut self, position: DeviceIntPoint)[src]

Update the current position of the debug cursor.

pub fn get_max_texture_size(&self) -> i32[src]

pub fn get_graphics_api_info(&self) -> GraphicsApiInfo[src]

pub fn current_epoch(&self, pipeline_id: PipelineId) -> Option<Epoch>[src]

Returns the Epoch of the current frame in a pipeline.

pub fn flush_pipeline_info(&mut self) -> PipelineInfo[src]

pub fn update_program_cache(&mut self, cached_programs: Rc<ProgramCache>)[src]

pub fn update(&mut self)[src]

Processes the result queue.

Should be called before render(), as texture cache updates are done here.

pub fn set_external_image_handler(
    &mut self,
    handler: Box<dyn ExternalImageHandler>
)
[src]

Set a callback for handling external images.

pub fn set_output_image_handler(&mut self, handler: Box<dyn OutputImageHandler>)[src]

Set a callback for handling external outputs.

pub fn get_frame_profiles(&mut self) -> (Vec<CpuProfile>, Vec<GpuProfile>)[src]

Retrieve (and clear) the current list of recorded frame profiles.

pub fn notify_slow_frame(&mut self)[src]

pub fn render(
    &mut self,
    framebuffer_size: DeviceIntSize
) -> Result<RenderResults, Vec<RendererError>>
[src]

Renders the current frame.

A Frame is supplied by calling generate_frame().

pub fn debug_renderer<'b>(&'b mut self) -> Option<&'b mut DebugRenderer>[src]

pub fn get_debug_flags(&self) -> DebugFlags[src]

pub fn set_debug_flags(&mut self, flags: DebugFlags)[src]

pub fn save_cpu_profile(&self, filename: &str)[src]

pub fn read_pixels_into(
    &mut self,
    rect: DeviceIntRect,
    format: ReadPixelsFormat,
    output: &mut [u8]
)
[src]

Pass-through to Device::read_pixels_into, used by Gecko's WR bindings.

pub fn read_pixels_rgba8(&mut self, rect: DeviceIntRect) -> Vec<u8>[src]

pub fn read_gpu_cache(&mut self) -> (DeviceIntSize, Vec<u8>)[src]

pub fn deinit(self)[src]

pub fn report_memory(&self) -> MemoryReport[src]

Collects a memory report.

Auto Trait Implementations

impl !Send for Renderer

impl !Sync for Renderer

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self