// cairo_path_t* cairo_copy_path (cairo_t *cr); func (self *Surface) CopyPath() (PathData, Status) { path := C.cairo_copy_path(self.context) defer C.cairo_path_destroy(path) raw_data := make(PathData, int(path.num_data*2)) C.memcpy(unsafe.Pointer(&raw_data[0]), unsafe.Pointer(path.data), C.size_t(path.num_data*16)) return raw_data, Status(path.status) }
//CopyPath returns a copy of the current path. // //Originally cairo_copy_path. func (c *Context) CopyPath() (Path, error) { p := C.cairo_copy_path(c.c) defer C.cairo_path_destroy(p) return cPath(p) }