Surface Types

Surface types can be viewed in context of how they are handled. These types are as follows:

 

Engine-Managed Surfaces

A standard-format bitmap, called a DIB, is a single-plane, packed-pixel (where the data for each pixel is stored in a contiguous manner)format bitmap. Each scan line of the bitmap is aligned on a four-byte boundary.

Standard-format bitmaps are created and supported by GDI when the driver calls the GDI service EngCreateBitmap. An engine-managed surface must be a DIB. The frame buffer driver creates a DIB as its primary surface and lets GDI handle rendering operations.

Device-Managed Surfaces

Device-managed surfaces are controlled by the driver and they can be either DIB or nonDIB surfaces. Having a device-managed DIB surface allows the driver to call back to GDI to have it draw on the surface. A driver can get a handle to a DIB by calling EngCreateBitmap and then wrap a surface around it by calling EngCreateDeviceSurface, which requires GDI to call the driver for rendering operations. This is used in banked frame buffer display drivers. Refer also to Supporting Banked Frame Buffers.

A driver can enable a device-managed nonDIB surface by calling EngCreateDeviceSurface to have GDI create the surface and return a handle to it. GDI relies on the driver to access, to control drawing to, and to read from a device-managed surface.

A DDB, sometimes called a device-format bitmap, is another type of nonDIB device-managed surface. The DDB is supported to allow certain drivers, such as the VGA, to implement faster bitmap-to-screen block transfers. The DDB also allows drivers to draw to banked or nonDIB bitmaps in offscreen display memory. If a DDB is required, the driver can support DrvCreateDeviceBitmap and call EngCreateDeviceBitmap to have the engine return a handle to the bitmap.