4 releases

0.62.2 Dec 25, 2021
0.62.1 Jul 12, 2021
0.62.0 Jul 11, 2021
0.61.0 May 11, 2020

#1000 in Graphics APIs

Download history 19/week @ 2024-11-13 5/week @ 2024-11-27 43/week @ 2024-12-04 70/week @ 2024-12-11 14/week @ 2024-12-18 2/week @ 2024-12-25 15/week @ 2025-01-01 19/week @ 2025-01-08 4/week @ 2025-01-15 2/week @ 2025-01-29 16/week @ 2025-02-05 3/week @ 2025-02-12 24/week @ 2025-02-19 25/week @ 2025-02-26

69 downloads per month
Used in azul-desktop

MPL-2.0 license

4.5MB
97K SLoC

Rust 69K SLoC // 0.1% comments GLSL 28K SLoC // 0.0% comments

A GPU based renderer for the web.

It serves as an experimental render backend for Servo, but it can also be used as such in a standalone application.

External dependencies

WebRender currently depends on FreeType

Api Structure

The main entry point to WebRender is the crate::Renderer.

By calling Renderer::new(...) you get a Renderer, as well as a RenderApiSender. Your Renderer is responsible to render the previously processed frames onto the screen.

By calling yourRenderApiSender.create_api(), you'll get a RenderApi instance, which is responsible for managing resources and documents. A worker thread is used internally to untie the workload from the application thread and therefore be able to make better use of multicore systems.

Frame

What is referred to as a frame, is the current geometry on the screen. A new Frame is created by calling set_display_list() on the RenderApi. When the geometry is processed, the application will be informed via a RenderNotifier, a callback which you pass to Renderer::new. More information about stacking contexts.

set_display_list() also needs to be supplied with BuiltDisplayLists. These are obtained by finalizing a DisplayListBuilder. These are used to draw your geometry. But it doesn't only contain trivial geometry, it can also store another StackingContext, as they're nestable.

Dependencies

~4–7.5MB
~147K SLoC