Partager via


Drawing and Filling Paths

The graphics driver considers a path to be a sequence of lines, and/or curves, defined by a path object (PATHOBJ structure). To handle the filling of closed paths, the driver supports the function DrvFillPath.

GDI can call DrvFillPath to fill a path on a device-managed surface. GDI compares the requirements of the fill with the DEVINFO structure's flags GCAPS_BEZIERS, GCAPS_ALTERNATEFILL, and GCAPS_WINDINGFILL, to decide whether to call the driver. If GDI does call the driver, the driver either performs the operation or returns, informing GDI that the path or clipping requested is too complex to be handled by the device. In the latter case, GDI breaks the request down into several simpler operations.

A driver can also support the optional DrvStrokeAndFillPath function to fulfill requests for path fills. This function fills and strokes a path at the same time. Many GDI primitives require this functionality. If a wide line is used for stroking, the filled area must be reduced to compensate for the increased width of the bounding path.

When the driver returns FALSE from either the DrvFillPath or DrvStrokeAndFillPath functions, GDI converts the fill-path request to a set of simpler operations and calls the driver function again. If the device returns FALSE again on the second call to DrvFillPath, GDI converts the path to a clip object and then calls EngFillPath. For a FALSE return when DrvStrokeAndFillPath is recalled, GDI can convert the call into separate calls to DrvStrokePath and DrvFillPath.