Skip to content
Nicolas Silva edited this page Dec 3, 2019 · 6 revisions

Overview

Webrender is an experimental renderer for Servo that aims to draw web content like a modern game engine.

What does this mean?

  • Specialized renderer for web content.
    • Not a general purpose vector graphics API.
    • Complex items such as canvas can be rendered on CPU.
    • Make the common case fast.
  • Use GPU to do all rasterization where possible.
    • Items not well suited to GPU rasterizing can be drawn on the CPU and cached in textures.
  • Draw only what's on screen
    • Aggressively cull items.
    • Redraw each frame (when there is something to be updated - not a constant fps like games!).
    • Cache results (such as vertex buffers, rasterized glyphs) where possible between frames.
    • Take advantage of knowledge of entire scene up front to optimize drawing.
  • Batching
    • Group items into small number of draw calls.
    • Necessary for good performance with OpenGL.

Why try this?

  • High resolution displays, GPUs likely to scale better than CPUs here.
  • GPUs excel at blits, blending.
  • Hit common driver paths used in games, encounter fewer driver bugs?
  • May be faster for cases that game engines already deal with (animations, transitions, 3d transforms).
  • Simplifies parts of layout and rendering in traditional painting model.
    • Layout no longer needs to worry about layerization, as this is an internal implementation detail!