Crate webrender_api
source ·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
Structs
Metadata (but not storage) for a blob image.
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.
Input parameters for the BlobImageRasterizer.
A key identifying blob image rasterization work requested from the blob
image rasterizer.
A display list.
Describes the memory layout of a display list.
Provides a hint to WR that it should try to cache the items
within a cache marker context in an off-screen surface.
Bit flags for WR stages to store in a capture.
Information about a loaded capture of each document
that is returned by
RenderBackend
.Mask for clearing caches in debug commands.
Represents RGBA screen colors with floating point numbers.
Represents RGBA screen colors with one byte per channel.
Geometry in the coordinate system of the render target (screen or intermediate
surface) in physical pixels.
When using
generate_frame()
, a list of PropertyValue
structures
can optionally be supplied to provide the current value of any
animated properties.An opaque pointer-sized value.
Descriptor for external image resources. See
ImageData
.An arbitrary identifier for an external image provided by the
application. It must be a unique identifier for each external
image.
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.
Data corresponding to an instantiation of a font, with size and
other options specified.
The DI is generic over the specifics, while allows to use
the “complete” version of it for convenient serialization.
Construct a gradient to be used in display lists.
Metadata (but not storage) describing an image In WebRender.
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
.Geometry in a stacking context’s local coordinate space (logical pixels).
Collection of heap sizes, in bytes.
Geometry in the coordinate system of a Picture (intermediate
surface) in physical pixels.
From the point of view of WR,
PipelineId
is completely opaque and generic as long as
it’s clonable, serializable, comparable, and hashable.Represents pre-multiplied RGBA colors with floating point numbers.
A unique key that is used for connecting animated property
values to bindings in the display list.
The current value of an animated property. This is
supplied by the calling code.
Geometry gets rasterized in a given root coordinate space. This
is often the root spatial node (world space), but may be a local
space for a variety of reasons (e.g. perspective).
Representation of a rasterized blob image. This is obtained by passing
BlobImageData
to the embedding via the rasterization callback.A modified version of DI where every field is borrowed instead of owned.
It allows us to reduce copies during serialization.
The minimum and maximum allowable offset for a sticky frame in a single dimension.
Stores two coordinates in texel space. The coordinates
are stored in texel coordinates because the texture atlas
may grow. Storing them as texel coords and normalizing
the UVs in the vertex shader means nothing needs to be
updated on the CPU when the texture size changes.
Offset in number of tiles.
A Transaction is a group of commands to apply atomically to a document.
Represents a transaction in the format sent through the channel.
Geometry in the document’s coordinate space (logical pixels).
Represents a zoom factor.
Enums
Error code for when blob rasterization failed.
Specifies the color depth of an image. Currently only used for YUV images.
The possible states of a Dirty rect.
Storage format identifier for externally-managed images.
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.
Represents the backing store of an arbitrary series of pixels for display by
WebRender. This storage can take several forms.
Specifies the format of a series of pixels, in driver terms.
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).
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.
Specifies the type of texture target in driver terms.
Constants
Traits
A group of rasterization requests to execute synchronously on the scene builder thread.
A handler on the render backend that can create rasterizer objects which will
be sent to the scene builder thread to execute the rasterization.
The resources exposed by the resource cache available for use by the blob rasterizer.
Type Definitions
Backing store for blob image command streams.
Result type for blob raserization.
Scaling ratio from world pixels to device pixels.
Documents are rendered in the ascending order of their associated layer values.
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.
A complete scaling ratio from layout space to device pixel space.
Scaling ratio from layout to world. Used for cases where we know the layout
is in world space, or specifically want to treat it this way.
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 same DocumentId
.
Having this extra Id field enables them to generate PipelineId
without collision.A C function that takes a pointer to a heap allocation and returns its size.