[][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 webrender::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 employ with set_render_notifier on the Renderer 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 webrender_api;
pub use device::build_shader_strings;
pub use device::ReadPixelsFormat;
pub use device::UploadMethod;
pub use device::VertexUsageHint;

Modules

api

The webrender_api crate contains an assortment types and functions used by WebRender consumers as well as, in many cases, WebRender itself.

batch
border
box_shadow
capture
clip
clip_scroll_tree
debug_colors
debug_font_data
debug_render
device
display_list_flattener
ellipse
frame_builder
freelist
glyph_cache
glyph_rasterizer
gpu_cache

Overview of the GPU cache.

gpu_types
hit_test
image
intern
internal_types
picture
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_task
renderer

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

resource_cache
scene
scene_builder
segment
shade
shader_source
spatial_node
texture_allocator
texture_cache
tiling
util

Structs

BinaryRecorder
CpuProfile
DebugFlags
Device
ExternalImage

The data that an external client should provide about an external image. The timestamp is used to test if the renderer should upload new texture data this frame. For instance, if providing video frames, the application could call wr.render() whenever a new video frame is ready. If the callback increments the returned timestamp for a given image, the renderer will know to re-upload the image data to the GPU. Note that the UV coords are supplied in texel-space!

GpuProfile
GraphicsApiInfo
PipelineInfo
ProgramBinary
ProgramCache
ProgramSources
Renderer

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

RendererOptions
RendererStats
ShaderPrecacheFlags
Shaders
WrShaders

Enums

ChasePrimitive
ExternalImageSource
GraphicsApi
RendererKind

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.

ExternalImageHandler

The interfaces that an application can implement to support providing external image buffers. When the the application passes an external image to WR, it should kepp that external image life time. People could check the epoch id in RenderNotifier at the client side to make sure that the external image is not used by WR. Then, do the clean up for that external image.

OutputImageHandler

Allows callers to receive a texture with the contents of a specific pipeline copied to it. Lock should return the native texture handle and the size of the texture. Unlock will only be called if the lock() call succeeds, when WR has issued the GL commands to copy the output to the texture handle.

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

intersect_for_tile