VirtualBox

Changeset 19817 in vbox for trunk/src/VBox/Frontends/VBoxBFE


Ignore:
Timestamp:
May 19, 2009 12:16:28 PM (16 years ago)
Author:
vboxsync
Message:

IFramebuffer cleanup next part:

  • removed obsolete internal framebuffer
  • removed IFramebuffer::setupInternalFramebuffer(), IFramebuffer::lockFramebuffer(), IFramebuffer::unlockFramebuffer(), IFramebuffer::registerExternalFramebuffer()
  • removed unused finished parameter of IFramebuffer::NotifyUpdate()
Location:
trunk/src/VBox/Frontends/VBoxBFE
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.cpp

    r19300 r19817  
    9393    mcbVbvaPartial = 0;
    9494
    95     RTSemEventMultiCreate(&mUpdateSem);
    96 
    97     // reset the event sems
    98     RTSemEventMultiReset(mUpdateSem);
    99 
    10095    // by default, we have an internal Framebuffer which is
    10196    // NULL, i.e. a black hole for no display output
     97    mFramebuffer = NULL;
     98    mFramebufferOpened = false;
     99
     100    mu32ResizeStatus = ResizeStatus_Void;
     101}
     102
     103VMDisplay::~VMDisplay()
     104{
    102105    mFramebuffer = 0;
    103     mInternalFramebuffer = true;
    104     mFramebufferOpened = false;
    105 
    106     mu32ResizeStatus = ResizeStatus_Void;
    107 }
    108 
    109 VMDisplay::~VMDisplay()
    110 {
    111     mFramebuffer = 0;
    112     RTSemEventMultiDestroy(mUpdateSem);
    113106}
    114107
     
    201194
    202195    // this is only valid for external framebuffers
    203     if (mInternalFramebuffer)
     196    if (!mFramebuffer)
    204197        return E_FAIL;
    205198
     
    259252    }
    260253
    261     // special processing for the internal Framebuffer
    262     if (mInternalFramebuffer)
    263     {
    264         mFramebuffer->Unlock();
    265     }
    266     else
    267     {
    268         // callback into the Framebuffer to notify it
    269         BOOL finished;
    270 
    271         RTSemEventMultiReset(mUpdateSem);
    272 
    273         mFramebuffer->NotifyUpdate(x, y, w, h, &finished);
    274         mFramebuffer->Unlock();
    275 
    276         if (!finished)
    277         {
    278             // the Framebuffer needs more time to process
    279             // the event so we have to halt the VM until it's done
    280             RTSemEventMultiWait(mUpdateSem, RT_INDEFINITE_WAIT);
    281         }
    282     }
     254    mFramebuffer->NotifyUpdate(x, y, w, h);
     255    mFramebuffer->Unlock();
    283256}
    284257
     
    336309 * @param Framebuffer external Framebuffer object
    337310 */
    338 STDMETHODIMP VMDisplay::RegisterExternalFramebuffer(Framebuffer *Framebuffer)
     311STDMETHODIMP VMDisplay::SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer)
    339312{
    340313    if (!Framebuffer)
     
    343316    // free current Framebuffer (if there is any)
    344317    mFramebuffer = 0;
    345     mInternalFramebuffer = false;
    346318    mFramebuffer = Framebuffer;
    347319    updateDisplayData();
  • trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.h

    r8155 r19817  
    5555    uint32_t getBitsPerPixel();
    5656
    57     STDMETHODIMP RegisterExternalFramebuffer(Framebuffer *Framebuffer);
     57    STDMETHODIMP SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer);
    5858    STDMETHODIMP InvalidateAndUpdate();
    5959    STDMETHODIMP ResizeCompleted();
     
    8484
    8585    Framebuffer *mFramebuffer;
    86     bool mInternalFramebuffer, mFramebufferOpened;
     86    bool mFramebufferOpened;
    8787
    8888    ULONG mSupportedAccelOps;
    89     RTSEMEVENTMULTI mUpdateSem;
    9089
    9190    struct _VBVAMEMORY *mpVbvaMemory;
  • trunk/src/VBox/Frontends/VBoxBFE/Framebuffer.h

    r19798 r19817  
    4444    virtual HRESULT getBitsPerPixel(ULONG *bitsPerPixel) = 0;
    4545    virtual HRESULT getLineSize(ULONG *lineSize) = 0;
    46     virtual HRESULT NotifyUpdate(ULONG x, ULONG y,
    47                             ULONG w, ULONG h, BOOL *finished) = 0;
     46    virtual HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h) = 0;
    4847    virtual HRESULT RequestResize(ULONG w, ULONG h, BOOL *finished) = 0;
    4948
  • trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.cpp

    r19798 r19817  
    228228 */
    229229HRESULT SDLFramebuffer::NotifyUpdate(ULONG x, ULONG y,
    230                                      ULONG w, ULONG h, BOOL *finished)
     230                                     ULONG w, ULONG h)
    231231{
    232232    LogFlow(("SDLFramebuffer::NotifyUpdate: x = %d, y = %d, w = %d, h = %d\n",
     
    258258#endif /* !VBOXBFE_WITH_X11 */
    259259
    260     /*
    261      * The Display thread can continue as we will lock the framebuffer
    262      * from the SDL thread when we get to actually doing the update.
    263      */
    264     if (finished)
    265         *finished = TRUE;
    266260    return S_OK;
    267261}
  • trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.h

    r19798 r19817  
    5050    virtual HRESULT getBitsPerPixel(ULONG *bitsPerPixel);
    5151    virtual HRESULT getLineSize(ULONG *lineSize);
    52     virtual HRESULT NotifyUpdate(ULONG x, ULONG y,
    53                             ULONG w, ULONG h, BOOL *finished);
     52    virtual HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h);
    5453    virtual HRESULT RequestResize(ULONG w, ULONG h, BOOL *finished);
    5554    virtual HRESULT GetVisibleRegion(BYTE *aRectangles, ULONG aCount, ULONG *aCountCopied);
  • trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp

    r19300 r19817  
    803803    if (!gConsole->initialized())
    804804        goto leave;
    805     gDisplay->RegisterExternalFramebuffer(gFramebuffer);
     805    gDisplay->SetFramebuffer(0, gFramebuffer);
    806806
    807807    /* start with something in the titlebar */
Note: See TracChangeset for help on using the changeset viewer.

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