Add `PFCanvasFontContextClone()`

This commit is contained in:
Patrick Walton 2019-06-04 14:55:26 -07:00
parent 3be3de23d8
commit e3112d1a84
2 changed files with 7 additions and 0 deletions

View File

@ -116,6 +116,7 @@ PFCanvasRef PFCanvasCreate(PFCanvasFontContextRef font_context, const PFVector2F
void PFCanvasDestroy(PFCanvasRef canvas);
PFCanvasFontContextRef PFCanvasFontContextCreate();
void PFCanvasFontContextDestroy(PFCanvasFontContextRef font_context);
PFCanvasFontContextRef PFCanvasFontContextClone(PFCanvasFontContextRef font_context);
PFSceneRef PFCanvasCreateScene(PFCanvasRef canvas);
void PFCanvasFillRect(PFCanvasRef canvas, const PFRectF *rect);
void PFCanvasStrokeRect(PFCanvasRef canvas, const PFRectF *rect);

View File

@ -131,6 +131,12 @@ pub unsafe extern "C" fn PFCanvasFontContextDestroy(font_context: PFCanvasFontCo
drop(Box::from_raw(font_context))
}
#[no_mangle]
pub unsafe extern "C" fn PFCanvasFontContextClone(font_context: PFCanvasFontContextRef)
-> PFCanvasFontContextRef {
Box::into_raw(Box::new((*font_context).clone()))
}
/// Consumes the canvas.
#[no_mangle]
pub unsafe extern "C" fn PFCanvasCreateScene(canvas: PFCanvasRef) -> PFSceneRef {