Struct webrender::prim_store::text_run::TextRunPrimitive
source · pub struct TextRunPrimitive {
pub used_font: FontInstance,
pub glyph_keys_range: Range<GlyphKey>,
pub reference_frame_relative_offset: LayoutVector2D,
pub snapped_reference_frame_relative_offset: LayoutVector2D,
pub shadow: bool,
pub raster_scale: f32,
pub requested_raster_space: RasterSpace,
}
Fields§
§used_font: FontInstance
§glyph_keys_range: Range<GlyphKey>
§reference_frame_relative_offset: LayoutVector2D
§snapped_reference_frame_relative_offset: LayoutVector2D
§shadow: bool
§raster_scale: f32
§requested_raster_space: RasterSpace
Implementations§
source§impl TextRunPrimitive
impl TextRunPrimitive
pub fn update_font_instance( &mut self, specified_font: &FontInstance, surface: &SurfaceInfo, spatial_node_index: SpatialNodeIndex, transform: &LayoutToWorldTransform, allow_subpixel: bool, raster_space: RasterSpace, spatial_tree: &SpatialTree, ) -> bool
sourcefn get_raster_space_for_prim(
&self,
prim_spatial_node_index: SpatialNodeIndex,
low_quality_pinch_zoom: bool,
device_pixel_scale: DevicePixelScale,
spatial_tree: &SpatialTree,
) -> RasterSpace
fn get_raster_space_for_prim( &self, prim_spatial_node_index: SpatialNodeIndex, low_quality_pinch_zoom: bool, device_pixel_scale: DevicePixelScale, spatial_tree: &SpatialTree, ) -> RasterSpace
Gets the raster space to use when rendering this primitive. Usually this would be the requested raster space. However, if the primitive’s spatial node or one of its ancestors is being pinch zoomed then we round it. This prevents us rasterizing glyphs for every minor change in zoom level, as that would be too expensive.
pub fn request_resources( &mut self, prim_offset: LayoutVector2D, specified_font: &FontInstance, glyphs: &[GlyphInstance], transform: &LayoutToWorldTransform, surface: &SurfaceInfo, spatial_node_index: SpatialNodeIndex, allow_subpixel: bool, low_quality_pinch_zoom: bool, resource_cache: &mut ResourceCache, gpu_cache: &mut GpuCache, spatial_tree: &SpatialTree, scratch: &mut PrimitiveScratchBuffer, )
Trait Implementations§
source§impl Debug for TextRunPrimitive
impl Debug for TextRunPrimitive
Auto Trait Implementations§
impl Freeze for TextRunPrimitive
impl RefUnwindSafe for TextRunPrimitive
impl Send for TextRunPrimitive
impl Sync for TextRunPrimitive
impl Unpin for TextRunPrimitive
impl UnwindSafe for TextRunPrimitive
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