webrender::render_target

Struct RenderTarget

Source
pub struct RenderTarget {
Show 27 fields pub target_kind: RenderTargetKind, pub cached: bool, screen_size: DeviceIntSize, pub texture_id: CacheTextureId, pub alpha_batch_containers: Vec<AlphaBatchContainer, FrameAllocator>, pub vertical_blurs: FastHashMap<TextureSource, Vec<BlurInstance, FrameAllocator>>, pub horizontal_blurs: FastHashMap<TextureSource, Vec<BlurInstance, FrameAllocator>>, pub scalings: FastHashMap<TextureSource, Vec<ScalingInstance, FrameAllocator>>, pub svg_filters: Vec<(BatchTextures, Vec<SvgFilterInstance, FrameAllocator>), FrameAllocator>, pub svg_nodes: Vec<(BatchTextures, Vec<SVGFEFilterInstance, FrameAllocator>), FrameAllocator>, pub blits: Vec<BlitJob, FrameAllocator>, alpha_tasks: Vec<RenderTaskId, FrameAllocator>, pub resolve_ops: Vec<ResolveOp, FrameAllocator>, pub prim_instances: [FastHashMap<TextureSource, Vec<PrimitiveInstanceData, FrameAllocator>>; 4], pub prim_instances_with_scissor: FastHashMap<(DeviceIntRect, PatternKind), FastHashMap<TextureSource, Vec<PrimitiveInstanceData, FrameAllocator>>>, pub clip_masks: ClipMaskInstanceList, pub border_segments_complex: Vec<BorderInstance, FrameAllocator>, pub border_segments_solid: Vec<BorderInstance, FrameAllocator>, pub line_decorations: Vec<LineDecorationJob, FrameAllocator>, pub fast_linear_gradients: Vec<FastLinearGradientInstance, FrameAllocator>, pub linear_gradients: Vec<LinearGradientInstance, FrameAllocator>, pub radial_gradients: Vec<RadialGradientInstance, FrameAllocator>, pub conic_gradients: Vec<ConicGradientInstance, FrameAllocator>, pub clip_batcher: ClipBatcher, pub clears: Vec<(DeviceIntRect, ColorF), FrameAllocator>, pub used_rect: Option<DeviceIntRect>, pub clear_color: Option<ColorF>,
}
Expand description

Contains the work (in the form of instance arrays) needed to fill a color color (RGBA8) or alpha output surface.

In graphics parlance, a “render target” usually means “a surface (texture or framebuffer) bound to the output of a shader”. This struct has a slightly different meaning, in that it represents the operations on that surface before it’s actually bound and rendered. So a RenderTarget is built by the RenderBackend by inserting tasks, and then shipped over to the Renderer where a device surface is resolved and the tasks are transformed into draw commands on that surface.

Fields§

§target_kind: RenderTargetKind§cached: bool§screen_size: DeviceIntSize§texture_id: CacheTextureId§alpha_batch_containers: Vec<AlphaBatchContainer, FrameAllocator>§vertical_blurs: FastHashMap<TextureSource, Vec<BlurInstance, FrameAllocator>>§horizontal_blurs: FastHashMap<TextureSource, Vec<BlurInstance, FrameAllocator>>§scalings: FastHashMap<TextureSource, Vec<ScalingInstance, FrameAllocator>>§svg_filters: Vec<(BatchTextures, Vec<SvgFilterInstance, FrameAllocator>), FrameAllocator>§svg_nodes: Vec<(BatchTextures, Vec<SVGFEFilterInstance, FrameAllocator>), FrameAllocator>§blits: Vec<BlitJob, FrameAllocator>§alpha_tasks: Vec<RenderTaskId, FrameAllocator>§resolve_ops: Vec<ResolveOp, FrameAllocator>§prim_instances: [FastHashMap<TextureSource, Vec<PrimitiveInstanceData, FrameAllocator>>; 4]§prim_instances_with_scissor: FastHashMap<(DeviceIntRect, PatternKind), FastHashMap<TextureSource, Vec<PrimitiveInstanceData, FrameAllocator>>>§clip_masks: ClipMaskInstanceList§border_segments_complex: Vec<BorderInstance, FrameAllocator>§border_segments_solid: Vec<BorderInstance, FrameAllocator>§line_decorations: Vec<LineDecorationJob, FrameAllocator>§fast_linear_gradients: Vec<FastLinearGradientInstance, FrameAllocator>§linear_gradients: Vec<LinearGradientInstance, FrameAllocator>§radial_gradients: Vec<RadialGradientInstance, FrameAllocator>§conic_gradients: Vec<ConicGradientInstance, FrameAllocator>§clip_batcher: ClipBatcher§clears: Vec<(DeviceIntRect, ColorF), FrameAllocator>§used_rect: Option<DeviceIntRect>§clear_color: Option<ColorF>

Implementations§

Source§

impl RenderTarget

Source

pub fn new( target_kind: RenderTargetKind, cached: bool, texture_id: CacheTextureId, screen_size: DeviceIntSize, gpu_supports_fast_clears: bool, used_rect: Option<DeviceIntRect>, memory: &FrameMemory, ) -> Self

Source

pub fn build( &mut self, ctx: &mut RenderTargetContext<'_, '_>, gpu_cache: &mut GpuCache, render_tasks: &RenderTaskGraph, prim_headers: &mut PrimitiveHeaders, transforms: &mut TransformPalette, z_generator: &mut ZBufferIdGenerator, prim_instances: &[PrimitiveInstance], cmd_buffers: &CommandBufferList, gpu_buffer_builder: &mut GpuBufferBuilder, )

Source

pub fn texture_id(&self) -> CacheTextureId

Source

pub fn add_task( &mut self, task_id: RenderTaskId, ctx: &RenderTargetContext<'_, '_>, gpu_cache: &mut GpuCache, gpu_buffer_builder: &mut GpuBufferBuilder, render_tasks: &RenderTaskGraph, clip_store: &ClipStore, transforms: &mut TransformPalette, )

Source

pub fn needs_depth(&self) -> bool

Trait Implementations§

Source§

impl Serialize for RenderTarget

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.