Struct webrender::picture::SurfaceInfo
source · pub struct SurfaceInfo {
pub unclipped_local_rect: PictureRect,
pub clipped_local_rect: PictureRect,
pub is_opaque: bool,
pub clipping_rect: PictureRect,
pub map_local_to_picture: SpaceMapper<LayoutPixel, PicturePixel>,
pub surface_spatial_node_index: SpatialNodeIndex,
pub raster_spatial_node_index: SpatialNodeIndex,
pub device_pixel_scale: DevicePixelScale,
pub world_scale_factors: (f32, f32),
pub local_scale: (f32, f32),
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: PictureRect
A 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: PictureRect
The local space coverage of child primitives after they are are clipped to their owning clip-chain.
is_opaque: bool
If true, we know this surface is completely opaque
clipping_rect: PictureRect
The (conservative) valid part of this surface rect. Used to reduce the size of render target allocation.
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: SpatialNodeIndex
The positioning node for the surface itself,
raster_spatial_node_index: SpatialNodeIndex
The rasterization root for this surface.
device_pixel_scale: DevicePixelScale
The 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
allow_snapping: bool
If true, allow snapping on this and child surfaces
force_scissor_rect: bool
If 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 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