Expand description
The webrender_api
crate contains an assortment types and functions used
by WebRender consumers as well as, in many cases, WebRender itself.
This separation allows Servo to parallelize compilation across webrender
and other crates that depend on webrender_api
. So in practice, we put
things in this crate when Servo needs to use them. Firefox depends on the
webrender
crate directly, and so this distinction is not really relevant
there.
Re-exports§
pub extern crate euclid;
Modules§
Macros§
- enumerate_
interners - Meta-macro to enumerate the various interner identifiers and types.
Structs§
- AddBlob
Image - Creates a blob-image resource with provided parameters.
- AddFont
Instance - Creates a font instance resource.
- AddImage
- Creates an image resource with provided parameters.
- AuxIter
- Backdrop
Filter Display Item - Renders a filtered region of its backdrop
- Blend
Primitive - Blob
Image Descriptor - Metadata (but not storage) for a blob image.
- Blob
Image Key - An opaque identifier describing a blob image registered with WebRender. This is used as a handle to reference blob images, and can be used as an image in display items.
- Blob
Image Params - Input parameters for the BlobImageRasterizer.
- Blob
Image Request - A key identifying blob image rasterization work requested from the blob image rasterizer.
- Blur
Primitive - Border
Display Item - Border
Radius - Border
Side - BoxShadow
Display Item - Built
Display List - A display list.
- Built
Display List Descriptor - Describes the memory layout of a display list.
- Built
Display List Iter - Capture
Bits - Bit flags for WR stages to store in a capture.
- Captured
Document - Information about a loaded capture of each document
that is returned by
RenderBackend
. - Clear
Cache - Mask for clearing caches in debug commands.
- Clear
Rectangle Display Item - Clears all colors from the area, making it possible to cut holes in the window. (useful for things like the macos frosted-glass effect).
- Clip
Chain Id - Clip
Chain Item - Just an abstraction for bundling up a bunch of clips into a “super clip”.
- Clip
Display Item - ColorF
- Represents RGBA screen colors with floating point numbers.
- Color
Matrix Primitive - cbindgen:derive-eq=false
- ColorU
- Represents RGBA screen colors with one byte per channel.
- Common
Item Properties - A grouping of fields a lot of display items need, just to avoid repeating these over and over in this file.
- Complex
Clip Region - Component
Transfer Primitive - Composite
Primitive - Debug
Flags - Flags to enable/disable various builtin debugging tools.
- Display
Item Ref - Display
List Builder - Document
Id - A key uniquely identifying a WebRender document.
- Document
Transaction - Drop
Shadow Primitive - Dynamic
Properties - When using
generate_frame()
, a list ofPropertyValue
structures can optionally be supplied to provide the current value of any animated properties. - Epoch
- An epoch identifies the state of a pipeline in time.
- External
Event - An opaque pointer-sized value.
- External
Image - The data that an external client should provide about an external image. For instance, if providing video frames, the application could call wr.render() whenever a new video frame is ready. Note that the UV coords are supplied in texel-space!
- External
Image Data - Descriptor for external image resources. See
ImageData
. - External
Image Id - An arbitrary identifier for an external image provided by the application. It must be a unique identifier for each external image.
- External
Scroll Id - An external identifier that uniquely identifies a scroll frame independent of its ClipId, which may change from frame to frame. This should be unique within a pipeline. WebRender makes no attempt to ensure uniqueness. The zero value is reserved for use by the root scroll node of every pipeline, which always has an external id.
- Filter
Data - Filter
Primitive - SVG Filter Primitive. See: https://github.com/eqrion/cbindgen/issues/9 cbindgen:derive-eq=false
- Flood
Primitive - Font
Instance Data - Data corresponding to an instantiation of a font, with size and other options specified.
- Font
Instance Flags - Font
Instance Key - Font
Instance Options - Font
Instance Platform Options - FontKey
- Font
Variation - Glyph
Dimensions - Glyph
Instance - Glyph
Options - Gradient
- Gradient
Builder - Construct a gradient to be used in display lists.
- Gradient
Display Item - The area
- Gradient
Stop - HitTest
Display Item - A minimal hit-testable item for the parent browser’s convenience, and is slimmer than a RectangleDisplayItem (no color). The existence of this as a distinct item also makes it easier to inspect/debug display items.
- HitTest
Flags - HitTest
Item - Describe an item that matched a hit-test query.
- HitTest
Result - Returned by
RenderApi::hit_test
. - IdNamespace
- ID namespaces uniquely identify different users of WebRender’s API.
- Identity
Primitive - Iframe
Display Item - Image
Descriptor - Metadata (but not storage) describing an image In WebRender.
- Image
Descriptor Flags - Various flags that are part of an image descriptor.
- Image
Display Item - This describes an image that fills the specified area. It stretches or shrinks the image as necessary. While RepeatingImageDisplayItem could otherwise provide a superset of the functionality, it has been problematic inferring the desired repetition properties when snapping changes the size of the primitive.
- Image
Key - An opaque identifier describing an image registered with WebRender.
This is used as a handle to reference images, and is used as the
hash map key for the actual image storage in the
ResourceCache
. - Image
Mask - Interner
SubReport - Interning
Memory Report - Memory report for interning-related data structures. cbindgen:derive-eq=false
- Item
Range - Item
Stats - Stats for an individual item
- Line
Display Item - Memory
Report - Collection of heap sizes, in bytes. cbindgen:derive-eq=false
- Native
Font Handle - Nine
Patch Border - Normal
Border - Notification
Request - A request to notify a handler when the transaction reaches certain stages of the rendering pipeline.
- Offset
Primitive - Opacity
Primitive - Pipeline
Id - From the point of view of WR,
PipelineId
is completely opaque and generic as long as it’s clonable, serializable, comparable, and hashable. - Premultiplied
ColorF - Represents pre-multiplied RGBA colors with floating point numbers.
- Primitive
Flags - Property
Binding Id - A key to identify an animated property binding.
- Property
Binding Key - A unique key that is used for connecting animated property values to bindings in the display list.
- Property
Value - The current value of an animated property. This is supplied by the calling code.
- Push
Shadow Display Item - Push
Stacking Context Display Item - Quality
Settings - Various settings that the caller can select based on desired tradeoffs between rendering quality and performance / power usage.
- Radial
Gradient - Radial
Gradient Display Item - Rasterized
Blob Image - Representation of a rasterized blob image. This is obtained by passing
BlobImageData
to the embedding via the rasterization callback. - Rectangle
Display Item - A solid color to draw (may not actually be a rectangle due to complex clips)
- Reference
Frame - Reference
Frame Display List Item - Render
Api - The main entry point to interact with WebRender.
- Render
ApiSender - Allows the API to communicate with WebRender.
- Repeating
Image Display Item - This describes a background-image and its tiling. It repeats in a grid to fill the specified area.
- Save
State - Scroll
Frame Display Item - Scroll
Node State - Shadow
- Space
AndClip Info - Per-primitive information about the nodes in the clip tree and the spatial tree that the primitive belongs to.
- Spatial
Id - A reference to a spatial node defining item positioning.
- Stacking
Context - Sticky
Frame Display Item - Sticky
Offset Bounds - The minimum and maximum allowable offset for a sticky frame in a single dimension.
- Synthetic
Italics - Temp
Filter Data - Text
Display Item - Transaction
- A Transaction is a group of commands to apply atomically to a document.
- Transaction
Msg - Represents a transaction in the format sent through the channel.
- Update
Blob Image - Updates an already existing blob-image resource.
- Update
Image - Updates an already existing image resource.
- YuvImage
Display Item - Zoom
Factor - Represents a zoom factor.
Enums§
- AddFont
- Creates a font resource.
- Alpha
Type - ApiMsg
- Message sent by the
RenderApi
to the render backend thread. - Blob
Image Error - Error code for when blob rasterization failed.
- Border
Details - Border
Radius Kind - Border
Style - BoxShadow
Clip Mode - Checkpoint
- A stage of the rendering pipeline.
- ClipId
- A reference to a clipping node defining how an item is clipped.
- Clip
Intern - Clip
Mode - Color
Depth - Specifies the color depth of an image. Currently only used for YUV images.
- Color
Range - Color
Space - Component
Transfer Func Type - Composite
Operator - Available composite operoations for the composite filter primitive
- Debug
Command - Update of the state of built-in debugging facilities.
- Dirty
Rect - The possible states of a Dirty rect.
- Display
Item - Extend
Mode - External
Image Source - The source for an external image.
- External
Image Type - Storage format identifier for externally-managed images.
- Filter
Data Intern - Filter
Op - CSS filter.
- Filter
Primitive Input - An input to a SVG filter primitive.
- Filter
Primitive Kind - See: https://github.com/eqrion/cbindgen/issues/9 cbindgen:derive-eq=false
- Font
Hinting - FontLCD
Filter - Font
Render Mode - Font
Template - Container for the raw data describing a font. This might be a stream of bytes corresponding to a downloaded font, or a handle to a native font from the operating system.
- Frame
Msg - Frame messages affect frame generation (applied after building the scene).
- Image
Data - Represents the backing store of an arbitrary series of pixels for display by WebRender. This storage can take several forms.
- Image
Format - Specifies the format of a series of pixels, in driver terms.
- Image
Rendering - Line
Orientation - Line
Style - MixBlend
Mode - Nine
Patch Border Source - Primitive
KeyKind - Information specific to a primitive type that uniquely identifies a primitive template by key.
- Property
Binding - A binding property can either be a specific value (the normal, non-animated case) or point to a binding location to fetch the current value from. Note that Binding has also a non-animated value, the value is used for the case where the animation is still in-delay phase (i.e. the animation doesn’t produce any animation values).
- Raster
Space - Configure whether the contents of a stacking context should be rasterized in local space or screen space. Local space rasterized pictures are typically used when we want to cache the output, and performance is important. Note that this is a performance hint only, which WR may choose to ignore.
- Reference
Frame Kind - Repeat
Mode - Resource
Update - Update of a persistent resource in WebRender.
- Scene
Msg - Frame messages affect building the scene.
- Scroll
Clamping - Describe whether or not scrolling should be clamped by the content bounds.
- Scroll
Location - Scroll
Sensitivity - Texture
Target - Specifies the type of texture target in driver terms.
- Transform
Style - YuvColor
Space - YuvData
- YuvFormat
Constants§
Traits§
- Async
Blob Image Rasterizer - A group of rasterization requests to execute synchronously on the scene builder thread.
- Blob
Image Handler - A handler on the render backend that can create rasterizer objects which will be sent to the scene builder thread to execute the rasterization.
- Blob
Image Resources - The resources exposed by the resource cache available for use by the blob rasterizer.
- External
Image Handler - The interfaces that an application can implement to support providing external image buffers. When the application passes an external image to WR, it should keep 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.
- Notification
Handler - A handler to notify when a transaction reaches certain stages of the rendering pipeline.
- Output
Image Handler - Allows callers to receive a texture with the contents of a specific pipeline copied to it.
- Render
Notifier - A handler to integrate WebRender with the thread that contains the
Renderer
.
Type Aliases§
- Blob
Image Data - Backing store for blob image command streams.
- Blob
Image Result - Result type for blob raserization.
- Document
Layer - Documents are rendered in the ascending order of their associated layer values.
- Glyph
Index - ItemTag
- A tag that can be used to identify items during hit testing. If the tag is missing then the item doesn’t take part in hit testing at all. This is composed of two numbers. In Servo, the first is an identifier while the second is used to select the cursor that should be used during mouse movement. In Gecko, the first is a scrollframe identifier, while the second is used to store various flags that APZ needs to properly process input events.
- Pipeline
Source Id - This type carries no valuable semantics for WR. However, it reflects the fact that
clients (Servo) may generate pipelines by different semi-independent sources.
These pipelines still belong to the same
IdNamespace
and the sameDocumentId
. Having this extra Id field enables them to generatePipelineId
without collision. - Tile
Size - Width and height in device pixels of image tiles.
- Void
PtrTo Size Fn - A C function that takes a pointer to a heap allocation and returns its size.