本文整理汇总了C++中Display::VideoAccelEnable方法的典型用法代码示例。如果您正苦于以下问题:C++ Display::VideoAccelEnable方法的具体用法?C++ Display::VideoAccelEnable怎么用?C++ Display::VideoAccelEnable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::VideoAccelEnable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LogSunlover
DECLCALLBACK(int) iface_VideoAccelEnable(PPDMIVMMDEVCONNECTOR pInterface, bool fEnable, VBVAMEMORY *pVbvaMemory)
{
PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
Console *pConsole = pDrv->pVMMDev->getParent();
Display *display = pConsole->getDisplay();
if (display)
{
LogSunlover(("MAIN::VMMDevInterface::iface_VideoAccelEnable: %d, %p\n", fEnable, pVbvaMemory));
return display->VideoAccelEnable(fEnable, pVbvaMemory);
}
return VERR_NOT_SUPPORTED;
}
示例2: if
/**
* Periodic display refresh callback.
*
* @param pInterface Display connector.
*/
DECLCALLBACK(void) Display::displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface)
{
PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
/* Contrary to displayUpdateCallback and displayResizeCallback
* the framebuffer lock must be taken since the function
* pointed to by pDrv->pUpPort->pfnUpdateDisplay is unaware
* of any locking issues. */
Display *pDisplay = pDrv->pDisplay;
uint32_t u32ResizeStatus = pDisplay->mu32ResizeStatus;
if (u32ResizeStatus == ResizeStatus_UpdateDisplayData)
{
#ifdef DEBUG_sunlover
LogFlowFunc (("ResizeStatus_UpdateDisplayData\n"));
#endif /* DEBUG_sunlover */
/* The framebuffer was resized and display data need to be updated. */
pDisplay->handleResizeCompletedEMT ();
/* Continue with normal processing because the status here is ResizeStatus_Void. */
Assert (pDisplay->mu32ResizeStatus == ResizeStatus_Void);
/* Repaint the display because VM continued to run during the framebuffer resize. */
pDrv->pUpPort->pfnUpdateDisplayAll(pDrv->pUpPort);
/* Ignore the refresh to replay the logic. */
return;
}
else if (u32ResizeStatus == ResizeStatus_InProgress)
{
#ifdef DEBUG_sunlover
LogFlowFunc (("ResizeStatus_InProcess\n"));
#endif /* DEBUG_sunlover */
/* The framebuffer is being resized. Do not call the VGA device back. Immediately return. */
return;
}
if (pDisplay->mfPendingVideoAccelEnable)
{
/* Acceleration was enabled while machine was not yet running
* due to restoring from saved state. Update entire display and
* actually enable acceleration.
*/
Assert(pDisplay->mpPendingVbvaMemory);
/* Acceleration can not be yet enabled.*/
Assert(pDisplay->mpVbvaMemory == NULL);
Assert(!pDisplay->mfVideoAccelEnabled);
if (pDisplay->mfMachineRunning)
{
pDisplay->VideoAccelEnable (pDisplay->mfPendingVideoAccelEnable, pDisplay->mpPendingVbvaMemory);
/* Reset the pending state. */
pDisplay->mfPendingVideoAccelEnable = false;
pDisplay->mpPendingVbvaMemory = NULL;
}
}
else
{
Assert(pDisplay->mpPendingVbvaMemory == NULL);
if (pDisplay->mfVideoAccelEnabled)
{
Assert(pDisplay->mpVbvaMemory);
pDisplay->VideoAccelFlush ();
}
else
{
Assert(pDrv->Connector.pu8Data);
pDisplay->mFramebuffer->Lock();
pDrv->pUpPort->pfnUpdateDisplay(pDrv->pUpPort);
pDisplay->mFramebuffer->Unlock();
}
}
}