[−][src]Struct webrender::Renderer
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: Device
gpu_glyph_renderer: GpuGlyphRenderer
gpu_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]
gl: Rc<dyn Gl>,
notifier: Box<dyn RenderNotifier>,
options: RendererOptions,
shaders: Option<&mut WrShaders>
) -> Result<(Self, RenderApiSender), RendererError>
Initializes WebRender and creates a Renderer
and RenderApiSender
.
Examples
Initializes a Renderer
with some reasonable values. For more information see
RendererOptions
.
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]
&mut self,
handler: Box<dyn ExternalImageHandler>
)
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]
&mut self,
framebuffer_size: DeviceIntSize
) -> Result<RenderResults, Vec<RendererError>>
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]
&mut self,
rect: DeviceIntRect,
format: ReadPixelsFormat,
output: &mut [u8]
)
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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self