graphics-server: use String for String opcode

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-10-30 11:19:17 +08:00
parent f149c086ef
commit 9192775e5e

View file

@ -2,6 +2,7 @@
pub mod api;
pub use api::{Point, Color, Rect};
use xous::String;
use xous::{send_message, CID};
@ -29,6 +30,6 @@ pub fn clear_region(cid: CID, x0: usize, y0: usize, x1: usize, y1: usize) -> Res
send_message(cid, api::Opcode::ClearRegion(Rect::new(x0 as _, y0 as _, x1 as _, y1 as _)).into()).map(|_| ())
}
pub fn draw_string(cid: CID, s: &str) -> Result<(), xous::Error> {
send_message(cid, api::Opcode::String(s).into()).map(|_| ())
pub fn draw_string(cid: CID, s: &String) -> Result<(), xous::Error> {
s.lend(cid, 1).map(|_| ())
}