[−][src]Struct webrender::Renderer
The renderer is responsible for submitting to the GPU the work prepared by the RenderBackend.
Fields
device: Device
gpu_glyph_renderer: GpuGlyphRenderer
gpu_profile: GpuProfiler<GpuProfileTag>
renderer_errors: Vec<RendererError>
Methods
impl Renderer
[src]
impl Renderer
pub fn new(
gl: Rc<Gl>,
notifier: Box<RenderNotifier>,
options: RendererOptions
) -> Result<(Self, RenderApiSender), RendererError>
[src]
pub fn new(
gl: Rc<Gl>,
notifier: Box<RenderNotifier>,
options: RendererOptions
) -> 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 get_max_texture_size(&self) -> u32
[src]
pub fn get_max_texture_size(&self) -> u32
pub fn get_graphics_api_info(&self) -> GraphicsApiInfo
[src]
pub fn get_graphics_api_info(&self) -> GraphicsApiInfo
pub fn current_epoch(&self, pipeline_id: PipelineId) -> Option<Epoch>
[src]
pub fn current_epoch(&self, pipeline_id: PipelineId) -> Option<Epoch>
Returns the Epoch of the current frame in a pipeline.
pub fn flush_pipeline_info(&mut self) -> PipelineInfo
[src]
pub fn flush_pipeline_info(&mut self) -> PipelineInfo
pub fn update_program_cache(&mut self, cached_programs: Rc<ProgramCache>)
[src]
pub fn update_program_cache(&mut self, cached_programs: Rc<ProgramCache>)
pub fn update(&mut self)
[src]
pub fn update(&mut self)
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<ExternalImageHandler>)
[src]
pub fn set_external_image_handler(&mut self, handler: Box<ExternalImageHandler>)
Set a callback for handling external images.
pub fn set_output_image_handler(&mut self, handler: Box<OutputImageHandler>)
[src]
pub fn set_output_image_handler(&mut self, handler: Box<OutputImageHandler>)
Set a callback for handling external outputs.
pub fn get_frame_profiles(&mut self) -> (Vec<CpuProfile>, Vec<GpuProfile>)
[src]
pub fn get_frame_profiles(&mut self) -> (Vec<CpuProfile>, Vec<GpuProfile>)
Retrieve (and clear) the current list of recorded frame profiles.
pub fn render(
&mut self,
framebuffer_size: DeviceUintSize
) -> Result<RendererStats, Vec<RendererError>>
[src]
pub fn render(
&mut self,
framebuffer_size: DeviceUintSize
) -> Result<RendererStats, Vec<RendererError>>
Renders the current frame.
A Frame is supplied by calling [generate_frame()
][genframe].
[genframe]: ../../webrender_api/struct.DocumentApi.html#method.generate_frame
pub fn get_debug_flags(&self) -> DebugFlags
[src]
pub fn get_debug_flags(&self) -> DebugFlags
pub fn set_debug_flags(&mut self, flags: DebugFlags)
[src]
pub fn set_debug_flags(&mut self, flags: DebugFlags)
pub fn set_debug_flag(&mut self, flag: DebugFlags, enabled: bool)
[src]
pub fn set_debug_flag(&mut self, flag: DebugFlags, enabled: bool)
pub fn toggle_debug_flags(&mut self, toggle: DebugFlags)
[src]
pub fn toggle_debug_flags(&mut self, toggle: DebugFlags)
pub fn save_cpu_profile(&self, filename: &str)
[src]
pub fn save_cpu_profile(&self, filename: &str)
pub fn read_pixels_into(
&mut self,
rect: DeviceUintRect,
format: ReadPixelsFormat,
output: &mut [u8]
)
[src]
pub fn read_pixels_into(
&mut self,
rect: DeviceUintRect,
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: DeviceUintRect) -> Vec<u8>
[src]
pub fn read_pixels_rgba8(&mut self, rect: DeviceUintRect) -> Vec<u8>
pub fn read_gpu_cache(&mut self) -> (DeviceUintSize, Vec<u8>)
[src]
pub fn read_gpu_cache(&mut self) -> (DeviceUintSize, Vec<u8>)
pub fn deinit(self)
[src]
pub fn deinit(self)
pub fn report_memory(&self) -> MemoryReport
[src]
pub fn report_memory(&self) -> MemoryReport
Collects a memory report.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
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]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
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]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more