BOOL DrvStrokePath(
IN SURFOBJ *pso, | |
IN PATHOBJ *ppo, | |
IN CLIPOBJ *pco, | |
IN XFORMOBJ *pxo, | |
IN BRUSHOBJ *pbo, | |
IN POINTL *pptlBrushOrg, | |
IN LINEATTRS *plineattrs, | |
IN MIX mix | |
); |
DrvStrokePath strokes a path when called by GDI. If the driver has hooked the function, and if the appropriate GCAPs are set, GDI calls DrvStrokePath when GDI draws a line or curve with any set of attributes.
Parameters
pso
Identifies the surface on which to draw.
ppo
Points to a PATHOBJ structure. GDI PATHOBJ_Xxx service routines are provided to enumerate the lines, Bezier curves, and other data that make up the path. This indicates what is to be drawn.
pco
Points to a CLIPOBJ structure. GDI CLIPOBJ_Xxx service routines are provided to enumerate the clip region as a set of rectangles. Optionally, all the lines in the path may be enumerated preclipped by CLIPOBJ. This means that drivers can have all their line clipping calculations done for them.
pxo
Points to a XFORMOBJ. This is only needed when a geometric wide line is to be drawn. It specifies the transform that maps world coordinates to device coordinates. This is needed because the path is provided in device coordinates but a geometric wide line is actually widened in world coordinates.
The XFORMOBJ can be queried to find the transform.
pbo
Specifies the brush to be used when drawing the path.
pptlBrushOrg
Points to the brush origin used to align the brush pattern on the device.
plineattrs
Points to a LINEATTRS structure. Note that the elStyleState member must be updated as part of this function if the line is styled. Also note that the ptlLastPel member must be updated if a single pixel width cosmetic line is being drawn.
mix
Specifies how to combine the brush with the destination.
Return Value
The return value is TRUE if the driver is able to stroke the path. If GDI should stroke the path, the return value is FALSE, and an error code is not logged. If the driver encounters an error, the return value is DDI_ERROR, and an error code is logged.
Comments
If a driver supports this entry point, it should also support the drawing of cosmetic wide lines with arbitrary clipping. Using the provided GDI functions, the call can be broken down into a set of single-pixel-width lines with precomputed clipping.
This function is required if any drawing is to be done on a device-managed surface.
Drivers for advanced devices can optionally receive this call to draw paths containing Bezier curves and geometric wide lines. GDI will test the GCAPS_BEZIERS and GCAPS_GEOMETRICWIDE flags of the flGraphicsCaps member of the DEVINFO structure to decide whether it should call. (The four combinations of the bits determine the four levels of functionality for this call.) If the driver gets an advanced call containing Bezier curves or geometric wide lines, it can decide not to handle the call, returning FALSE. This might happen if the path or clipping is too complex for the device to process. If the call does return FALSE, GDI breaks the call down into simpler calls that can be handled easily.
For device-managed surfaces, the function must minimally support single-pixel-wide solid and styled cosmetic lines using a solid-colored brush. The device can return FALSE if the line is geometric and the engine will convert those calls to DrvFillPath or DrvPaint calls.
The mix mode defines how the incoming pattern should be mixed with the data already on the device surface. The MIX data type consists of two ROP2 values packed into a single ULONG. The low-order byte defines the foreground raster operation; the next byte defines the background raster operation. For more information about raster operation codes, see the Win32 SDK.
See Also
CLIPOBJ, DEVINFO, DrvFillPath, DrvPaint, LINEATTRS, PATHOBJ, XFORMOBJ