[][src]Crate webrender

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.

Re-exports

pub extern crate euclid;
pub extern crate api;
pub use crate::composite::CompositorConfig;
pub use crate::composite::Compositor;
pub use crate::composite::NativeSurfaceId;
pub use crate::composite::NativeSurfaceInfo;
pub use api as webrender_api;

Modules

batch
border
box_shadow
capture
clip

Internal representation of clips in WebRender.

clip_scroll_tree
composite
debug_colors
debug_font_data
debug_render
device
ellipse
filterdata
frame_builder
freelist

A generic backing store for caches.

glyph_cache
glyph_rasterizer
gpu_cache

Overview of the GPU cache.

gpu_types
hit_test
image
intern

The interning module provides a generic data structure interning container. It is similar in concept to a traditional string interning container, but it is specialized to the WR thread model.

internal_types
picture

A picture represents a dynamically rendered image.

platform
prim_store
print_tree
profiler
record
render_backend

The high-level module responsible for managing the pipeline and preparing commands to be issued by the Renderer.

render_target
render_task
render_task_cache
render_task_graph

This module contains the render task graph.

renderer

The high-level module responsible for interfacing with the GPU.

resource_cache
scene
scene_builder_thread
scene_building
screen_capture

Screen capture infrastructure for the Gecko Profiler and Composition Recorder.

segment

Primitive segmentation

shade
shader_source
spatial_node
storage
texture_allocator
texture_cache
util

Structs

AsyncScreenshotHandle

A handle to a screenshot that is being asynchronously captured and scaled.

BinaryRecorder
CpuProfile
DebugFlags
Device
FormatDesc
GpuProfile
GraphicsApiInfo
PipelineInfo
PrimitiveDebugId
ProgramBinary
ProgramCache
ProgramSourceDigest
RecordedFrameHandle

A handle to a recorded frame that was captured.

RenderResults

Return type from render(), which contains some repr(C) statistics as well as some non-repr(C) data.

Renderer

The renderer is responsible for submitting to the GPU the work prepared by the RenderBackend.

RendererOptions
RendererStats

Some basic statistics about the rendered scene, used in Gecko, as well as in wrench reftests to ensure that tests are batching and/or allocating on render targets as we expect them to.

ShaderPrecacheFlags

Flags that control how shaders are pre-cached, if at all.

Shaders
WrShaders

Enums

ChasePrimitive
GraphicsApi
RendererError
RendererKind
UploadMethod

Method of uploading texel data from CPU to GPU.

VertexUsageHint

Constants

MAX_VERTEX_TEXTURE_WIDTH

Statics

WEBRENDER_RECORDING_HEADER

Traits

ApiRecordingReceiver
AsyncPropertySampler

Allows callers to hook into the main render_backend loop and provide additional frame ops for generate_frame transactions. These functions are all called from the render backend thread.

ProfilerHooks

Defines the interface for hooking up an external profiler to WR.

ProgramCacheObserver

The interfaces that an application can implement to handle ProgramCache update

SceneBuilderHooks

Allows callers to hook in at certain points of the async scene build. These functions are all called from the scene builder thread.

ThreadListener

Functions

build_shader_strings

Creates heap-allocated strings for both vertex and fragment shaders. Public to be accessible to tests.

get_gl_target
set_profiler_hooks

Set the profiler callbacks, or None to disable the profiler. This function must only ever be called before any WR instances have been created, or the hooks will not be set.