pub struct D2DFactory(_);
Expand description

A Direct2D factory object.

This struct is public only to use for system integration in piet_common and druid-shell. It is not intended that end-users directly use this struct.

Implementations§

source§

impl D2DFactory

source

pub fn new() -> Result<D2DFactory, Error>

Create a new Direct2D factory.

This requires Windows 7 platform update, and can also fail if resources are unavailable.

source

pub unsafe fn create_device(
    &self,
    dxgi_device: *mut IDXGIDevice
) -> Result<D2DDevice, Error>

Create D2D Device

Safety

TODO

source

pub fn get_raw(&self) -> *mut ID2D1Factory1

Get the raw pointer

source

pub fn create_path_geometry(&self) -> Result<PathGeometry, Error>

source

pub fn create_rect_geometry(
    &self,
    rect: Rect
) -> Result<RectangleGeometry, Error>

source

pub fn create_round_rect_geometry(
    &self,
    rect: Rect,
    radius: f64
) -> Result<RoundedRectangleGeometry, Error>

source

pub fn create_circle_geometry(
    &self,
    circle: Circle
) -> Result<EllipseGeometry, Error>

source

pub fn create_stroke_style(
    &self,
    props: &D2D1_STROKE_STYLE_PROPERTIES,
    dashes: Option<&[f32]>
) -> Result<StrokeStyle, Error>

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> RoundFrom<T> for T

source§

fn round_from(x: T) -> T

Performs the conversion.
source§

impl<T, U> RoundInto<U> for Twhere
    U: RoundFrom<T>,

source§

fn round_into(self) -> U

Performs the conversion.
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.