Enhancing support through the use of overlay buffers

DCI clients may use overlay surfaces to compose complicated onscreen images by displaying multiple surfaces in a single window. Overlay surfaces can be created for combination with the Primary surface or with offscreen surfaces. For example, a DCI client might draw RGB8 data in a window through the overlay surface, then fill an offscreen surface with digital video data in YUV9 so that the RGB8 data is drawn on top of the YUV9 data.

In this case, the DCI client first creates an overlay surface with DCICreateOverlaySurface, and writes the RGB8 data to the overlay surface. The pixels that are to show video data are filled with the device's chroma-key color, which is returned by DCICreateOverlaySurface. Next, the DCI client calls DCICreateOffScreenSurface and draws the video image to the offscreen surface. Finally, the DCI client calls the offscreen surface's Draw callback to combine the surfaces into one onscreen image.