Microsoft Windows CE 3.0  

The Prepare Phase for Line Drawing

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Line drawing begins when an application calls Polyline. GDI handles the call to Polyline. GDI validates that there are at least two vertices and that the line style is not NULL. GDI then calls the GPE DrvStrokePathfunction or, for a wide pen, DrvFillPath. When GDI calls the GPE member function, it passes the following information from the device context: surface object, path object, clip rectangle, the brush, the ROP2 value, and the line attributes (solid or dashed). These parameters were either set by an application or are realized attributes. GPE uses some of the input parameters to set the members of its GPELineParms structure.

GPE then calls the display driver's GPE::Line function, passing in the GPELineParmsand passing the value gpePrepare. The driver examines the properties of the line to be drawn. The driver then chooses whether it should use the GPE EmulatedLinefunction or handle the line with its own accelerated function.

Before selecting an accelerated function, the driver must check whether the hardware can handle the line style and ROP. In the sample ATI display driver, available in the platform\cepc\drivers\display\ati directory of your Platform Builder installation, the driver sets the function pointer to EmulatedLineby default, but chooses hardware acceleration for lines that are both in video memory and use ROP 0x0D0D. The following code sample illustrates this.

if (phase == gpeSingle || phase == gpePrepare) {
pLineParms->pLine = EmulatedLine; if
(((ATISurf*)(pLineParms->pDst))->InVideoMemory() &&
pLineParms->mix == 0x0d0d) { pLineParms->pLine = (SCODE
(GPE::*)(struct GPELineParms *)) AcceleratedSolidLine; } }

Also in the prepare phase, the driver can optionally perform additional processing, such as initializing the hardware registers with the selected color. After the prepare phase, control returns to the GPE DrvStrokePathfunction.



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.