GPE::BltPrepare (Windows CE 5.0)
This method identifies the appropriate functions needed to perform individual blits. This function executes before a sequence of clipped blit operations.
SCODE GPE::BltPrepare(GPEBltParms* pBltParms);
Parameters
- pBltParms
[in] Pointer to a GPEBltParms structure containing parameters for the blit operation.
Return Values
S_OK indicates success.
Remarks
Two blit-related pure virtual GPE functions must be implemented for concrete classes derived from GPE: GPE::BltPrepare and GPE::BltComplete.
The following code example shows the simplest acceptable implementation for GPE::BltPrepare.
pBltParms->pBlt = EmulatedBlt;
return S_OK;
This action causes the emulated blit function provided with GPE to be used for blit operations.
For improved performance, the BltPrepare method can examine the characteristics of the blit and the associated surfaces defined in GPEBltParms to determine whether an accelerated form of the blit is used. The following code example shows how to determine the operations that are likely to be implemented in hardware.
if( pBltParms->pDst->InVideoMemory() && pBltParms->rop4 == 0x0000 )
// This is a fill of BLACKNESS in video memory.
if( pBltParms->pDst->InVideoMemory() && pBltParms->rop4 == 0xFFFF )
// This is a fill of WHITENESS in video memory.
if( pBltParms->pDst->InVideoMemory()
&& pBltParms->rop4 == 0xF0F0
&& pBltParms->solidColor != 0xFFFFFFFF )
// This is a fill of a solid color in video memory.
if( pBltParms->pDst->InVideoMemory()
&& pBltParms->pSrc->InVideoMemory()
&& pBltParms->rop4 == 0xCCCC
&& !pBltParms->pLookup
&& !pBltParms->pConvert )
// This is a source copy (SRCCOPY) between two surfaces, both in
// video memory, with no color translation.
To accelerate these types of blit, BltPrepare places the address of the accelerated function in the pBlt member of the GPEBltParms structure, instead of the pointer to the EmulatedBlt function. For operations such as solid color fills, the driver can prepare the hardware. For example, the driver can place a solid color into the appropriate register of the hardware. This eliminates the need to repeat the same action in every call to the accelerated blit handler.
Requirements
OS Versions: Windows CE 1.0 and later.
Header: Gpe.h.
Link Library: Gpe_lib.lib.
See Also
Display Drivers | GPE::BltComplete | GPEBltParms
Send Feedback on this topic to the authors