Skip to main content

Module gpu

Module gpu 

Source
Expand description

GPU value synchronization (colors, transforms) for WebRender preparation GPU value caching for CSS transforms and opacity.

This module manages the synchronization between DOM CSS properties (transforms and opacity) and GPU-side keys used by WebRender. It tracks changes to transform and opacity values and generates events when values are added, changed, or removed.

§Performance

The cache uses CPU feature detection (SSE/AVX on x86_64) to optimize transform calculations. Values are only recalculated when CSS properties change, minimizing GPU updates.

§Architecture

  • GpuValueCache: Stores current transform/opacity keys and values for all nodes
  • GpuEventChanges: Contains delta events for transform/opacity changes
  • GpuTransformKeyEvent: Events for transform additions, changes, and removals

The cache is synchronized with the StyledDom on each frame, generating minimal update events to send to the GPU.

Structs§

GpuEventChanges
Contains all GPU-related change events from a cache synchronization.
GpuValueCache
Caches GPU transform and opacity keys and their current values for all nodes.

Enums§

GpuOpacityKeyEvent
GpuScrollbarOpacityEvent
Represents a change to a scrollbar opacity key.
GpuTransformKeyEvent
Represents a change to a GPU transform key.