• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • ←→ pour naviguer
  • esc pour rejeter
⌘ '
raccourcis clavier

The Problem

The CPU can draw pixels, but it’s slow for animations, scrolling, and complex visual effects. Without GPU acceleration, web pages would feel sluggish and janky.

Core Idea

GPU rendering uses the Graphics Processing Unit (GPU) to accelerate painting and compositing. GPUs are designed for parallel pixel operations, making scrolling and animations smooth (60+ FPS).

How It Works

  1. CPU paints: Initial painting may happen on CPU
  2. Layers to GPU: Painted layers uploaded to GPU memory
  3. GPU composites: GPU combines layers, applies transforms/opacity
  4. Result: Smooth animations without CPU involvement

GPU excels at:

  • Transforming layers (translate, scale, rotate)
  • Adjusting opacity
  • Compositing multiple layers

Visual Explanation

G CPU CPU Painting GPU GPU Compositing & Transform CPU->GPU Screen Screen 60 FPS GPU->Screen

Key Properties

  • Parallel processing: GPU has thousands of small cores
  • Off-main-thread: doesn’t block JavaScript
  • Used for: transforms, opacity, scrolling, video
  • Layers must be uploaded to GPU memory (costly first time)

Connections

Edge Cases & Gotchas

  • Uploading layers to GPU has initial cost
  • GPU memory is limited—too many layers cause issues
  • Not all CSS properties are GPU-accelerated
  • transform and opacity are the best for animations