From 4aed0fa4b6d63b739b5557ef16f6077988cd2758 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 19 May 2020 20:01:55 +0200 Subject: Rename `window::Backend` to `Compositor` --- examples/tour/src/main.rs | 2 +- glow/src/window.rs | 4 +- glow/src/window/backend.rs | 188 ---------------------------------------- glow/src/window/compositor.rs | 188 ++++++++++++++++++++++++++++++++++++++++ native/src/window.rs | 4 +- native/src/window/backend.rs | 60 ------------- native/src/window/compositor.rs | 60 +++++++++++++ src/application.rs | 2 +- wgpu/src/window.rs | 4 +- wgpu/src/window/backend.rs | 119 ------------------------- wgpu/src/window/compositor.rs | 119 +++++++++++++++++++++++++ winit/src/application.rs | 32 ++++--- 12 files changed, 395 insertions(+), 387 deletions(-) delete mode 100644 glow/src/window/backend.rs create mode 100644 glow/src/window/compositor.rs delete mode 100644 native/src/window/backend.rs create mode 100644 native/src/window/compositor.rs delete mode 100644 wgpu/src/window/backend.rs create mode 100644 wgpu/src/window/compositor.rs diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs index 729ae8fb..8c3b1d19 100644 --- a/examples/tour/src/main.rs +++ b/examples/tour/src/main.rs @@ -26,7 +26,7 @@ pub struct Tour { } impl Application for Tour { - type Backend = window::Backend; + type Compositor = window::Compositor; type Executor = executor::Null; type Message = Message; type Flags = (); diff --git a/glow/src/window.rs b/glow/src/window.rs index a8edb016..aac5fb9e 100644 --- a/glow/src/window.rs +++ b/glow/src/window.rs @@ -1,4 +1,4 @@ //! Display rendering results on windows. -mod backend; +mod compositor; -pub use backend::Backend; +pub use compositor::Compositor; diff --git a/glow/src/window/backend.rs b/glow/src/window/backend.rs deleted file mode 100644 index 34245f35..00000000 --- a/glow/src/window/backend.rs +++ /dev/null @@ -1,188 +0,0 @@ -use crate::{Renderer, Settings, Viewport}; - -use glow::HasContext; -use iced_native::mouse; -use raw_window_handle::HasRawWindowHandle; - -/// A window graphics backend for iced powered by `glow`. -#[allow(missing_debug_implementations)] -pub struct Backend { - connection: surfman::Connection, - device: surfman::Device, - gl_context: surfman::Context, - gl: Option, -} - -impl iced_native::window::Backend for Backend { - type Settings = Settings; - type Renderer = Renderer; - type Surface = (); - type SwapChain = Viewport; - - fn new(settings: Self::Settings) -> Backend { - let connection = surfman::Connection::new().expect("Create connection"); - - let adapter = connection - .create_hardware_adapter() - .expect("Create adapter"); - - let mut device = - connection.create_device(&adapter).expect("Create device"); - - let context_descriptor = device - .create_context_descriptor(&surfman::ContextAttributes { - version: surfman::GLVersion::new(3, 0), - flags: surfman::ContextAttributeFlags::empty(), - }) - .expect("Create context descriptor"); - - let gl_context = device - .create_context(&context_descriptor) - .expect("Create context"); - - Backend { - connection, - device, - gl_context, - gl: None, - } - } - - fn create_renderer(&mut self, settings: Settings) -> Renderer { - self.device - .make_context_current(&self.gl_context) - .expect("Make context current"); - - Renderer::new(crate::Backend::new(self.gl.as_ref().unwrap(), settings)) - } - - fn create_surface( - &mut self, - window: &W, - ) -> Self::Surface { - let native_widget = self - .connection - .create_native_widget_from_rwh(window.raw_window_handle()) - .expect("Create widget"); - - let surface = self - .device - .create_surface( - &self.gl_context, - surfman::SurfaceAccess::GPUOnly, - surfman::SurfaceType::Widget { native_widget }, - ) - .expect("Create surface"); - - let surfman::SurfaceInfo { .. } = self.device.surface_info(&surface); - - self.device - .bind_surface_to_context(&mut self.gl_context, surface) - .expect("Bind surface to context"); - - self.device - .make_context_current(&self.gl_context) - .expect("Make context current"); - - self.gl = Some(glow::Context::from_loader_function(|s| { - self.device.get_proc_address(&self.gl_context, s) - })); - - //let mut framebuffer = - // skia_safe::gpu::gl::FramebufferInfo::from_fboid(framebuffer_object); - - //framebuffer.format = gl::RGBA8; - - //framebuffer - } - - fn create_swap_chain( - &mut self, - _surface: &Self::Surface, - width: u32, - height: u32, - ) -> Self::SwapChain { - let mut surface = self - .device - .unbind_surface_from_context(&mut self.gl_context) - .expect("Unbind surface") - .expect("Active surface"); - - self.device - .resize_surface( - &self.gl_context, - &mut surface, - euclid::Size2D::new(width as i32, height as i32), - ) - .expect("Resize surface"); - - self.device - .bind_surface_to_context(&mut self.gl_context, surface) - .expect("Bind surface to context"); - - let gl = self.gl.as_ref().unwrap(); - - unsafe { - gl.viewport(0, 0, width as i32, height as i32); - gl.clear_color(1.0, 1.0, 1.0, 1.0); - - // Enable auto-conversion from/to sRGB - gl.enable(glow::FRAMEBUFFER_SRGB); - - // Enable alpha blending - gl.enable(glow::BLEND); - gl.blend_func(glow::SRC_ALPHA, glow::ONE_MINUS_SRC_ALPHA); - } - - Viewport::new(width, height) - } - - fn draw>( - &mut self, - renderer: &mut Self::Renderer, - swap_chain: &mut Self::SwapChain, - output: &::Output, - scale_factor: f64, - overlay: &[T], - ) -> mouse::Interaction { - let gl = self.gl.as_ref().unwrap(); - - unsafe { - gl.clear(glow::COLOR_BUFFER_BIT); - } - - let mouse = renderer.backend_mut().draw( - gl, - swap_chain, - output, - scale_factor, - overlay, - ); - - { - let mut surface = self - .device - .unbind_surface_from_context(&mut self.gl_context) - .expect("Unbind surface") - .expect("Active surface"); - - self.device - .present_surface(&self.gl_context, &mut surface) - .expect("Present surface"); - - self.device - .bind_surface_to_context(&mut self.gl_context, surface) - .expect("Bind surface to context"); - } - - mouse - } -} - -impl Drop for Backend { - fn drop(&mut self) { - self.device - .destroy_context(&mut self.gl_context) - .expect("Destroy context"); - } -} diff --git a/glow/src/window/compositor.rs b/glow/src/window/compositor.rs new file mode 100644 index 00000000..8f770065 --- /dev/null +++ b/glow/src/window/compositor.rs @@ -0,0 +1,188 @@ +use crate::{Renderer, Settings, Viewport}; + +use glow::HasContext; +use iced_native::mouse; +use raw_window_handle::HasRawWindowHandle; + +/// A window graphics backend for iced powered by `glow`. +#[allow(missing_debug_implementations)] +pub struct Compositor { + connection: surfman::Connection, + device: surfman::Device, + gl_context: surfman::Context, + gl: Option, +} + +impl iced_native::window::Compositor for Compositor { + type Settings = Settings; + type Renderer = Renderer; + type Surface = (); + type SwapChain = Viewport; + + fn new(_settings: Self::Settings) -> Self { + let connection = surfman::Connection::new().expect("Create connection"); + + let adapter = connection + .create_hardware_adapter() + .expect("Create adapter"); + + let mut device = + connection.create_device(&adapter).expect("Create device"); + + let context_descriptor = device + .create_context_descriptor(&surfman::ContextAttributes { + version: surfman::GLVersion::new(3, 0), + flags: surfman::ContextAttributeFlags::empty(), + }) + .expect("Create context descriptor"); + + let gl_context = device + .create_context(&context_descriptor) + .expect("Create context"); + + Self { + connection, + device, + gl_context, + gl: None, + } + } + + fn create_renderer(&mut self, settings: Settings) -> Renderer { + self.device + .make_context_current(&self.gl_context) + .expect("Make context current"); + + Renderer::new(crate::Backend::new(self.gl.as_ref().unwrap(), settings)) + } + + fn create_surface( + &mut self, + window: &W, + ) -> Self::Surface { + let native_widget = self + .connection + .create_native_widget_from_rwh(window.raw_window_handle()) + .expect("Create widget"); + + let surface = self + .device + .create_surface( + &self.gl_context, + surfman::SurfaceAccess::GPUOnly, + surfman::SurfaceType::Widget { native_widget }, + ) + .expect("Create surface"); + + let surfman::SurfaceInfo { .. } = self.device.surface_info(&surface); + + self.device + .bind_surface_to_context(&mut self.gl_context, surface) + .expect("Bind surface to context"); + + self.device + .make_context_current(&self.gl_context) + .expect("Make context current"); + + self.gl = Some(glow::Context::from_loader_function(|s| { + self.device.get_proc_address(&self.gl_context, s) + })); + + //let mut framebuffer = + // skia_safe::gpu::gl::FramebufferInfo::from_fboid(framebuffer_object); + + //framebuffer.format = gl::RGBA8; + + //framebuffer + } + + fn create_swap_chain( + &mut self, + _surface: &Self::Surface, + width: u32, + height: u32, + ) -> Self::SwapChain { + let mut surface = self + .device + .unbind_surface_from_context(&mut self.gl_context) + .expect("Unbind surface") + .expect("Active surface"); + + self.device + .resize_surface( + &self.gl_context, + &mut surface, + euclid::Size2D::new(width as i32, height as i32), + ) + .expect("Resize surface"); + + self.device + .bind_surface_to_context(&mut self.gl_context, surface) + .expect("Bind surface to context"); + + let gl = self.gl.as_ref().unwrap(); + + unsafe { + gl.viewport(0, 0, width as i32, height as i32); + gl.clear_color(1.0, 1.0, 1.0, 1.0); + + // Enable auto-conversion from/to sRGB + gl.enable(glow::FRAMEBUFFER_SRGB); + + // Enable alpha blending + gl.enable(glow::BLEND); + gl.blend_func(glow::SRC_ALPHA, glow::ONE_MINUS_SRC_ALPHA); + } + + Viewport::new(width, height) + } + + fn draw>( + &mut self, + renderer: &mut Self::Renderer, + swap_chain: &mut Self::SwapChain, + output: &::Output, + scale_factor: f64, + overlay: &[T], + ) -> mouse::Interaction { + let gl = self.gl.as_ref().unwrap(); + + unsafe { + gl.clear(glow::COLOR_BUFFER_BIT); + } + + let mouse = renderer.backend_mut().draw( + gl, + swap_chain, + output, + scale_factor, + overlay, + ); + + { + let mut surface = self + .device + .unbind_surface_from_context(&mut self.gl_context) + .expect("Unbind surface") + .expect("Active surface"); + + self.device + .present_surface(&self.gl_context, &mut surface) + .expect("Present surface"); + + self.device + .bind_surface_to_context(&mut self.gl_context, surface) + .expect("Bind surface to context"); + } + + mouse + } +} + +impl Drop for Compositor { + fn drop(&mut self) { + self.device + .destroy_context(&mut self.gl_context) + .expect("Destroy context"); + } +} diff --git a/native/src/window.rs b/native/src/window.rs index 4dcae62f..84269fbf 100644 --- a/native/src/window.rs +++ b/native/src/window.rs @@ -1,6 +1,6 @@ //! Build window-based GUI applications. -mod backend; +mod compositor; mod event; -pub use backend::Backend; +pub use compositor::Compositor; pub use event::Event; diff --git a/native/src/window/backend.rs b/native/src/window/backend.rs deleted file mode 100644 index d8726fd4..00000000 --- a/native/src/window/backend.rs +++ /dev/null @@ -1,60 +0,0 @@ -use crate::mouse; - -use raw_window_handle::HasRawWindowHandle; - -/// A graphics backend that can render to windows. -pub trait Backend: Sized { - /// The settings of the backend. - type Settings: Default + Clone; - - /// The iced renderer of the backend. - type Renderer: crate::Renderer; - - /// The surface of the backend. - type Surface; - - /// The swap chain of the backend. - type SwapChain; - - /// Creates a new [`Backend`]. - /// - /// [`Backend`]: trait.Backend.html - fn new(settings: Self::Settings) -> Self; - - /// Crates a new [`Surface`] for the given window. - /// - /// [`Surface`]: #associatedtype.Surface - fn create_surface( - &mut self, - window: &W, - ) -> Self::Surface; - - /// Crates a new [`Renderer`]. - /// - /// [`Renderer`]: #associatedtype.Renderer - fn create_renderer(&mut self, settings: Self::Settings) -> Self::Renderer; - - /// Crates a new [`SwapChain`] for the given [`Surface`]. - /// - /// [`SwapChain`]: #associatedtype.SwapChain - /// [`Surface`]: #associatedtype.Surface - fn create_swap_chain( - &mut self, - surface: &Self::Surface, - width: u32, - height: u32, - ) -> Self::SwapChain; - - /// Draws the output primitives to the next frame of the given [`SwapChain`]. - /// - /// [`SwapChain`]: #associatedtype.SwapChain - /// [`Surface`]: #associatedtype.Surface - fn draw>( - &mut self, - renderer: &mut Self::Renderer, - swap_chain: &mut Self::SwapChain, - output: &::Output, - scale_factor: f64, - overlay: &[T], - ) -> mouse::Interaction; -} diff --git a/native/src/window/compositor.rs b/native/src/window/compositor.rs new file mode 100644 index 00000000..ae010c89 --- /dev/null +++ b/native/src/window/compositor.rs @@ -0,0 +1,60 @@ +use crate::mouse; + +use raw_window_handle::HasRawWindowHandle; + +/// A graphics compositor that can draw to windows. +pub trait Compositor: Sized { + /// The settings of the backend. + type Settings: Default + Clone; + + /// The iced renderer of the backend. + type Renderer: crate::Renderer; + + /// The surface of the backend. + type Surface; + + /// The swap chain of the backend. + type SwapChain; + + /// Creates a new [`Backend`]. + /// + /// [`Backend`]: trait.Backend.html + fn new(settings: Self::Settings) -> Self; + + /// Crates a new [`Surface`] for the given window. + /// + /// [`Surface`]: #associatedtype.Surface + fn create_surface( + &mut self, + window: &W, + ) -> Self::Surface; + + /// Crates a new [`Renderer`]. + /// + /// [`Renderer`]: #associatedtype.Renderer + fn create_renderer(&mut self, settings: Self::Settings) -> Self::Renderer; + + /// Crates a new [`SwapChain`] for the given [`Surface`]. + /// + /// [`SwapChain`]: #associatedtype.SwapChain + /// [`Surface`]: #associatedtype.Surface + fn create_swap_chain( + &mut self, + surface: &Self::Surface, + width: u32, + height: u32, + ) -> Self::SwapChain; + + /// Draws the output primitives to the next frame of the given [`SwapChain`]. + /// + /// [`SwapChain`]: #associatedtype.SwapChain + /// [`Surface`]: #associatedtype.Surface + fn draw>( + &mut self, + renderer: &mut Self::Renderer, + swap_chain: &mut Self::SwapChain, + output: &::Output, + scale_factor: f64, + overlay: &[T], + ) -> mouse::Interaction; +} diff --git a/src/application.rs b/src/application.rs index 689332f1..0ae2ec55 100644 --- a/src/application.rs +++ b/src/application.rs @@ -216,7 +216,7 @@ impl iced_winit::Application for Instance where A: Application, { - type Backend = iced_wgpu::window::Backend; + type Compositor = iced_wgpu::window::Compositor; type Executor = A::Executor; type Flags = A::Flags; type Message = A::Message; diff --git a/wgpu/src/window.rs b/wgpu/src/window.rs index b7adad82..391d3e36 100644 --- a/wgpu/src/window.rs +++ b/wgpu/src/window.rs @@ -1,6 +1,6 @@ //! Display rendering results on windows. -mod backend; +mod compositor; mod swap_chain; -pub use backend::Backend; +pub use compositor::Compositor; pub use swap_chain::SwapChain; diff --git a/wgpu/src/window/backend.rs b/wgpu/src/window/backend.rs deleted file mode 100644 index 92e81cd9..00000000 --- a/wgpu/src/window/backend.rs +++ /dev/null @@ -1,119 +0,0 @@ -use crate::{window::SwapChain, Renderer, Settings, Target}; - -use iced_native::{futures, mouse}; -use raw_window_handle::HasRawWindowHandle; - -/// A window graphics backend for iced powered by `wgpu`. -#[derive(Debug)] -pub struct Backend { - device: wgpu::Device, - queue: wgpu::Queue, - format: wgpu::TextureFormat, -} - -impl iced_native::window::Backend for Backend { - type Settings = Settings; - type Renderer = Renderer; - type Surface = wgpu::Surface; - type SwapChain = SwapChain; - - fn new(settings: Self::Settings) -> Backend { - let (device, queue) = futures::executor::block_on(async { - let adapter = wgpu::Adapter::request( - &wgpu::RequestAdapterOptions { - power_preference: if settings.antialiasing.is_none() { - wgpu::PowerPreference::Default - } else { - wgpu::PowerPreference::HighPerformance - }, - compatible_surface: None, - }, - wgpu::BackendBit::PRIMARY, - ) - .await - .expect("Request adapter"); - - adapter - .request_device(&wgpu::DeviceDescriptor { - extensions: wgpu::Extensions { - anisotropic_filtering: false, - }, - limits: wgpu::Limits { max_bind_groups: 2 }, - }) - .await - }); - - Backend { - device, - queue, - format: settings.format, - } - } - - fn create_renderer(&mut self, settings: Settings) -> Renderer { - Renderer::new(crate::Backend::new(&mut self.device, settings)) - } - - fn create_surface( - &mut self, - window: &W, - ) -> wgpu::Surface { - wgpu::Surface::create(window) - } - - fn create_swap_chain( - &mut self, - surface: &Self::Surface, - width: u32, - height: u32, - ) -> SwapChain { - SwapChain::new(&self.device, surface, self.format, width, height) - } - - fn draw>( - &mut self, - renderer: &mut Self::Renderer, - swap_chain: &mut SwapChain, - output: &::Output, - scale_factor: f64, - overlay: &[T], - ) -> mouse::Interaction { - let (frame, viewport) = swap_chain.next_frame().expect("Next frame"); - - let mut encoder = self.device.create_command_encoder( - &wgpu::CommandEncoderDescriptor { label: None }, - ); - - let _ = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { - color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { - attachment: &frame.view, - resolve_target: None, - load_op: wgpu::LoadOp::Clear, - store_op: wgpu::StoreOp::Store, - clear_color: wgpu::Color { - r: 1.0, - g: 1.0, - b: 1.0, - a: 1.0, - }, - }], - depth_stencil_attachment: None, - }); - - let mouse_interaction = renderer.backend_mut().draw( - &mut self.device, - &mut encoder, - Target { - texture: &frame.view, - viewport, - }, - output, - scale_factor, - overlay, - ); - - self.queue.submit(&[encoder.finish()]); - - mouse_interaction - } -} diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs new file mode 100644 index 00000000..8950ffd4 --- /dev/null +++ b/wgpu/src/window/compositor.rs @@ -0,0 +1,119 @@ +use crate::{window::SwapChain, Renderer, Settings, Target}; + +use iced_native::{futures, mouse}; +use raw_window_handle::HasRawWindowHandle; + +/// A window graphics backend for iced powered by `wgpu`. +#[derive(Debug)] +pub struct Compositor { + device: wgpu::Device, + queue: wgpu::Queue, + format: wgpu::TextureFormat, +} + +impl iced_native::window::Compositor for Compositor { + type Settings = Settings; + type Renderer = Renderer; + type Surface = wgpu::Surface; + type SwapChain = SwapChain; + + fn new(settings: Self::Settings) -> Self { + let (device, queue) = futures::executor::block_on(async { + let adapter = wgpu::Adapter::request( + &wgpu::RequestAdapterOptions { + power_preference: if settings.antialiasing.is_none() { + wgpu::PowerPreference::Default + } else { + wgpu::PowerPreference::HighPerformance + }, + compatible_surface: None, + }, + wgpu::BackendBit::PRIMARY, + ) + .await + .expect("Request adapter"); + + adapter + .request_device(&wgpu::DeviceDescriptor { + extensions: wgpu::Extensions { + anisotropic_filtering: false, + }, + limits: wgpu::Limits { max_bind_groups: 2 }, + }) + .await + }); + + Self { + device, + queue, + format: settings.format, + } + } + + fn create_renderer(&mut self, settings: Settings) -> Renderer { + Renderer::new(crate::Backend::new(&mut self.device, settings)) + } + + fn create_surface( + &mut self, + window: &W, + ) -> wgpu::Surface { + wgpu::Surface::create(window) + } + + fn create_swap_chain( + &mut self, + surface: &Self::Surface, + width: u32, + height: u32, + ) -> SwapChain { + SwapChain::new(&self.device, surface, self.format, width, height) + } + + fn draw>( + &mut self, + renderer: &mut Self::Renderer, + swap_chain: &mut SwapChain, + output: &::Output, + scale_factor: f64, + overlay: &[T], + ) -> mouse::Interaction { + let (frame, viewport) = swap_chain.next_frame().expect("Next frame"); + + let mut encoder = self.device.create_command_encoder( + &wgpu::CommandEncoderDescriptor { label: None }, + ); + + let _ = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { + attachment: &frame.view, + resolve_target: None, + load_op: wgpu::LoadOp::Clear, + store_op: wgpu::StoreOp::Store, + clear_color: wgpu::Color { + r: 1.0, + g: 1.0, + b: 1.0, + a: 1.0, + }, + }], + depth_stencil_attachment: None, + }); + + let mouse_interaction = renderer.backend_mut().draw( + &mut self.device, + &mut encoder, + Target { + texture: &frame.view, + viewport, + }, + output, + scale_factor, + overlay, + ); + + self.queue.submit(&[encoder.finish()]); + + mouse_interaction + } +} diff --git a/winit/src/application.rs b/winit/src/application.rs index 4bc36586..83b53de2 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -19,7 +19,7 @@ pub trait Application: Sized { /// The graphics backend to use to draw the [`Application`]. /// /// [`Application`]: trait.Application.html - type Backend: window::Backend; + type Compositor: window::Compositor; /// The [`Executor`] that will run commands and subscriptions. /// @@ -91,7 +91,11 @@ pub trait Application: Sized { /// [`Application`]: trait.Application.html fn view( &mut self, - ) -> Element<'_, Self::Message, ::Renderer>; + ) -> Element< + '_, + Self::Message, + ::Renderer, + >; /// Returns the current [`Application`] mode. /// @@ -116,11 +120,11 @@ pub trait Application: Sized { /// [`Settings`]: struct.Settings.html fn run( settings: Settings, - backend_settings: ::Settings, + backend_settings: ::Settings, ) where Self: 'static, { - use window::Backend as _; + use window::Compositor as _; use winit::{ event::{self, WindowEvent}, event_loop::{ControlFlow, EventLoop}, @@ -181,15 +185,15 @@ pub trait Application: Sized { let mut resized = false; let clipboard = Clipboard::new(&window); - let mut backend = Self::Backend::new(backend_settings.clone()); + let mut compositor = Self::Compositor::new(backend_settings.clone()); - let surface = backend.create_surface(&window); - let mut renderer = backend.create_renderer(backend_settings); + let surface = compositor.create_surface(&window); + let mut renderer = compositor.create_renderer(backend_settings); let mut swap_chain = { let physical_size = size.physical(); - backend.create_swap_chain( + compositor.create_swap_chain( &surface, physical_size.width, physical_size.height, @@ -324,7 +328,7 @@ pub trait Application: Sized { if resized { let physical_size = size.physical(); - swap_chain = backend.create_swap_chain( + swap_chain = compositor.create_swap_chain( &surface, physical_size.width, physical_size.height, @@ -333,7 +337,7 @@ pub trait Application: Sized { resized = false; } - let new_mouse_interaction = backend.draw( + let new_mouse_interaction = compositor.draw( &mut renderer, &mut swap_chain, &primitive, @@ -414,10 +418,14 @@ pub trait Application: Sized { fn build_user_interface<'a, A: Application>( application: &'a mut A, cache: Cache, - renderer: &mut ::Renderer, + renderer: &mut ::Renderer, size: winit::dpi::LogicalSize, debug: &mut Debug, -) -> UserInterface<'a, A::Message, ::Renderer> { +) -> UserInterface< + 'a, + A::Message, + ::Renderer, +> { debug.view_started(); let view = application.view(); debug.view_finished(); -- cgit