[][src]Module azul_webrender_api::units

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

Au

An App Unit, the fundamental unit of length in Servo. Usually 1/60th of a pixel (see AU_PER_PX)

DevicePixel

Geometry in the coordinate system of the render target (screen or intermediate surface) in physical pixels.

FramebufferPixel

Geometry in the coordinate system of the framebuffer in physical pixels. It's Y-flipped comparing to DevicePixel.

LayoutPixel

Geometry in a stacking context's local coordinate space (logical pixels).

PicturePixel

Geometry in the coordinate system of a Picture (intermediate surface) in physical pixels.

RasterPixel

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).

TexelRect

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.

Tiles

Offset in number of tiles.

WorldPixel

Geometry in the document's coordinate space (logical pixels).

Traits

AuHelpers
RectExt

Functions

device_rect_as_framebuffer_rect
device_size_as_framebuffer_size
layout_rect_as_picture_rect
layout_vector_as_picture_vector

Type Definitions

BlobDirtyRect
BlobToDeviceTranslation
DeviceHomogeneousVector
DeviceIntLength
DeviceIntPoint
DeviceIntRect
DeviceIntSideOffsets
DeviceIntSize
DevicePixelScale

Scaling ratio from world pixels to device pixels.

DevicePoint
DeviceRect
DeviceSize
DeviceVector2D
FramebufferIntPoint
FramebufferIntRect
FramebufferIntSize
ImageDirtyRect
LayoutIntPoint
LayoutIntRect
LayoutIntSize
LayoutPoint
LayoutPoint3D
LayoutPointAu
LayoutRect
LayoutRectAu
LayoutSideOffsets
LayoutSideOffsetsAu
LayoutSize
LayoutSizeAu
LayoutToDeviceScale

A complete scaling ratio from layout space to device pixel space.

LayoutToPictureTransform
LayoutToRasterTransform
LayoutToWorldScale

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.

LayoutToWorldTransform
LayoutTransform
LayoutVector2D
LayoutVector2DAu
LayoutVector3D
PictureIntPoint
PictureIntRect
PictureIntSize
PicturePoint
PicturePoint3D
PictureRect
PictureSize
PictureToLayoutTransform
PictureToRasterTransform
PictureVector2D
PictureVector3D
RasterIntPoint
RasterIntRect
RasterIntSize
RasterPoint
RasterPoint3D
RasterRect
RasterSize
RasterToLayoutTransform
RasterToPictureTransform
RasterVector2D
RasterVector3D
TileOffset
TileRange
WorldPoint
WorldPoint3D
WorldRect
WorldSize
WorldToLayoutTransform
WorldVector2D
WorldVector3D