Chromium Raw Draw: Bypassing Intermediate Tile Textures
This article explores the Raw Draw project in the Chromium web browser, an architectural shift in how web pages are rendered to the screen. It explains the traditional tiled rendering approach, details how Raw Draw bypasses intermediate tile textures by drawing directly to the final framebuffer, and examines the performance benefits and technical trade-offs of this modern rendering pipeline.
The Traditional Tiled Rendering Pipeline
To understand Raw Draw, it is necessary to understand what it replaces. Historically, Chromium has used a tiled rendering architecture to display web pages. When a web page is loaded, the browser breaks the page’s content down into layers, and those layers are further divided into a grid of smaller squares called tiles.
During the rasterization phase, Chromium takes a list of recorded
drawing commands—known internally as PaintOps—and executes
them using the Skia graphics library. Instead of drawing directly to the
screen, Skia draws these pixels into intermediate GPU textures
representing the individual tiles. Once the tiles are rasterized and
stored in GPU memory, the display compositor (Viz) stitches these tile
textures together and draws them onto the final screen framebuffer.
The Problem with Intermediate Tiles
Tiled rendering was designed in an era when GPUs were slower, and caching rendered pixels in tiles was the best way to achieve smooth scrolling. However, modern hardware has changed the performance equation.
Today, screens have extremely high resolutions (such as 4K and Retina displays), and GPUs have vastly more compute power. On high-DPI displays, storing dozens of intermediate tile textures consumes a massive amount of GPU memory (VRAM). Furthermore, writing pixel data to a tile texture and then immediately reading that same data back to draw it to the screen consumes a large amount of memory bandwidth. For pages with frequent animations or updates, constantly reallocating and updating these intermediate textures creates a performance bottleneck.
What is the Raw Draw Project?
Raw Draw is an initiative within the Chromium project designed to eliminate intermediate tile textures entirely for most web content. Instead of treating a web page like a collection of pre-rendered images (tiles) to be stitched together, Raw Draw treats the web page more like a 3D video game, re-rendering the visible viewport directly to the screen on every single frame.
How Raw Draw Bypasses Tile Textures
Raw Draw alters the handoff between the rasterization phase and the compositing phase. It bypasses intermediate textures through the following mechanism:
- Retaining PaintOps: When the browser process
determines what needs to be drawn, it generates the
PaintOps(the instructions for drawing shapes, borders, shadows, and text) just as it normally would. - Skipping Tile Allocation: Instead of allocating GPU
memory for tile textures and executing the
PaintOpsto fill those tiles, Chromium packages thePaintOpsinto a lightweight structure called aRenderPass. - Direct Framebuffer Execution: The display
compositor receives these raw drawing commands rather than references to
pre-rendered tile textures. When it is time to produce a frame, the
compositor executes the
PaintOpsdirectly against the final backbuffer (the screen's framebuffer).
By doing this, the pixel data is only written once—directly to the final destination—completely eliminating the memory storage and bandwidth overhead of the intermediate step.
Overcoming the Re-Rasterization Challenge
The primary risk of bypassing cached tiles is that the GPU must re-evaluate the drawing commands on every frame, even during a simple scroll. While modern GPUs can recalculate simple geometry like rectangles and gradients effortlessly at 60 or 120 frames per second, complex vector paths and text glyphs are computationally expensive to rasterize from scratch every frame.
To prevent text rendering from slowing down Raw Draw, Chromium utilizes a Skia feature known as "Slugs." A Slug is an intermediate, resolution-independent representation of text and complex paths. Instead of caching an entire tile of pixels, Chromium caches only the geometric math required to draw the specific text glyphs in a small atlas. During the Raw Draw phase, the GPU reads the Slug data and rapidly draws the text directly into the framebuffer without needing to recalculate the font geometry from scratch.
Benefits and Trade-offs
By bypassing intermediate tile textures, Raw Draw provides several distinct advantages:
- Reduced GPU Memory Usage: Without the need to store off-screen and on-screen tile textures, VRAM consumption drops significantly.
- Lower Memory Bandwidth: Eliminating the "write-to-tile, read-from-tile" cycle saves battery life on mobile devices and frees up the GPU bus.
- Reduced Latency: Because the compositor does not have to wait for a batch of tiles to finish rasterizing before drawing the frame, visual updates can reach the screen faster.
The main trade-off is an increase in per-frame GPU compute instructions, as the browser is doing raw drawing work every frame rather than just moving pre-rendered textures around. However, because modern GPUs increase their compute capabilities much faster than their memory bandwidth, Raw Draw aligns Chromium's architecture with the strengths of current hardware.