Changeset 50276 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jan 29, 2014 7:36:53 PM (11 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r50217 r50276 438 438 439 439 CRHTABLE_HANDLE CrFbDDataAllocSlot(HCR_FRAMEBUFFER hFb); 440 void CrFbDDataReleaseSlot(HCR_FRAMEBUFFER hFb, CRHTABLE_HANDLE hSlot); 440 441 typedef DECLCALLBACKPTR(void, PFNCR_FRAMEBUFFER_SLOT_RELEASE_CB)(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext); 442 443 void CrFbDDataReleaseSlot(HCR_FRAMEBUFFER hFb, CRHTABLE_HANDLE hSlot, PFNCR_FRAMEBUFFER_SLOT_RELEASE_CB pfnReleaseCb, void *pvContext); 441 444 int CrFbDDataEntryPut(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot, void *pvData); 445 void* CrFbDDataEntryClear(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot); 442 446 void* CrFbDDataEntryGet(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot); 443 447 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r50258 r50276 78 78 void *pvVram; 79 79 ICrFbDisplay *pDisplay; 80 RTLISTNODE EntriesList; 81 uint32_t cEntries; /* <- just for debugging */ 82 uint32_t cUpdating; 80 83 CRHTABLE SlotTable; 81 uint32_t cUpdating;82 84 } CR_FRAMEBUFFER; 83 85 … … 120 122 pFb->ScreenInfo.u32ViewIndex = idScreen; 121 123 CrVrScrCompositorInit(&pFb->Compositor, &Rect); 124 RTListInit(&pFb->EntriesList); 122 125 CrHTableCreate(&pFb->SlotTable, 0); 123 126 } … … 226 229 CrVrScrCompositorClear(&pFb->Compositor); 227 230 CrHTableDestroy(&pFb->SlotTable); 231 232 Assert(RTListIsEmpty(&pFb->EntriesList)); 233 Assert(!pFb->cEntries); 234 228 235 memset(pFb, 0, sizeof (*pFb)); 229 236 … … 266 273 { 267 274 VBOXVR_SCR_COMPOSITOR_ENTRY Entry; 275 RTLISTNODE Node; 268 276 uint32_t cRefs; 269 277 CR_FBENTRY_FLAGS Flags; … … 464 472 CrVrScrCompositorEntryCleanup(&pEntry->Entry); 465 473 CrHTableDestroy(&pEntry->HTable); 474 Assert(pFb->cEntries); 475 RTListNodeRemove(&pEntry->Node); 476 --pFb->cEntries; 466 477 crFbEntryFree(pEntry); 467 478 } … … 531 542 pEntry->Flags.Value = 0; 532 543 CrHTableCreate(&pEntry->HTable, 0); 544 545 RTListAppend(&pFb->EntriesList, &pEntry->Node); 546 ++pFb->cEntries; 533 547 534 548 return pEntry; … … 798 812 } 799 813 800 void CrFbDDataReleaseSlot(CR_FRAMEBUFFER *pFb, CRHTABLE_HANDLE hSlot) 801 { 814 void CrFbDDataReleaseSlot(CR_FRAMEBUFFER *pFb, CRHTABLE_HANDLE hSlot, PFNCR_FRAMEBUFFER_SLOT_RELEASE_CB pfnReleaseCb, void *pvContext) 815 { 816 HCR_FRAMEBUFFER_ENTRY hEntry, hNext; 817 RTListForEachSafeCpp(&pFb->EntriesList, hEntry, hNext, CR_FRAMEBUFFER_ENTRY, Node) 818 { 819 if (CrFbDDataEntryGet(hEntry, hSlot)) 820 { 821 pfnReleaseCb(pFb, hEntry, pvContext); 822 CrFbDDataEntryClear(hEntry, hSlot); 823 } 824 } 825 802 826 CrHTableRemove(&pFb->SlotTable, hSlot); 803 827 } … … 806 830 { 807 831 return CrHTablePutToSlot(&hEntry->HTable, hSlot, pvData); 832 } 833 834 void* CrFbDDataEntryClear(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot) 835 { 836 return CrHTableRemove(&hEntry->HTable, hSlot); 808 837 } 809 838 … … 1114 1143 } 1115 1144 1145 static DECLCALLBACK(void) slotEntryReleaseCB(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext) 1146 { 1147 ((ICrFbDisplay*)pvContext)->EntryDestroyed(hFb, hEntry); 1148 } 1149 1150 virtual void slotRelease() 1151 { 1152 Assert(mhSlot); 1153 CrFbDDataReleaseSlot(mpFb, mhSlot, slotEntryReleaseCB, this); 1154 } 1155 1116 1156 virtual int fbCleanup() 1117 1157 { 1118 1158 if (mhSlot) 1119 1159 { 1120 CrFbDDataReleaseSlot(mpFb, mhSlot);1160 slotRelease(); 1121 1161 mhSlot = 0; 1122 1162 } … … 2437 2477 virtual int clearCompositor() 2438 2478 { 2439 return fbCleanupRemoveAllEntries( true);2479 return fbCleanupRemoveAllEntries(false); 2440 2480 } 2441 2481 … … 2642 2682 virtual int fbCleanup() 2643 2683 { 2644 int rc = fbCleanupRemoveAllEntries( true);2684 int rc = fbCleanupRemoveAllEntries(false); 2645 2685 if (!RT_SUCCESS(rc)) 2646 2686 {
Note:
See TracChangeset
for help on using the changeset viewer.