Hardware Overlay
A hardware overlay is a dedicated video memory buffer that one application renders into directly, which the display hardware then combines with the rest of the screen. It avoids the cost of clipping against other windows and is the basis of efficient video playback. Modern browsers use the same idea when they promote a video or canvas to its own compositor surface.
A **hardware overlay** is a region of video memory reserved for a single application, usually to show fast-changing imagery such as video or a game. The application draws into its own buffer, and the display hardware merges that buffer into the final picture. ## The problem it solves On a windowed desktop many programs share one screen. Without overlays they also share one block of video memory, and the graphics system must continually check that each program draws only where it is allowed, clipping its output against overlapping and neighbouring windows. For ordinary interfaces this cost is negligible. For a full-rate video it is significant. An overlay removes the checks. The application owns its buffer outright and can write a frame without regard to anything else on screen. The hardware places the buffer at the right position, and it can also scale the image and convert colour formats, for example from the YCbCr used by video codecs to RGB, more efficiently than software. Most video cards made since about 1998 support the technique. ## The trade-off The gain comes from **stepping outside the normal drawing path**, and that is also the weakness. Content in an overlay is not part of the ordinary composited image, so effects the windowing system applies there may not reach it. A classic symptom from the era of overlay video was that a screenshot of a playing film captured a blank rectangle: the screenshot read the shared framebuffer, and the video was never in it. ## The modern form Today's desktops composite every window on the GPU, but the principle survives. System compositors, such as Core Animation on macOS and DirectComposition on Windows, can display a buffer directly as its own layer or scan-out plane. Browsers exploit this for video and for continuously animating canvases by **promoting** the element to a compositor surface. The frames go straight to the system compositor instead of being redrawn into the page each time, which saves substantial power. The old trade-off returns in a new shape. A promoted surface sits outside the browser's own drawing of the page, so anything the browser would have applied while drawing, such as rounded-corner clipping, masks and blending, must either be delegated to the system compositor or cause the promotion to be refused. When that hand-off is wrong, the result is a visual bug that no style inspection will reveal. A worked example is Firefox on macOS Drops Rounded Corners on Live WebGL Canvases: Cause and a One-Line Workaround.