VirtualBox

Changeset 84740 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jun 9, 2020 3:28:30 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138533
Message:

Main,include: provide a new method for the graphics device to pass notifications to a frontend

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r83622 r84740  
    4343# include <VBoxVideo.h>
    4444#endif
     45#include <VBoxVideo3D.h>
    4546
    4647#include <VBox/com/array.h>
     
    31413142
    31423143#endif /* VBOX_WITH_VIDEOHWACCEL */
     3144
     3145int Display::i_handle3DNotifyProcess(VBOX3DNOTIFY *p3DNotify)
     3146{
     3147    unsigned const id = (unsigned)p3DNotify->iDisplay;
     3148    if (id >= mcMonitors)
     3149        return VERR_INVALID_PARAMETER;
     3150
     3151    ComPtr<IFramebuffer> pFramebuffer;
     3152    AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS);
     3153    pFramebuffer = maFramebuffers[id].pFramebuffer;
     3154    arlock.release();
     3155
     3156    int rc = VINF_SUCCESS;
     3157
     3158    if (!pFramebuffer.isNull())
     3159    {
     3160        com::SafeArray<BYTE> data;
     3161        data.initFrom((BYTE *)&p3DNotify->au8Data[0], p3DNotify->cbData);
     3162
     3163        HRESULT hr = pFramebuffer->Notify3DEvent((ULONG)p3DNotify->enmNotification, ComSafeArrayAsInParam(data));
     3164        if (FAILED(hr))
     3165            rc = VERR_NOT_SUPPORTED;
     3166    }
     3167    else
     3168        rc = VERR_NOT_IMPLEMENTED;
     3169
     3170    return rc;
     3171}
     3172
     3173DECLCALLBACK(int) Display::i_display3DNotifyProcess(PPDMIDISPLAYCONNECTOR pInterface,
     3174                                                    VBOX3DNOTIFY *p3DNotify)
     3175{
     3176    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
     3177    return pDrv->pDisplay->i_handle3DNotifyProcess(p3DNotify);
     3178}
    31433179
    31443180HRESULT Display::notifyScaleFactorChange(ULONG aScreenId, ULONG aScaleFactorWMultiplied, ULONG aScaleFactorHMultiplied)
     
    37223758    pThis->IConnector.pfnVBVAReportCursorPosition = Display::i_displayVBVAReportCursorPosition;
    37233759#endif
     3760    pThis->IConnector.pfn3DNotifyProcess       = Display::i_display3DNotifyProcess;
    37243761
    37253762    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette