pub struct SurfaceInfo {Show 14 fields
    pub unclipped_local_rect: PictureRect,
    pub clipped_local_rect: PictureRect,
    pub clipping_rect: PictureRect,
    pub culling_rect: VisRect,
    pub map_local_to_picture: SpaceMapper<LayoutPixel, PicturePixel>,
    pub surface_spatial_node_index: SpatialNodeIndex,
    pub raster_spatial_node_index: SpatialNodeIndex,
    pub visibility_spatial_node_index: SpatialNodeIndex,
    pub device_pixel_scale: DevicePixelScale,
    pub world_scale_factors: (f32, f32),
    pub local_scale: (f32, f32),
    pub is_opaque: bool,
    pub allow_snapping: bool,
    pub force_scissor_rect: bool,
}Expand description
Information about an offscreen surface. For now, it contains information about the size and coordinate system of the surface. In the future, it will contain information about the contents of the surface, which will allow surfaces to be cached / retained between frames and display lists.
Fields§
§unclipped_local_rect: PictureRectA local rect defining the size of this surface, in the coordinate system of the parent surface. This contains the unclipped bounding rect of child primitives.
clipped_local_rect: PictureRectThe local space coverage of child primitives after they are are clipped to their owning clip-chain.
clipping_rect: PictureRectThe (conservative) valid part of this surface rect. Used to reduce the size of render target allocation.
culling_rect: VisRectThe rectangle to use for culling and clipping.
map_local_to_picture: SpaceMapper<LayoutPixel, PicturePixel>Helper structs for mapping local rects in different coordinate systems into the picture coordinates.
surface_spatial_node_index: SpatialNodeIndexThe positioning node for the surface itself,
raster_spatial_node_index: SpatialNodeIndexThe rasterization root for this surface.
visibility_spatial_node_index: SpatialNodeIndexThe spatial node for culling and clipping (anything using VisPixel). TODO: Replace with the raster spatial node.
device_pixel_scale: DevicePixelScaleThe device pixel ratio specific to this surface.
world_scale_factors: (f32, f32)The scale factors of the surface to world transform.
local_scale: (f32, f32)Local scale factors surface to raster transform
is_opaque: boolIf true, we know this surface is completely opaque.
allow_snapping: boolIf true, allow snapping on this and child surfaces
force_scissor_rect: boolIf true, the scissor rect must be set when drawing this surface
Implementations§
Source§impl SurfaceInfo
 
impl SurfaceInfo
pub fn new( surface_spatial_node_index: SpatialNodeIndex, raster_spatial_node_index: SpatialNodeIndex, world_rect: WorldRect, spatial_tree: &SpatialTree, device_pixel_scale: DevicePixelScale, world_scale_factors: (f32, f32), local_scale: (f32, f32), allow_snapping: bool, force_scissor_rect: bool, ) -> Self
Sourcepub fn clamp_blur_radius(
    &self,
    x_blur_radius: f32,
    y_blur_radius: f32,
) -> (f32, f32)
 
pub fn clamp_blur_radius( &self, x_blur_radius: f32, y_blur_radius: f32, ) -> (f32, f32)
Clamps the blur radius depending on scale factors.
pub fn update_culling_rect( &mut self, parent_culling_rect: VisRect, composite_mode: &PictureCompositeMode, frame_context: &FrameVisibilityContext<'_>, )
pub fn map_to_device_rect( &self, picture_rect: &PictureRect, spatial_tree: &SpatialTree, ) -> DeviceRect
Sourcepub fn get_surface_rect(
    &self,
    local_rect: &PictureRect,
    spatial_tree: &SpatialTree,
) -> Option<DeviceIntRect>
 
pub fn get_surface_rect( &self, local_rect: &PictureRect, spatial_tree: &SpatialTree, ) -> Option<DeviceIntRect>
Clip and transform a local rect to a device rect suitable for allocating a child off-screen surface of this surface (e.g. for clip-masks)
Auto Trait Implementations§
impl Freeze for SurfaceInfo
impl RefUnwindSafe for SurfaceInfo
impl Send for SurfaceInfo
impl Sync for SurfaceInfo
impl Unpin for SurfaceInfo
impl UnwindSafe for SurfaceInfo
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
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>
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>
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