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>>; 5],
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>>; 5]§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
impl RenderTarget
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
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, )
pub fn texture_id(&self) -> CacheTextureId
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, )
pub fn needs_depth(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RenderTarget
impl RefUnwindSafe for RenderTarget
impl Send for RenderTarget
impl !Sync for RenderTarget
impl Unpin for RenderTarget
impl UnwindSafe for RenderTarget
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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