VirtualBox

Changeset 27720 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 25, 2010 7:06:26 PM (15 years ago)
Author:
vboxsync
Message:

2d: more fixes to work with new UI mode changes

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r27697 r27720  
    206206{
    207207public:
    208     VBoxVHWACommandProcessEvent (VBoxVHWACommandElement *pEl)
     208    VBoxVHWACommandProcessEvent ()
    209209        : QEvent ((QEvent::Type) VBoxDefs::VHWACommandProcessType)
    210     {
    211         mCmdPipe.put(pEl);
    212     }
    213     VBoxVHWACommandElementPipe & pipe() { return mCmdPipe; }
    214 
    215     VBoxVHWACommandProcessEvent *mpNext;
    216 private:
    217     VBoxVHWACommandElementPipe mCmdPipe;
     210    {}
    218211};
    219212
     
    20272020}
    20282021
    2029 //VBoxVHWACommandElement * VBoxVHWAImage::processCmdList(VBoxVHWACommandElement * pCmd)
    2030 //{
    2031 //    VBoxVHWACommandElement * pCur;
    2032 //    do
    2033 //    {
    2034 //        pCur = pCmd;
    2035 //        switch(pCmd->type())
    2036 //        {
    2037 //        case VBOXVHWA_PIPECMD_PAINT:
    2038 //            vboxDoUpdateRect(&pCmd->rect());
    2039 //            break;
    2040 //#ifdef VBOX_WITH_VIDEOHWACCEL
    2041 //        case VBOXVHWA_PIPECMD_VHWA:
    2042 //            vboxDoVHWACmd(pCmd->vhwaCmd());
    2043 //            break;
    2044 //        case VBOXVHWA_PIPECMD_FUNC:
    2045 //        {
    2046 //            const VBOXVHWAFUNCCALLBACKINFO & info = pCmd->func();
    2047 //            info.pfnCallback(info.pContext1, info.pContext2);
    2048 //            break;
    2049 //        }
    2050 //#endif
    2051 //        default:
    2052 //            Assert(0);
    2053 //        }
    2054 //        pCmd = pCmd->mpNext;
    2055 //    } while(pCmd);
    2056 //
    2057 //    return pCur;
    2058 //}
    2059 //
    2060 //void VBoxVHWAImage::vboxDoProcessVHWACommands(void *pContext)
    2061 //{
    2062 //    VBoxVHWACommandElementProcessor * pPipe = (VBoxVHWACommandElementProcessor*)pContext;
    2063 //    VBoxVHWACommandElement * pFirst = pPipe->detachCmdList(NULL, NULL);
    2064 //    do
    2065 //    {
    2066 //        VBoxVHWACommandElement * pLast = processCmdList(pFirst);
    2067 //
    2068 //        pFirst = pPipe->detachCmdList(pFirst, pLast);
    2069 //    } while(pFirst);
    2070 //}
    2071 
    20722022int VBoxVHWAImage::reset(VHWACommandList * pCmdList)
    20732023{
     
    21242074
    21252075#ifdef VBOX_WITH_VIDEOHWACCEL
    2126 //void VBoxVHWAImage::vboxDoVHWACmd(void *cmd)
    2127 //{
    2128 //    vboxDoVHWACmdExec(cmd);
    2129 //
    2130 //    CDisplay display = m_console.GetDisplay();
    2131 //    Assert (!display.isNull());
    2132 //
    2133 //    display.CompleteVHWACommand((BYTE*)cmd);
    2134 //}
    2135 //
    2136 //void VBoxVHWAImage::vboxDoVHWACmdAndFree(void *cmd)
    2137 //{
    2138 //    vboxDoVHWACmdExec(cmd);
    2139 //
    2140 //    free(cmd);
    2141 //}
    2142 //
    2143 //void VBoxVHWAImage::vboxDoVHWACmdExec(void *cmd)
    2144 //{
    2145 //    struct _VBOXVHWACMD * pCmd = (struct _VBOXVHWACMD *)cmd;
    2146 //    switch(pCmd->enmCmd)
    2147 //    {
    2148 //        case VBOXVHWACMD_TYPE_SURF_CANCREATE:
    2149 //        {
    2150 //            VBOXVHWACMD_SURF_CANCREATE * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CANCREATE);
    2151 //            pCmd->rc = vhwaSurfaceCanCreate(pBody);
    2152 //        } break;
    2153 //        case VBOXVHWACMD_TYPE_SURF_CREATE:
    2154 //        {
    2155 //            VBOXVHWACMD_SURF_CREATE * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CREATE);
    2156 //            pCmd->rc = vhwaSurfaceCreate(pBody);
    2157 //        } break;
    2158 //        case VBOXVHWACMD_TYPE_SURF_DESTROY:
    2159 //        {
    2160 //            VBOXVHWACMD_SURF_DESTROY * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_DESTROY);
    2161 //            pCmd->rc = vhwaSurfaceDestroy(pBody);
    2162 //        } break;
    2163 //        case VBOXVHWACMD_TYPE_SURF_LOCK:
    2164 //        {
    2165 //            VBOXVHWACMD_SURF_LOCK * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_LOCK);
    2166 //            pCmd->rc = vhwaSurfaceLock(pBody);
    2167 //        } break;
    2168 //        case VBOXVHWACMD_TYPE_SURF_UNLOCK:
    2169 //        {
    2170 //            VBOXVHWACMD_SURF_UNLOCK * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_UNLOCK);
    2171 //            pCmd->rc = vhwaSurfaceUnlock(pBody);
    2172 //        } break;
    2173 //        case VBOXVHWACMD_TYPE_SURF_BLT:
    2174 //        {
    2175 //            VBOXVHWACMD_SURF_BLT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_BLT);
    2176 //            pCmd->rc = vhwaSurfaceBlt(pBody);
    2177 //        } break;
    2178 //        case VBOXVHWACMD_TYPE_SURF_FLIP:
    2179 //        {
    2180 //            VBOXVHWACMD_SURF_FLIP * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_FLIP);
    2181 //            pCmd->rc = vhwaSurfaceFlip(pBody);
    2182 //        } break;
    2183 //        case VBOXVHWACMD_TYPE_SURF_OVERLAY_UPDATE:
    2184 //        {
    2185 //            VBOXVHWACMD_SURF_OVERLAY_UPDATE * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_OVERLAY_UPDATE);
    2186 //            pCmd->rc = vhwaSurfaceOverlayUpdate(pBody);
    2187 //        } break;
    2188 //        case VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION:
    2189 //        {
    2190 //            VBOXVHWACMD_SURF_OVERLAY_SETPOSITION * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_OVERLAY_SETPOSITION);
    2191 //            pCmd->rc = vhwaSurfaceOverlaySetPosition(pBody);
    2192 //        } break;
    2193 //        case VBOXVHWACMD_TYPE_SURF_COLORKEY_SET:
    2194 //        {
    2195 //            VBOXVHWACMD_SURF_COLORKEY_SET * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_COLORKEY_SET);
    2196 //            pCmd->rc = vhwaSurfaceColorkeySet(pBody);
    2197 //        } break;
    2198 //        case VBOXVHWACMD_TYPE_QUERY_INFO1:
    2199 //        {
    2200 //            VBOXVHWACMD_QUERYINFO1 * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_QUERYINFO1);
    2201 //            pCmd->rc = vhwaQueryInfo1(pBody);
    2202 //        } break;
    2203 //        case VBOXVHWACMD_TYPE_QUERY_INFO2:
    2204 //        {
    2205 //            VBOXVHWACMD_QUERYINFO2 * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_QUERYINFO2);
    2206 //            pCmd->rc = vhwaQueryInfo2(pBody);
    2207 //        } break;
    2208 //        case VBOXVHWACMD_TYPE_ENABLE:
    2209 //        case VBOXVHWACMD_TYPE_DISABLE:
    2210 //            pCmd->rc = VINF_SUCCESS;
    2211 //            break;
    2212 //        case VBOXVHWACMD_TYPE_HH_CONSTRUCT:
    2213 //        {
    2214 //            VBOXVHWACMD_HH_CONSTRUCT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_HH_CONSTRUCT);
    2215 //            pCmd->rc = vhwaConstruct(pBody);
    2216 //        } break;
    2217 //        default:
    2218 //            Assert(0);
    2219 //            pCmd->rc = VERR_NOT_IMPLEMENTED;
    2220 //            break;
    2221 //    }
    2222 //}
    2223 
    22242076int VBoxVHWAImage::vhwaSurfaceCanCreate(struct _VBOXVHWACMD_SURF_CANCREATE *pCmd)
    22252077{
     
    41864038void VBoxQGLOverlay::updateAttachment(QWidget *pViewport, QObject *pPostEventObject)
    41874039{
     4040    if (mpViewport != pViewport)
     4041    {
     4042        mpViewport = pViewport;
     4043        if (mpOverlayWgt)
     4044        {
     4045            mpOverlayWgt = NULL;
     4046            mOverlayWidgetVisible = false;
     4047            initGl();
     4048            Assert(!mOverlayVisible);
     4049//            vboxDoCheckUpdateViewport();
     4050        }
     4051        mGlCurrent = false;
     4052    }
    41884053    mCmdPipe.updatePostEventObject(pPostEventObject);
    4189     if (mpViewport != pViewport)
    4190     {
    4191         mpViewport = pViewport;
    4192         mpOverlayWgt = NULL;
    4193         mOverlayWidgetVisible = false;
    4194         initGl();
    4195         vboxDoCheckUpdateViewport();
    4196         mGlCurrent = false;
    4197     }
    41984054}
    41994055
     
    42344090        }
    42354091
    4236         VBoxVHWACommandElement *pTest = mCmdPipe.detachCmdList(pHead, pTail);
     4092        VBoxVHWACommandElement *pTest = mCmdPipe.detachCmdList(NULL, pHead, pTail);
    42374093        Assert(!pTest);
    42384094        NOREF(pTest);
     
    43034159    Assert(!mGlCurrent);
    43044160    mGlCurrent = false; /* just a fall-back */
    4305     VBoxVHWACommandElement * pFirst = mCmdPipe.detachCmdList(NULL, NULL);
     4161    bool bFirstCmd = true;
     4162    VBoxVHWACommandElement *pLast;
     4163    VBoxVHWACommandElement * pFirst = mCmdPipe.detachCmdList(&pLast, NULL, NULL);
    43064164    while(pFirst) /* pFirst can be zero right after reset when all pending commands are flushed,
    43074165                   * while events for those commands may still come along */
    43084166    {
    4309         VBoxVHWACommandElement * pLast = processCmdList(pFirst);
    4310 
    4311         pFirst = mCmdPipe.detachCmdList(pFirst, pLast);
     4167        VBoxVHWACommandElement * pLastProcessed = processCmdList(pFirst, bFirstCmd);
     4168
     4169        if (pLastProcessed == pLast)
     4170        {
     4171            pFirst = mCmdPipe.detachCmdList(&pLast, pFirst, pLastProcessed);
     4172            bFirstCmd = false;
     4173        }
     4174        else
     4175        {
     4176            mCmdPipe.putBack(pLastProcessed->mpNext, pLast, pFirst, pLastProcessed);
     4177            break;
     4178        }
    43124179    }
    43134180
     
    47734640}
    47744641
    4775 VBoxVHWACommandElement * VBoxQGLOverlay::processCmdList(VBoxVHWACommandElement * pCmd)
     4642VBoxVHWACommandElement * VBoxQGLOverlay::processCmdList(VBoxVHWACommandElement * pCmd, bool bFirst)
    47764643{
    47774644    VBoxVHWACommandElement * pCur;
     
    47984665            Assert(0);
    47994666        }
     4667
    48004668        pCmd = pCmd->mpNext;
    4801     } while(pCmd);
     4669        if (!pCmd)
     4670            break;
     4671
     4672        if (!bFirst)
     4673        {
     4674            if (pCmd->isNewEvent())
     4675                break;
     4676        }
     4677        else
     4678            bFirst = false;
     4679    } while(1);
    48024680
    48034681    return pCur;
     
    48064684
    48074685VBoxVHWACommandElementProcessor::VBoxVHWACommandElementProcessor(QObject *pParent) :
    4808     mpFirstEvent (NULL),
    4809     mpLastEvent (NULL),
    48104686    m_pParent(pParent),
    48114687    mbNewEvent (false),
     
    48354711void VBoxVHWACommandElementProcessor::postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData, uint32_t flags)
    48364712{
     4713    bool bNeedNewEvent = false;
    48374714    /* 1. lock*/
    48384715    RTCritSectEnter(&mCritSect);
     
    48514728
    48524729    if((flags & VBOXVHWACMDPIPEC_NEWEVENT) != 0)
    4853     {
    48544730        mbNewEvent = true;
    4855     }
    48564731
    48574732    /* 2. if can add to current*/
    4858     if(!mbNewEvent)
    4859     {
    4860         /* 3. if event is being processed (event != 0) */
    4861         if(mpLastEvent)
    4862         {
    4863             /* 3.a add cmd to event */
    4864             mpLastEvent->pipe().put(pCmd);
    4865             /* 3.b unlock and return */
    4866             if((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0)
    4867             {
    4868                 mbNewEvent = true;
    4869             }
    4870             RTCritSectLeave(&mCritSect);
    4871             return;
    4872         }
    4873     }
    4874 
    4875     /* we're here because the cmd was NOT be added to the current event queue */
    4876     /* 4. unlock*/
     4733    if(mbNewEvent || (!mbProcessingList && m_CmdPipe.isEmpty()))
     4734    {
     4735        pCmd->setNewEventFlag();
     4736        bNeedNewEvent = true;
     4737        mbNewEvent = false;
     4738    }
     4739
     4740    m_CmdPipe.put(pCmd);
     4741
     4742    if((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0)
     4743        mbNewEvent = true;
     4744
    48774745    RTCritSectLeave(&mCritSect);
    4878     /* 5. create & initialize new Event */
    4879     VBoxVHWACommandProcessEvent *pCurrentEvent = new VBoxVHWACommandProcessEvent(pCmd);
    4880     pCurrentEvent->mpNext = NULL;
    4881 
    4882     /* 6. lock */
    4883     RTCritSectEnter(&mCritSect);
    4884     /* 7. if no current event set event as current */
    4885     if(!mpLastEvent)
    4886     {
    4887         Assert(!mpFirstEvent);
    4888         mpFirstEvent = pCurrentEvent;
    4889         mpLastEvent = pCurrentEvent;
    4890     }
    4891     else
    4892     {
    4893         mpLastEvent->mpNext = pCurrentEvent;
    4894         mpLastEvent = pCurrentEvent;
    4895     }
    4896     /* 8. reset blocking events counter */
    4897     mbNewEvent = ((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0);
    4898     /* 9. unlock */
    4899     RTCritSectLeave(&mCritSect);
    4900     /* 10. post event */
    4901     QApplication::postEvent (m_pParent, pCurrentEvent);
    4902 }
    4903 
    4904 VBoxVHWACommandElement * VBoxVHWACommandElementProcessor::detachCmdList(VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free)
     4746
     4747    if (bNeedNewEvent)
     4748    {
     4749        VBoxVHWACommandProcessEvent *pCurrentEvent = new VBoxVHWACommandProcessEvent();
     4750        QApplication::postEvent (m_pParent, pCurrentEvent);
     4751    }
     4752}
     4753
     4754void VBoxVHWACommandElementProcessor::putBack(class VBoxVHWACommandElement * pFirst2Put, VBoxVHWACommandElement * pLast2Put,
     4755        class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free)
    49054756{
    49064757    VBoxVHWACommandElement * pList = NULL;
    49074758    RTCritSectEnter(&mCritSect);
    4908     if(pFirst2Free)
    4909     {
     4759    if (pFirst2Free)
    49104760        mFreeElements.pusha(pFirst2Free, pLast2Free);
    4911     }
    4912     if(mpFirstEvent)
    4913     {
    4914         pList = mpFirstEvent->pipe().detachList();
    4915         if(pList)
    4916         {
    4917             /* assume the caller atimically calls detachCmdList to free the elements obtained now those and reset the state */
    4918             mbProcessingList = true;
    4919             RTCritSectLeave(&mCritSect);
    4920             return pList;
    4921         }
    4922         else
    4923         {
    4924             VBoxVHWACommandProcessEvent *pNext = mpFirstEvent->mpNext;
    4925             if(pNext)
    4926             {
    4927                 mpFirstEvent = pNext;
    4928             }
    4929             else
    4930             {
    4931                 mpFirstEvent = NULL;
    4932                 mpLastEvent = NULL;
    4933             }
    4934         }
    4935     }
    4936 
    4937     /* assume the caller atimically calls detachCmdList to free the elements obtained now those and reset the state */
     4761    m_CmdPipe.prepend(pFirst2Put, pLast2Put);
    49384762    mbProcessingList = false;
    49394763    RTCritSectLeave(&mCritSect);
     4764}
     4765
     4766void VBoxVHWACommandElementProcessor::updatePostEventObject(QObject *m_pObject)
     4767{
     4768    int cEventsNeeded = 0;
     4769    const VBoxVHWACommandElement * pFirst;
     4770    RTCritSectEnter(&mCritSect);
     4771    m_pParent = m_pObject;
     4772
     4773    pFirst = m_CmdPipe.contentsRo(NULL);
     4774    for (; pFirst; pFirst = pFirst->mpNext)
     4775    {
     4776        if (pFirst->isNewEvent())
     4777            ++cEventsNeeded;
     4778    }
     4779    RTCritSectLeave(&mCritSect);
     4780
     4781    for (int i = 0; i < cEventsNeeded; ++i)
     4782    {
     4783        VBoxVHWACommandProcessEvent *pCurrentEvent = new VBoxVHWACommandProcessEvent();
     4784        QApplication::postEvent (m_pParent, pCurrentEvent);
     4785    }
     4786}
     4787
     4788VBoxVHWACommandElement * VBoxVHWACommandElementProcessor::detachCmdList(VBoxVHWACommandElement **ppLast,
     4789        VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free)
     4790{
     4791    VBoxVHWACommandElement * pList = NULL;
     4792    RTCritSectEnter(&mCritSect);
     4793    if (pFirst2Free)
     4794    {
     4795        mFreeElements.pusha(pFirst2Free, pLast2Free);
     4796    }
     4797    pList = m_CmdPipe.detachList(ppLast);
     4798    if (pList)
     4799    {
     4800        /* assume the caller atimically calls detachCmdList to free the elements obtained now those and reset the state */
     4801        mbProcessingList = true;
     4802        RTCritSectLeave(&mCritSect);
     4803        return pList;
     4804    }
     4805    else
     4806    {
     4807        mbProcessingList = false;
     4808    }
     4809
     4810    RTCritSectLeave(&mCritSect);
    49404811    return NULL;
    49414812}
     
    49444815void VBoxVHWACommandElementProcessor::reset(VBoxVHWACommandElement ** ppHead, VBoxVHWACommandElement ** ppTail)
    49454816{
    4946     VBoxVHWACommandElement * pHead = NULL;
    4947     VBoxVHWACommandElement * pTail = NULL;
    4948     VBoxVHWACommandProcessEvent * pFirst;
    4949     VBoxVHWACommandProcessEvent * pLast;
     4817    VBoxVHWACommandElementPipe pipe;
    49504818    RTCritSectEnter(&mCritSect);
    4951     pFirst = mpFirstEvent;
    4952     pLast = mpLastEvent;
    4953     mpFirstEvent = NULL;
    4954     mpLastEvent = NULL;
     4819
     4820    pipe.setFrom(&m_CmdPipe);
    49554821
    49564822    if(mbProcessingList)
     
    49624828            RTCritSectEnter(&mCritSect);
    49634829            /* it is assumed no one sends any new commands while reset is in progress */
    4964             Assert(!mpFirstEvent);
    4965             Assert(!mpLastEvent);
    49664830            if(!mbProcessingList)
    49674831            {
     
    49714835    }
    49724836
    4973     if(pFirst)
    4974     {
    4975         Assert(pLast);
    4976         VBoxVHWACommandElement * pCurHead;
    4977         for(VBoxVHWACommandProcessEvent * pCur = pFirst; pCur ; pCur = pCur->mpNext)
    4978         {
    4979             pCurHead = pCur->pipe().detachList();
    4980             if(!pCurHead)
    4981                 continue;
    4982             if(!pHead)
    4983                 pHead = pCurHead;
    4984             if(pTail)
    4985                 pTail->mpNext = pCurHead;
    4986 
    4987             for(VBoxVHWACommandElement * pCurEl = pCurHead; pCurEl; pCurEl = pCurEl->mpNext)
    4988             {
    4989                 pTail = pCurEl;
    4990             }
    4991         }
    4992 
    4993         if(!pTail)
    4994             pTail = pHead;
    4995     }
    4996 
    4997     if(pHead)
     4837    pipe.prependFrom(&m_CmdPipe);
     4838
     4839    if(!pipe.isEmpty())
     4840    {
    49984841        mbProcessingList = true;
     4842        *ppHead = pipe.detachList(ppTail);
     4843    }
    49994844
    50004845    RTCritSectLeave(&mCritSect);
    5001 
    5002     *ppHead = pHead;
    5003     *ppTail = pTail;
    5004 }
    5005 
    5006 void VBoxVHWACommandsQueue::enqueue(PFNVBOXQGLFUNC pfn, void* pContext1, void* pContext2)
    5007 {
    5008     VBoxVHWACommandElement *pCmd = new VBoxVHWACommandElement();
    5009     VBOXVHWAFUNCCALLBACKINFO info;
    5010     info.pfnCallback = pfn;
    5011     info.pContext1 = pContext1;
    5012     info.pContext2 = pContext2;
    5013     pCmd->setFunc(info);
    5014     mCmds.put(pCmd);
    5015 }
    5016 
    5017 VBoxVHWACommandElement * VBoxVHWACommandsQueue::detachList()
    5018 {
    5019     return mCmds.detachList();
    5020 }
    5021 
    5022 void VBoxVHWACommandsQueue::freeList(VBoxVHWACommandElement * pList)
    5023 {
    5024     while(pList)
    5025     {
    5026         VBoxVHWACommandElement * pCur = pList;
    5027         pList = pCur->mpNext;
    5028         delete pCur;
    5029     }
    50304846}
    50314847
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r27697 r27720  
    11651165{
    11661166public:
     1167    VBoxVHWACommandElement() :
     1168        bNewEvent(false)
     1169    {}
     1170
    11671171    void setVHWACmd(struct _VBOXVHWACMD * pCmd)
    11681172    {
     
    12021206    }
    12031207
     1208    void setNewEventFlag() {bNewEvent = true;}
     1209    bool isNewEvent() const { return bNewEvent; }
     1210
    12041211    VBOXVHWA_PIPECMD_TYPE type() const {return mType;}
    12051212    const QRect & rect() const {return mRect;}
     
    12161223    }u;
    12171224    QRect                 mRect;
     1225    bool bNewEvent;
    12181226};
    12191227
     
    12281236    void put(VBoxVHWACommandElement *pCmd)
    12291237    {
    1230         if(mpLast)
     1238        if (mpLast)
    12311239        {
    12321240            Assert(mpFirst);
     
    12441252    }
    12451253
    1246     VBoxVHWACommandElement * detachList()
    1247     {
    1248         if(mpLast)
     1254    void setFrom(VBoxVHWACommandElementPipe *pOther)
     1255    {
     1256        mpFirst = pOther->detachList(&mpLast);
     1257    }
     1258
     1259    void set(VBoxVHWACommandElement *pFirst, VBoxVHWACommandElement *pLast)
     1260    {
     1261        mpFirst = pFirst;
     1262        mpLast = pLast;
     1263        mpLast->mpNext = NULL;
     1264    }
     1265
     1266    void prepend(VBoxVHWACommandElement *pFirst, VBoxVHWACommandElement *pLast)
     1267    {
     1268        if (!mpFirst)
     1269            set(pFirst, pLast);
     1270        else if (pLast)
     1271        {
     1272            pLast->mpNext = mpFirst;
     1273            mpFirst = pFirst;
     1274        }
     1275    }
     1276
     1277    void prependFrom(VBoxVHWACommandElementPipe *pOther)
     1278    {
     1279        VBoxVHWACommandElement *pFirst;
     1280        VBoxVHWACommandElement *pLast;
     1281        pFirst = pOther->detachList(&pLast);
     1282        prepend(pFirst, pLast);
     1283    }
     1284
     1285    void append(VBoxVHWACommandElement *pFirst, VBoxVHWACommandElement *pLast)
     1286    {
     1287        if (!mpLast)
     1288            set(pFirst, pLast);
     1289        else if (pLast)
     1290        {
     1291            mpLast->mpNext = pFirst;
     1292            mpLast = pLast;
     1293        }
     1294    }
     1295
     1296    VBoxVHWACommandElement * detachList(VBoxVHWACommandElement **ppLast)
     1297    {
     1298        if (mpLast)
    12491299        {
    12501300            VBoxVHWACommandElement * pHead = mpFirst;
     1301            if (ppLast)
     1302                *ppLast = mpLast;
    12511303            mpFirst = NULL;
    12521304            mpLast = NULL;
    12531305            return pHead;
    12541306        }
     1307        if (ppLast)
     1308            *ppLast = NULL;
    12551309        return NULL;
    12561310    }
     1311
     1312    const VBoxVHWACommandElement * contentsRo (const VBoxVHWACommandElement **ppLast) const
     1313    {
     1314        if (ppLast)
     1315            *ppLast = mpLast;
     1316        return mpFirst;
     1317    }
     1318
     1319    bool isEmpty() const { return !mpLast; }
    12571320private:
    12581321    VBoxVHWACommandElement *mpFirst;
     
    13011364    void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData, uint32_t flags);
    13021365    void completeCurrentEvent();
    1303     class VBoxVHWACommandElement * detachCmdList(class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free);
     1366    class VBoxVHWACommandElement * detachCmdList(class VBoxVHWACommandElement ** ppLast,
     1367            class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free);
     1368    void putBack(class VBoxVHWACommandElement * pFirst2Put, VBoxVHWACommandElement * pLast2Put,
     1369            class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free);
    13041370    void reset(class VBoxVHWACommandElement ** ppHead, class VBoxVHWACommandElement ** ppTail);
    1305     void updatePostEventObject(QObject *m_pObject) { m_pParent = m_pObject; }
     1371    void updatePostEventObject(QObject *m_pObject);
    13061372private:
    13071373    RTCRITSECT mCritSect;
    1308     class VBoxVHWACommandProcessEvent *mpFirstEvent;
    1309     class VBoxVHWACommandProcessEvent *mpLastEvent;
     1374    VBoxVHWACommandElementPipe m_CmdPipe;
    13101375    QObject *m_pParent;
    13111376    bool mbNewEvent;
     
    13131378    VBoxVHWACommandElementStack mFreeElements;
    13141379    VBoxVHWACommandElement mElementsBuffer[2048];
    1315 };
    1316 
    1317 class VBoxVHWACommandsQueue
    1318 {
    1319 public:
    1320     void enqueue(PFNVBOXQGLFUNC pfn, void* pContext1, void* pContext2);
    1321 
    1322     VBoxVHWACommandElement * detachList();
    1323 
    1324     void freeList(VBoxVHWACommandElement * pList);
    1325 
    1326 private:
    1327     VBoxVHWACommandElementPipe mCmds;
    13281380};
    13291381
     
    14011453    int reset(VHWACommandList * pCmdList);
    14021454
    1403 //    ulong vboxBitsPerPixel() { return mDisplay.getVGA()->bitsPerPixel(); }
    1404 //    ulong vboxBytesPerLine() { return mDisplay.getVGA() ? mDisplay.getVGA()->bytesPerLine() : 0; }
    14051455    int vboxFbWidth() {return mDisplay.getVGA()->width(); }
    14061456    int vboxFbHeight() {return mDisplay.getVGA()->height(); }
     
    14451495    }
    14461496
    1447 //    VHWACommandList &onResizeCmdList() { return mOnResizeCmdList; }
    1448 
    14491497    static void pushSettingsAndSetupViewport(const QSize &display, const QRect &viewport)
    14501498    {
     
    14731521#endif
    14741522#ifdef VBOX_WITH_VIDEOHWACCEL
    1475 //    void vboxDoVHWACmdExec(void *cmd);
    1476 //    void vboxDoVHWACmdAndFree(void *cmd);
    1477 //    void vboxDoVHWACmd(void *cmd);
    14781523
    14791524    void vboxCheckUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset)
     
    15001545    VBoxVHWADisplay mDisplay;
    15011546
    1502 //    void vboxDoProcessVHWACommands(void *pContext);
    1503 
    1504 //    class VBoxVHWACommandElement * processCmdList(class VBoxVHWACommandElement * pCmd);
    1505 
    15061547    VBoxVHWASurfaceBase* handle2Surface(uint32_t h)
    15071548    {
     
    15191560    VBoxVHWASurfList *mConstructingList;
    15201561    int32_t mcRemaining2Contruct;
    1521 
    1522     /* this is used in saved state restore to postpone surface restoration
    1523      * till the framebuffer size is restored */
    1524 //    VHWACommandList mOnResizeCmdList;
    15251562
    15261563    class VBoxVHWAGlProgramMngr *mpMngr;
     
    17791816    void addMainDirtyRect (const QRect & aRect);
    17801817    void vboxCheckUpdateOverlay (const QRect & rect);
    1781     VBoxVHWACommandElement * processCmdList (VBoxVHWACommandElement * pCmd);
     1818    VBoxVHWACommandElement * processCmdList (VBoxVHWACommandElement * pCmd, bool bFirst);
    17821819
    17831820    int vhwaConstruct (struct _VBOXVHWACMD_HH_CONSTRUCT *pCmd);
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