pub(crate) struct CanvasData<DrawTarget: GenericDrawTarget> {
drawtarget: DrawTarget,
compositor_api: CrossProcessCompositorApi,
image_key: ImageKey,
}
Fields§
§drawtarget: DrawTarget
§compositor_api: CrossProcessCompositorApi
§image_key: ImageKey
Implementations§
Source§impl<DrawTarget: GenericDrawTarget> CanvasData<DrawTarget>
impl<DrawTarget: GenericDrawTarget> CanvasData<DrawTarget>
pub(crate) fn new( size: Size2D<u64>, compositor_api: CrossProcessCompositorApi, ) -> CanvasData<DrawTarget>
pub(crate) fn image_key(&self) -> ImageKey
pub(crate) fn draw_image( &mut self, snapshot: Snapshot, dest_rect: Rect<f64>, source_rect: Rect<f64>, smoothing_enabled: bool, shadow_options: ShadowOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
pub(crate) fn fill_text( &mut self, text_bounds: Rect<f64>, text_runs: Vec<TextRun>, fill_or_stroke_style: FillOrStrokeStyle, _shadow_options: ShadowOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
pub(crate) fn fill_rect( &mut self, rect: &Rect<f32>, style: FillOrStrokeStyle, shadow_options: ShadowOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
pub(crate) fn clear_rect( &mut self, rect: &Rect<f32>, transform: Transform2D<f64>, )
pub(crate) fn stroke_rect( &mut self, rect: &Rect<f32>, style: FillOrStrokeStyle, line_options: LineOptions, shadow_options: ShadowOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
pub(crate) fn fill_path( &mut self, path: &Path, fill_rule: FillRule, style: FillOrStrokeStyle, _shadow_options: ShadowOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
pub(crate) fn stroke_path( &mut self, path: &Path, style: FillOrStrokeStyle, line_options: LineOptions, _shadow_options: ShadowOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
pub(crate) fn clip_path( &mut self, path: &Path, fill_rule: FillRule, transform: Transform2D<f64>, )
Sourcepub(crate) fn update_image_rendering(&mut self, canvas_epoch: Option<Epoch>)
pub(crate) fn update_image_rendering(&mut self, canvas_epoch: Option<Epoch>)
Update image in WebRender
pub(crate) fn put_image_data(&mut self, snapshot: Snapshot, rect: Rect<u32>)
fn create_draw_target_for_shadow(&self, source_rect: &Rect<f32>) -> DrawTarget
fn draw_with_shadow<F>( &self, rect: &Rect<f32>, shadow_options: ShadowOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, draw_shadow_source: F, )
Sourcefn maybe_bound_shape_with_pattern<F>(
&mut self,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
path_bound_box: &Rect<f64>,
transform: Transform2D<f64>,
draw_shape: F,
)where
F: FnOnce(&mut Self, FillOrStrokeStyle),
fn maybe_bound_shape_with_pattern<F>(
&mut self,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
path_bound_box: &Rect<f64>,
transform: Transform2D<f64>,
draw_shape: F,
)where
F: FnOnce(&mut Self, FillOrStrokeStyle),
Push a clip to the draw target to respect the non-repeating bound (either x, y, or both) of the given pattern.
Sourcepub(crate) fn read_pixels(&mut self, read_rect: Option<Rect<u32>>) -> Snapshot
pub(crate) fn read_pixels(&mut self, read_rect: Option<Rect<u32>>) -> Snapshot
It reads image data from the canvas canvas_size: The size of the canvas we’re reading from read_rect: The area of the canvas we want to read from
pub(crate) fn pop_clips(&mut self, clips: usize)
Trait Implementations§
Source§impl<D: GenericDrawTarget> Drop for CanvasData<D>
impl<D: GenericDrawTarget> Drop for CanvasData<D>
Auto Trait Implementations§
impl<DrawTarget> Freeze for CanvasData<DrawTarget>where
DrawTarget: Freeze,
impl<DrawTarget> !RefUnwindSafe for CanvasData<DrawTarget>
impl<DrawTarget> Send for CanvasData<DrawTarget>where
DrawTarget: Send,
impl<DrawTarget> !Sync for CanvasData<DrawTarget>
impl<DrawTarget> Unpin for CanvasData<DrawTarget>where
DrawTarget: Unpin,
impl<DrawTarget> UnwindSafe for CanvasData<DrawTarget>where
DrawTarget: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert