Implement debug view and load system fonts

This commit is contained in:
Héctor Ramón Jiménez 2019-11-03 04:39:11 +01:00
parent ef056d8489
commit 2c6bfdbc8c
17 changed files with 418 additions and 241 deletions

View file

@ -206,7 +206,6 @@ mod element;
mod event;
mod hasher;
mod layout;
mod metrics;
mod mouse_cursor;
mod node;
mod style;
@ -225,7 +224,6 @@ pub use element::Element;
pub use event::Event;
pub use hasher::Hasher;
pub use layout::Layout;
pub use metrics::Metrics;
pub use mouse_cursor::MouseCursor;
pub use node::Node;
pub use renderer::Renderer;

View file

@ -1,11 +0,0 @@
use std::time;
/// A bunch of metrics about an Iced application.
#[derive(Debug, Clone, Copy)]
pub struct Metrics {
pub startup_time: time::Duration,
pub update_time: time::Duration,
pub view_time: time::Duration,
pub renderer_output_time: time::Duration,
pub message_count: usize,
}

View file

@ -1,4 +1,4 @@
use crate::{Metrics, MouseCursor};
use crate::MouseCursor;
use raw_window_handle::HasRawWindowHandle;
@ -7,10 +7,10 @@ pub trait Windowed: super::Renderer + Sized {
fn new() -> Self;
fn draw(
fn draw<T: AsRef<str>>(
&mut self,
output: &Self::Output,
metrics: Option<Metrics>,
overlay: &[T],
target: &mut Self::Target,
) -> MouseCursor;
}