Share via


Line Drawing Acceleration (Windows CE 5.0)

Send Feedback

The Windows CE OS supports line drawing acceleration.

The levels of accelerated line drawing are largely the same as for accelerated blit operations. The discussion of accelerating bit block transfers is relevant for line drawing as well, except that the emulation library does not provide software-accelerated line drawing.

Developers can add software-accelerated line drawing functions if necessary. For more information on accelerating bit block transfers, see Bit Block Transfer Acceleration.

Display drivers route line drawings to the GPE, 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 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 Line function. For improved performance, Line 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 EmulatedLine function of the GPE.

The driver searches for a destination surface in video memory and verifies the line drawing parameters. If the parameters are valid for acceleration, the line drawing function is set to the driver's AcceleratedSolidLine function.

See Also

Bit Block Transfer Acceleration | Accelerated Line Segment Function | Display Driver Development Concepts | Display Driver Extensions | Display Driver Samples

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.