Microsoft Windows CE 3.0  

Accelerating Line Drawing

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.

Windows CE 2.0 and later include support for accelerating line drawing. The levels of accelerated line drawing are largely the same as for accelerated blit operations. The discussion of accelerating bit block transfersin the previous sections is relevant for line drawing as well, except that the emulation library provided in the Platform Builder does not provide software-accelerated line drawing. Developers can add software-accelerated line drawing functions, if necessary.

Display drivers route line drawing to the GPE, to custom software acceleration routines, or directly to the hardware. The following code example from the ATI display driver sample shows how these methods are invoked. This source code is very similar in design to the acceleration processing performed for blit operations.

SCODE ATI::Line(GPELineParms *pLineParms,
EGPEPhase phase) { if (phase == gpeSingle || phase == gpePrepare) {
DispPerfStart (ROP_LINE); pLineParms->pLine = EmulatedLine; if
(((ATISurf*)(pLineParms->pDst))->InVideoMemory() &&
pLineParms->mix == 0x0d0d) { pLineParms->pLine = (SCODE
(GPE::*)(struct GPELineParms *)) AcceleratedSolidLine; } else if
(phase == gpeComplete) { DispPerfEnd (0); } return S_OK; }

Line drawing begins with a call to the driver's Linefunction. For improved performance, the driver's Linefunction can examine the characteristics of the line drawing and the associated surfaces to determine whether an accelerated form of line drawing is appropriate. The default line drawing function is set to the EmulatedLinefunction of the GPE. The driver checks for a destination surface in video memory and checks the line drawing parameters. If the parameters are valid for acceleration, the line drawing function is set to the driver's AcceleratedSolidLinefunction.

 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.