#[repr(C)]pub struct PaintRenderingContext2D {
context: CanvasRenderingContext2D,
device_pixel_ratio: Cell<Scale<f32, CSSPixel, DevicePixel>>,
}
Fields§
§context: CanvasRenderingContext2D
§device_pixel_ratio: Cell<Scale<f32, CSSPixel, DevicePixel>>
Implementations§
source§impl PaintRenderingContext2D
impl PaintRenderingContext2D
fn __assert_parent_type(&self)
source§impl PaintRenderingContext2D
impl PaintRenderingContext2D
fn new_inherited(global: &PaintWorkletGlobalScope) -> PaintRenderingContext2D
pub fn new(
global: &PaintWorkletGlobalScope
) -> Root<Dom<PaintRenderingContext2D>>
pub fn send_data(&self, sender: IpcSender<CanvasImageData>)
pub fn take_missing_image_urls(&self) -> Vec<ServoUrl> ⓘ
pub fn set_bitmap_dimensions(
&self,
size: Size2D<f32, CSSPixel>,
device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>
)
fn scale_by_device_pixel_ratio(&self)
Trait Implementations§
source§impl DomObject for PaintRenderingContext2D
impl DomObject for PaintRenderingContext2D
source§impl DomObjectWrap for PaintRenderingContext2D
impl DomObjectWrap for PaintRenderingContext2D
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PaintRenderingContext2DBinding::PaintRenderingContext2DBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::paintrenderingcontext2d::PaintRenderingContext2D>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::paintrenderingcontext2d::PaintRenderingContext2D>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PaintRenderingContext2DBinding::PaintRenderingContext2DBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::paintrenderingcontext2d::PaintRenderingContext2D>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::paintrenderingcontext2d::PaintRenderingContext2D>>}
Function pointer to the general wrap function type
source§impl HasParent for PaintRenderingContext2D
impl HasParent for PaintRenderingContext2D
source§fn as_parent(&self) -> &CanvasRenderingContext2D
fn as_parent(&self) -> &CanvasRenderingContext2D
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = CanvasRenderingContext2D
source§impl MallocSizeOf for PaintRenderingContext2D
impl MallocSizeOf for PaintRenderingContext2D
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl MutDomObject for PaintRenderingContext2D
impl MutDomObject for PaintRenderingContext2D
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PaintRenderingContext2DMethods for PaintRenderingContext2D
impl PaintRenderingContext2DMethods for PaintRenderingContext2D
fn Save(&self)
fn Restore(&self)
fn Scale(&self, x: f64, y: f64)
fn Rotate(&self, angle: f64)
fn Translate(&self, x: f64, y: f64)
fn Transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64)
fn GetTransform(&self) -> Root<Dom<DOMMatrix>>
fn SetTransform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64)
fn ResetTransform(&self)
fn GlobalAlpha(&self) -> f64
fn SetGlobalAlpha(&self, alpha: f64)
fn GlobalCompositeOperation(&self) -> DOMString
fn SetGlobalCompositeOperation(&self, op_str: DOMString)
fn FillRect(&self, x: f64, y: f64, width: f64, height: f64)
fn ClearRect(&self, x: f64, y: f64, width: f64, height: f64)
fn StrokeRect(&self, x: f64, y: f64, width: f64, height: f64)
fn BeginPath(&self)
fn ClosePath(&self)
fn Fill(&self, fill_rule: CanvasFillRule)
fn Stroke(&self)
fn Clip(&self, fill_rule: CanvasFillRule)
fn IsPointInPath(&self, x: f64, y: f64, fill_rule: CanvasFillRule) -> bool
fn DrawImage(
&self,
image: CanvasImageSource,
dx: f64,
dy: f64
) -> Result<(), Error>
fn DrawImage_(
&self,
image: CanvasImageSource,
dx: f64,
dy: f64,
dw: f64,
dh: f64
) -> Result<(), Error>
fn DrawImage__(
&self,
image: CanvasImageSource,
sx: f64,
sy: f64,
sw: f64,
sh: f64,
dx: f64,
dy: f64,
dw: f64,
dh: f64
) -> Result<(), Error>
fn MoveTo(&self, x: f64, y: f64)
fn LineTo(&self, x: f64, y: f64)
fn Rect(&self, x: f64, y: f64, width: f64, height: f64)
fn QuadraticCurveTo(&self, cpx: f64, cpy: f64, x: f64, y: f64)
fn BezierCurveTo(&self, cp1x: f64, cp1y: f64, cp2x: f64, cp2y: f64, x: f64, y: f64)
fn Arc(
&self,
x: f64,
y: f64,
r: f64,
start: f64,
end: f64,
ccw: bool
) -> Result<(), Error>
fn ArcTo(
&self,
cp1x: f64,
cp1y: f64,
cp2x: f64,
cp2y: f64,
r: f64
) -> Result<(), Error>
fn Ellipse(
&self,
x: f64,
y: f64,
rx: f64,
ry: f64,
rotation: f64,
start: f64,
end: f64,
ccw: bool
) -> Result<(), Error>
fn ImageSmoothingEnabled(&self) -> bool
fn SetImageSmoothingEnabled(&self, value: bool)
fn StrokeStyle(&self) -> StringOrCanvasGradientOrCanvasPattern
fn SetStrokeStyle(&self, value: StringOrCanvasGradientOrCanvasPattern)
fn FillStyle(&self) -> StringOrCanvasGradientOrCanvasPattern
fn SetFillStyle(&self, value: StringOrCanvasGradientOrCanvasPattern)
fn CreateLinearGradient(
&self,
x0: Finite<f64>,
y0: Finite<f64>,
x1: Finite<f64>,
y1: Finite<f64>
) -> Root<Dom<CanvasGradient>>
fn CreateRadialGradient(
&self,
x0: Finite<f64>,
y0: Finite<f64>,
r0: Finite<f64>,
x1: Finite<f64>,
y1: Finite<f64>,
r1: Finite<f64>
) -> Result<Root<Dom<CanvasGradient>>, Error>
fn CreatePattern(
&self,
image: CanvasImageSource,
repetition: DOMString
) -> Result<Option<Root<Dom<CanvasPattern>>>, Error>
fn LineWidth(&self) -> f64
fn SetLineWidth(&self, width: f64)
fn LineCap(&self) -> CanvasLineCap
fn SetLineCap(&self, cap: CanvasLineCap)
fn LineJoin(&self) -> CanvasLineJoin
fn SetLineJoin(&self, join: CanvasLineJoin)
fn MiterLimit(&self) -> f64
fn SetMiterLimit(&self, limit: f64)
fn ShadowOffsetX(&self) -> f64
fn SetShadowOffsetX(&self, value: f64)
fn ShadowOffsetY(&self) -> f64
fn SetShadowOffsetY(&self, value: f64)
fn ShadowBlur(&self) -> f64
fn SetShadowBlur(&self, value: f64)
fn ShadowColor(&self) -> DOMString
fn SetShadowColor(&self, value: DOMString)
source§impl PartialEq<PaintRenderingContext2D> for PaintRenderingContext2D
impl PartialEq<PaintRenderingContext2D> for PaintRenderingContext2D
source§fn eq(&self, other: &PaintRenderingContext2D) -> bool
fn eq(&self, other: &PaintRenderingContext2D) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.Auto Trait Implementations§
impl !RefUnwindSafe for PaintRenderingContext2D
impl !Send for PaintRenderingContext2D
impl !Sync for PaintRenderingContext2D
impl Unpin for PaintRenderingContext2D
impl !UnwindSafe for PaintRenderingContext2D
Blanket Implementations§
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> 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> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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