GDI manages bitmaps in all DIB formats including 1, 4, 8, 16, 24,and 32 bits-per-pixel. GDI can do all line drawing, filling, text output,and bit block transfer (bitblt) operations on these bitmaps.This makes it possible for the driver to either have GDI do all graphics rendering,or to implement functions for which its hardware offers special support.
If the device has a frame buffer in a DIB format, GDI can perform any or all graphics output directly to the frame buffer, thereby reducing the sizeof the driver.If the device uses a nonstandard-format frame buffer, then the driver must implement all required drawing functions. GDI can still simulate most drawing functions, although a performance cost is incurred: the pixels must be copied into a standard format bitmap before they can be operated on by GDI,and then be copied back to the original format after drawing is complete.
GDI offers improved definitions of lines and curves. Lines are not required to have integer endpoints in DEVICE coordinates, as was true for Microsoft Windows 3.x.This allows the driver to transform graphics objects without gross rounding. The fundamental curve in GDI is a Bezier curve (cubic spline) rather than an ellipse. All GDI internal operations are handled with Bezier curves, which are supported by most high-end devices.For devices that do not handle Bezier curves, GDI breaks curves down into line segments before calling the driver to draw them.
GDI can download regions to be filled in the form of paths, as well as rectangles. Drivers can decompose paths into trapezoids or spans for filling.
GDI-Managed Attributes: Brushes
GDI also manages all attributes. GDI passes attributes to the driver as brushes; the driver realizes these brushes by converting them to a useful internal form. GDI maintains this converted information for the driver. GDI also maintains all states of the brushes, including bounds, correlation, current position,and line style. The driver can cache information but is not assumed to maintain any state. Except for initialization and brush realization, GDI calls the driver only to draw on the device. GDI takes care of transformations, region locking,and pointer exclusion before it calls the driver.
Whenever a driver needs to use a brush not yet realized, it calls back to GDI. GDI allocates memory for the brush and calls the driver to realize it and,if necessary, dither it.