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§

channel
units
A collection of coordinate spaces and their corresponding Point, Size and Rect types.

Macros§

enumerate_interners
Meta-macro to enumerate the various interner identifiers and types.

Structs§

AddBlobImage
Creates a blob-image resource with provided parameters.
AddFontInstance
Creates a font instance resource.
AddImage
Creates an image resource with provided parameters.
AuxIter
BackdropFilterDisplayItem
Renders a filtered region of its backdrop
BlendPrimitive
BlobImageDescriptor
Metadata (but not storage) for a blob image.
BlobImageKey
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.
BlobImageParams
Input parameters for the BlobImageRasterizer.
BlobImageRequest
A key identifying blob image rasterization work requested from the blob image rasterizer.
BlurPrimitive
BorderDisplayItem
BorderRadius
BorderSide
BoxShadowDisplayItem
BuiltDisplayList
A display list.
BuiltDisplayListDescriptor
Describes the memory layout of a display list.
BuiltDisplayListIter
CaptureBits
Bit flags for WR stages to store in a capture.
CapturedDocument
Information about a loaded capture of each document that is returned by RenderBackend.
ClearCache
Mask for clearing caches in debug commands.
ClearRectangleDisplayItem
Clears all colors from the area, making it possible to cut holes in the window. (useful for things like the macos frosted-glass effect).
ClipChainId
ClipChainItem
Just an abstraction for bundling up a bunch of clips into a “super clip”.
ClipDisplayItem
ColorF
Represents RGBA screen colors with floating point numbers.
ColorMatrixPrimitive
cbindgen:derive-eq=false
ColorU
Represents RGBA screen colors with one byte per channel.
CommonItemProperties
A grouping of fields a lot of display items need, just to avoid repeating these over and over in this file.
ComplexClipRegion
ComponentTransferPrimitive
CompositePrimitive
DebugFlags
Flags to enable/disable various builtin debugging tools.
DisplayItemRef
DisplayListBuilder
DocumentId
A key uniquely identifying a WebRender document.
DocumentTransaction
DropShadowPrimitive
DynamicProperties
When using generate_frame(), a list of PropertyValue 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.
ExternalEvent
An opaque pointer-sized value.
ExternalImage
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!
ExternalImageData
Descriptor for external image resources. See ImageData.
ExternalImageId
An arbitrary identifier for an external image provided by the application. It must be a unique identifier for each external image.
ExternalScrollId
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.
FilterData
FilterPrimitive
SVG Filter Primitive. See: https://github.com/eqrion/cbindgen/issues/9 cbindgen:derive-eq=false
FloodPrimitive
FontInstanceData
Data corresponding to an instantiation of a font, with size and other options specified.
FontInstanceFlags
FontInstanceKey
FontInstanceOptions
FontInstancePlatformOptions
FontKey
FontVariation
GlyphDimensions
GlyphInstance
GlyphOptions
Gradient
GradientBuilder
Construct a gradient to be used in display lists.
GradientDisplayItem
The area
GradientStop
HitTestDisplayItem
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.
HitTestFlags
HitTestItem
Describe an item that matched a hit-test query.
HitTestResult
Returned by RenderApi::hit_test.
IdNamespace
ID namespaces uniquely identify different users of WebRender’s API.
IdentityPrimitive
IframeDisplayItem
ImageDescriptor
Metadata (but not storage) describing an image In WebRender.
ImageDescriptorFlags
Various flags that are part of an image descriptor.
ImageDisplayItem
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.
ImageKey
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.
ImageMask
InternerSubReport
InterningMemoryReport
Memory report for interning-related data structures. cbindgen:derive-eq=false
ItemRange
ItemStats
Stats for an individual item
LineDisplayItem
MemoryReport
Collection of heap sizes, in bytes. cbindgen:derive-eq=false
NativeFontHandle
NinePatchBorder
NormalBorder
NotificationRequest
A request to notify a handler when the transaction reaches certain stages of the rendering pipeline.
OffsetPrimitive
OpacityPrimitive
PipelineId
From the point of view of WR, PipelineId is completely opaque and generic as long as it’s clonable, serializable, comparable, and hashable.
PremultipliedColorF
Represents pre-multiplied RGBA colors with floating point numbers.
PrimitiveFlags
PropertyBindingId
A key to identify an animated property binding.
PropertyBindingKey
A unique key that is used for connecting animated property values to bindings in the display list.
PropertyValue
The current value of an animated property. This is supplied by the calling code.
PushShadowDisplayItem
PushStackingContextDisplayItem
QualitySettings
Various settings that the caller can select based on desired tradeoffs between rendering quality and performance / power usage.
RadialGradient
RadialGradientDisplayItem
RasterizedBlobImage
Representation of a rasterized blob image. This is obtained by passing BlobImageData to the embedding via the rasterization callback.
RectangleDisplayItem
A solid color to draw (may not actually be a rectangle due to complex clips)
ReferenceFrame
ReferenceFrameDisplayListItem
RenderApi
The main entry point to interact with WebRender.
RenderApiSender
Allows the API to communicate with WebRender.
RepeatingImageDisplayItem
This describes a background-image and its tiling. It repeats in a grid to fill the specified area.
SaveState
ScrollFrameDisplayItem
ScrollNodeState
Shadow
SpaceAndClipInfo
Per-primitive information about the nodes in the clip tree and the spatial tree that the primitive belongs to.
SpatialId
A reference to a spatial node defining item positioning.
StackingContext
StickyFrameDisplayItem
StickyOffsetBounds
The minimum and maximum allowable offset for a sticky frame in a single dimension.
SyntheticItalics
TempFilterData
TextDisplayItem
Transaction
A Transaction is a group of commands to apply atomically to a document.
TransactionMsg
Represents a transaction in the format sent through the channel.
UpdateBlobImage
Updates an already existing blob-image resource.
UpdateImage
Updates an already existing image resource.
YuvImageDisplayItem
ZoomFactor
Represents a zoom factor.

Enums§

AddFont
Creates a font resource.
AlphaType
ApiMsg
Message sent by the RenderApi to the render backend thread.
BlobImageError
Error code for when blob rasterization failed.
BorderDetails
BorderRadiusKind
BorderStyle
BoxShadowClipMode
Checkpoint
A stage of the rendering pipeline.
ClipId
A reference to a clipping node defining how an item is clipped.
ClipIntern
ClipMode
ColorDepth
Specifies the color depth of an image. Currently only used for YUV images.
ColorRange
ColorSpace
ComponentTransferFuncType
CompositeOperator
Available composite operoations for the composite filter primitive
DebugCommand
Update of the state of built-in debugging facilities.
DirtyRect
The possible states of a Dirty rect.
DisplayItem
ExtendMode
ExternalImageSource
The source for an external image.
ExternalImageType
Storage format identifier for externally-managed images.
FilterDataIntern
FilterOp
CSS filter.
FilterPrimitiveInput
An input to a SVG filter primitive.
FilterPrimitiveKind
See: https://github.com/eqrion/cbindgen/issues/9 cbindgen:derive-eq=false
FontHinting
FontLCDFilter
FontRenderMode
FontTemplate
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.
FrameMsg
Frame messages affect frame generation (applied after building the scene).
ImageData
Represents the backing store of an arbitrary series of pixels for display by WebRender. This storage can take several forms.
ImageFormat
Specifies the format of a series of pixels, in driver terms.
ImageRendering
LineOrientation
LineStyle
MixBlendMode
NinePatchBorderSource
PrimitiveKeyKind
Information specific to a primitive type that uniquely identifies a primitive template by key.
PropertyBinding
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).
RasterSpace
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.
ReferenceFrameKind
RepeatMode
ResourceUpdate
Update of a persistent resource in WebRender.
SceneMsg
Frame messages affect building the scene.
ScrollClamping
Describe whether or not scrolling should be clamped by the content bounds.
ScrollLocation
ScrollSensitivity
TextureTarget
Specifies the type of texture target in driver terms.
TransformStyle
YuvColorSpace
YuvData
YuvFormat

Constants§

MAX_BLUR_RADIUS
MAX_TEXT_RUN_LENGTH

Traits§

AsyncBlobImageRasterizer
A group of rasterization requests to execute synchronously on the scene builder thread.
BlobImageHandler
A handler on the render backend that can create rasterizer objects which will be sent to the scene builder thread to execute the rasterization.
BlobImageResources
The resources exposed by the resource cache available for use by the blob rasterizer.
ExternalImageHandler
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.
NotificationHandler
A handler to notify when a transaction reaches certain stages of the rendering pipeline.
OutputImageHandler
Allows callers to receive a texture with the contents of a specific pipeline copied to it.
RenderNotifier
A handler to integrate WebRender with the thread that contains the Renderer.

Type Aliases§

BlobImageData
Backing store for blob image command streams.
BlobImageResult
Result type for blob raserization.
DocumentLayer
Documents are rendered in the ascending order of their associated layer values.
GlyphIndex
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.
PipelineSourceId
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.
TileSize
Width and height in device pixels of image tiles.
VoidPtrToSizeFn
A C function that takes a pointer to a heap allocation and returns its size.