?? hwblt.cpp
字號:
SWAP(prclDst->left, prclDst->right, LONG);
/// Disallocate Scratch Surface
delete ScratchSurf;
RETAILMSG(DISP_ZONE_TEMP, (TEXT("BitBlt X-axis flip: R:%d\r\n"),pBltParms->pDst->Rotate()));
return TRUE;
}
RotateRectl(pBltParms->prclDst);
}
else //< DMDO_180
{
RotateRectlBack(prclDst);
/// if screen rotation is not DMDO_0. we need to bitblt once more. and use scratch memory
if(prclDst->right < prclDst->left)
{
RotateRectl(prclDst);
RETAILMSG(DISP_ZONE_TEMP, (TEXT("BitBlt Y-axis flip: R:%d\r\n"),pBltParms->pDst->Rotate()));
/// Allocation Scratch Framebuffer for Flip Operation.
DDGPESurf *ScratchSurf;
AllocSurface(&ScratchSurf, dwSrcWidth, dwSrcHeight, pBltParms->pDst->Format(), EGPEFormatToEDDGPEPixelFormat[pBltParms->pDst->Format()], GPE_REQUIRE_VIDEO_MEMORY);
if(ScratchSurf == NULL)
{
RETAILMSG(DISP_ZONE_WARNING,(TEXT("Scratch Surface Allocation is failed. %d\n"), __LINE__));
#if 0//USE_PACSURF, To increase video memory is better than to use system memory as Video Surface
RETAILMSG(TRUE,(TEXT("try to allocate surface usign PA Surface\r\n")));
PACSurf *ScratchSurf;
#endif
RETAILMSG(DISP_ZONE_WARNING,(TEXT("Maybe There's no sufficient video memory. please increase video memory\r\n")));
RETAILMSG(DISP_ZONE_WARNING,(TEXT("try to redirect to SW Emulated Bitblt\r\n")));
return FALSE;
}
/// Set Scratch Surface Information
descScratch.dwBaseaddr = (m_VideoMemoryPhysicalBase + ScratchSurf->OffsetInVideoMemory());
descScratch.dwColorMode = GetHWColorFormat(pBltParms->pDst);
descScratch.dwHoriRes = dwSrcWidth;
descScratch.dwVertRes = dwSrcHeight;
/// Set Destination Surface to Scratch Surface
m_oG2D->SetDstSurface(&descScratch);
/// Set Destination Clipping window Rect
m_oG2D->SetClipWindow(&t_rect);
/// Y-axis mirror case. left-right inversion
RETAILMSG(DISP_ZONE_TEMP,(TEXT("(%d,%d)~(%d,%d) %d,%d\n"),pBltParms->prclDst->left,pBltParms->prclDst->top,pBltParms->prclDst->right,pBltParms->prclDst->bottom, iRotate, m_oG2D->GetRotType(iRotate)));
EnterCriticalSection(&m_cs2D);
m_oG2D->FlipBlt( prclSrc, &t_rect, FLIP_Y );
LeaveCriticalSection(&m_cs2D);
/// Set Source Address to Scratch Memory
m_oG2D->SetSrcSurface(&descScratch);
/// Set Destination Surface to real Framebuffer Surface
m_oG2D->SetDstSurface(pdescDstSurface);
/// Swap left, right coordinate
SWAP(prclDst->right, prclDst->left, LONG);
/// Set Destination Clipping window Rect
if(pBltParms->prclClip)
{
m_oG2D->SetClipWindow(pBltParms->prclClip);
}
else
{
m_oG2D->SetClipWindow(prclDst);
}
/// Set Y-axis flip flag
EnterCriticalSection(&m_cs2D);
m_oG2D->BitBlt( &t_rect, prclDst, m_oG2D->GetRotType(iRotate) );
LeaveCriticalSection(&m_cs2D);
/// recover left, right coordinate
SWAP(prclDst->right, prclDst->left, LONG);
/// Disallocate Scratch Surface
delete ScratchSurf;
return TRUE;
}
else if(prclDst->bottom < prclDst->top)
{
RotateRectl(prclDst);
RETAILMSG(DISP_ZONE_TEMP, (TEXT("BitBlt X-axis flip: R:%d\r\n"),pBltParms->pDst->Rotate()));
/// Allocation Scratch Framebuffer for Flip Operation.
DDGPESurf *ScratchSurf;
AllocSurface(&ScratchSurf, dwSrcWidth, dwSrcHeight, pBltParms->pDst->Format(), EGPEFormatToEDDGPEPixelFormat[pBltParms->pDst->Format()], GPE_REQUIRE_VIDEO_MEMORY);
if(ScratchSurf == NULL)
{
RETAILMSG(DISP_ZONE_WARNING,(TEXT("Scratch Surface Allocation is failed. %d\n"), __LINE__));
#if 0//USE_PACSURF, To increase video memory is better than to use system memory as Video Surface
RETAILMSG(TRUE,(TEXT("try to allocate surface usign PA Surface\r\n")));
PACSurf *ScratchSurf;
#endif
RETAILMSG(DISP_ZONE_WARNING,(TEXT("Maybe There's no sufficient video memory. please increase video memory\r\n")));
RETAILMSG(DISP_ZONE_WARNING,(TEXT("try to redirect to SW Emulated Bitblt\r\n")));
return FALSE;
}
/// Set Scratch Surface Information
descScratch.dwBaseaddr = (m_VideoMemoryPhysicalBase + ScratchSurf->OffsetInVideoMemory());
descScratch.dwColorMode = GetHWColorFormat(pBltParms->pDst);
descScratch.dwHoriRes = dwSrcWidth;
descScratch.dwVertRes = dwSrcHeight;
/// Set Destination Surface to Scratch Surface
m_oG2D->SetDstSurface(&descScratch);
/// Set Destination Clipping window Rect
m_oG2D->SetClipWindow(&t_rect);
/// X-axis mirror case. top-down inversion
RETAILMSG(DISP_ZONE_TEMP,(TEXT("(%d,%d)~(%d,%d) %d,%d\n"),pBltParms->prclDst->left,pBltParms->prclDst->top,pBltParms->prclDst->right,pBltParms->prclDst->bottom, iRotate, m_oG2D->GetRotType(iRotate)));
EnterCriticalSection(&m_cs2D);
m_oG2D->FlipBlt( prclSrc, &t_rect, FLIP_X );
LeaveCriticalSection(&m_cs2D);
/// Set Source Address to Scratch Memory
m_oG2D->SetSrcSurface(&descScratch);
/// Set Destination Surface to real Framebuffer Surface
m_oG2D->SetDstSurface(pdescDstSurface);
/// Swap left, right coordinate
SWAP(prclDst->top, prclDst->bottom, LONG);
/// Set Destination Clipping window Rect
if(pBltParms->prclClip)
{
m_oG2D->SetClipWindow(pBltParms->prclClip);
}
else
{
m_oG2D->SetClipWindow(prclDst);
}
/// Set Y-axis flip flag
EnterCriticalSection(&m_cs2D);
m_oG2D->BitBlt( &t_rect, prclDst, m_oG2D->GetRotType(iRotate) );
LeaveCriticalSection(&m_cs2D);
/// recover left, right coordinate
SWAP(prclDst->top, prclDst->bottom, LONG);
/// Disallocate Scratch Surface
delete ScratchSurf;
return TRUE;
}
RotateRectl(prclDst);
}
}
RETAILMSG(DISP_ZONE_TEMP,(TEXT("SimpleBitBlt\n")));
RotateRectl(prclDst);
/// Set Destination Surface to real Framebuffer Surface
m_oG2D->SetDstSurface(pdescDstSurface);
/// Set Destination Clipping window Rect
if(pBltParms->prclClip)
{
m_oG2D->SetClipWindow(pBltParms->prclClip);
}
else
{
m_oG2D->SetClipWindow(prclDst);
}
if(pBltParms->bltFlags & BLT_ALPHABLEND)
DumpBltParms(pBltParms);
EnterCriticalSection(&m_cs2D);
m_oG2D->BitBlt( prclSrc, prclDst, m_oG2D->GetRotType(iRotate) );
LeaveCriticalSection(&m_cs2D);
}
return TRUE;
}
/**
* @fn int S3C6410Disp::GetRelativeDegree(int SourceDegree, int DestinationDegree)
* @brief Get Reletive Rotation Degree From Source Degree and Destination Degreee
* @param pBltParms Blit Parameter Information Structure
* @note DMDO_0 = 0, DMDO_90 = 1, DMDO_180 = 2, DMDO_270 = 4
*/
int S3C6410Disp::GetRelativeDegree(int SrcDegree, int DstDegree)
{
switch(SrcDegree)
{
default:
case DMDO_0:
switch(DstDegree)
{
default:
case DMDO_0: return DMDO_0;
case DMDO_90: return DMDO_90;
case DMDO_180: return DMDO_180;
case DMDO_270: return DMDO_270;
}
case DMDO_90:
switch(DstDegree)
{
default:
case DMDO_0: return DMDO_270;
case DMDO_90: return DMDO_0;
case DMDO_180: return DMDO_90;
case DMDO_270: return DMDO_180;
}
case DMDO_180:
switch(DstDegree)
{
default:
case DMDO_0: return DMDO_180;
case DMDO_90: return DMDO_270;
case DMDO_180: return DMDO_0;
case DMDO_270: return DMDO_90;
}
case DMDO_270:
switch(DstDegree)
{
default:
case DMDO_0: return DMDO_90;
case DMDO_90: return DMDO_180;
case DMDO_180: return DMDO_270;
case DMDO_270: return DMDO_0;
}
}
}
void S3C6410Disp::DumpBltParms(GPEBltParms *pBltParms)
{
if(pBltParms->pSrc)
{
RETAILMSG(DISP_ZONE_BLT_LO,(TEXT("Src:0x%x SrcB 0x%x, Surf(W:%d,H:%d,BPP:%d,STRIDE:%d), Screen(W:%d,H:%d), rect: (%d,%d)~(%d,%d), R:%d\r\n"),
pBltParms->pSrc,
pBltParms->pSrc->Buffer(),
pBltParms->pSrc->Width(),
pBltParms->pSrc->Height(),
EGPEFormatToBpp[pBltParms->pSrc->Format()],
pBltParms->pSrc->Stride(),
pBltParms->pSrc->ScreenWidth(),
pBltParms->pSrc->ScreenHeight(),
pBltParms->prclSrc->left,
pBltParms->prclSrc->top,
pBltParms->prclSrc->right,
pBltParms->prclSrc->bottom,
pBltParms->pSrc->Rotate()
));
}
if(pBltParms->pDst)
{
RETAILMSG(DISP_ZONE_BLT_LO,(TEXT("Dst:0x%x DstB 0x%x, Surf(W:%d,H:%d,BPP:%d,STRIDE:%d), Screen(W:%d,H:%d), rect: (%d,%d)~(%d,%d), R:%d\r\n"),
pBltParms->pDst,
pBltParms->pDst->Buffer(),
pBltParms->pDst->Width(),
pBltParms->pDst->Height(),
EGPEFormatToBpp[pBltParms->pDst->Format()],
pBltParms->pDst->Stride(),
pBltParms->pDst->ScreenWidth(),
pBltParms->pDst->ScreenHeight(),
pBltParms->prclDst->left,
pBltParms->prclDst->top,
pBltParms->prclDst->right,
pBltParms->prclDst->bottom,
pBltParms->pDst->Rotate()
));
}
if(pBltParms->prclClip)
{
RETAILMSG(DISP_ZONE_BLT_LO,(TEXT("ClipRegion (%d,%d)~(%d,%d)\r\n"),
pBltParms->prclClip->left,
pBltParms->prclClip->top,
pBltParms->prclClip->right,
pBltParms->prclClip->bottom
));
}
RETAILMSG(DISP_ZONE_BLT_LO, (TEXT("ROP : 0x%0x, iMode:%d\r\n"), pBltParms->rop4, pBltParms->iMode));
RETAILMSG(DISP_ZONE_BLT_LO, (TEXT("BlendFunction : Op(%d), Flag(%d),SourceConstantAlpha(%d),AlphaFormat(%d)\r\n"),
pBltParms->blendFunction.BlendOp,
pBltParms->blendFunction.BlendFlags,
pBltParms->blendFunction.SourceConstantAlpha, pBltParms->blendFunction.AlphaFormat));
RETAILMSG(DISP_ZONE_BLT_LO, (TEXT("xPositive : %d, yPositive : %d\r\n"),pBltParms->xPositive, pBltParms->yPositive));
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -