Skip to main content

ferroui_browser/rendering/
mod.rs

1//! Rendering to the canvas of a view: the surface, its render targets (a
2//! WebGL context or a framebuffer copied to a 2D canvas), the render timer
3//! driven by the animation frames of the page or of a render worker, the
4//! render worker, and what the thread of the user interface and a render
5//! thread share about a canvas.
6//!
7//! By who holds what (`docs/porting/browser-render-worker.md`, section 4):
8//!
9//! - [`BrowserSurfaceShared`] is what both threads know about a canvas, and
10//!   [`BrowserRenderSurface`] the render surface over it that the compositor
11//!   is handed. Neither holds an object of a thread.
12//! - [`BrowserRenderTarget`] ([`BrowserWebGlRenderTarget`],
13//!   [`BrowserSoftwareRenderTarget`]) is the render target of a canvas on
14//!   the thread that draws to it, kept in a table of that thread
15//!   ([`get_render_target`]).
16//! - [`RenderTargetBrowserSurface`] is the surface of a view on the thread
17//!   of the user interface.
18//!
19//! Without a render thread the three live on the one thread of the page.
20//!
21//! With one ([`BrowserSharedRenderLoop::start_render_thread`], which the
22//! platform calls in a module built with threads) the compositor of a view
23//! is confined to it: the frame loop ticks there, the canvas of a view is
24//! transferred to its worker, and the thread of the user interface commits
25//! batches and waits. [`RenderStatistics`] is where the page reads which
26//! thread drew its frames.
27
28mod browser_render_surface;
29mod browser_render_timer;
30mod browser_shared_render_loop;
31mod browser_software_render_target;
32mod browser_surface;
33mod browser_surface_shared;
34mod browser_web_gl_render_target;
35mod render_statistics;
36mod render_target_browser_surface;
37mod render_worker;
38mod web_render_target;
39
40pub use browser_render_surface::BrowserRenderSurface;
41pub use browser_render_timer::BrowserRenderTimer;
42pub use browser_shared_render_loop::BrowserSharedRenderLoop;
43pub use browser_software_render_target::BrowserSoftwareRenderTarget;
44pub use browser_surface::BrowserSurface;
45pub use browser_surface_shared::BrowserSurfaceShared;
46pub use browser_web_gl_render_target::{BrowserWebGlRenderTarget, WebGlContext};
47pub use render_statistics::RenderStatistics;
48pub use render_target_browser_surface::RenderTargetBrowserSurface;
49pub use render_worker::RenderWorker;
50pub use web_render_target::{
51    get_render_target, initialize_worker, remove_render_target, BrowserRenderTarget, PENDING_RENDER_THREAD,
52};