Module webrender_api::units

source ·
Expand description

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

Physical pixels take into account the device pixel ratio and their dimensions tend to correspond to the allocated size of resources in memory, while logical pixels don’t have the device pixel ratio applied which means they are agnostic to the usage of hidpi screens and the like.

The terms “layer” and “stacking context” can be used interchangeably in the context of coordinate systems.

Structs

  • An App Unit, the fundamental unit of length in Servo. Usually 1/60th of a pixel (see AU_PER_PX)
  • Geometry in the coordinate system of the render target (screen or intermediate surface) in physical pixels.
  • Geometry in the coordinate system of the framebuffer in physical pixels. It’s Y-flipped comparing to DevicePixel.
  • Geometry in a stacking context’s local coordinate space (logical pixels).
  • Geometry in the coordinate system of a Picture (intermediate surface) in physical pixels.
  • 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).
  • 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.
  • Geometry in the document’s coordinate space (logical pixels).

Constants

Traits

Functions

Type Aliases