- Timestamp:
- Jan 30, 2014 7:57:02 AM (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
r50277 r50280 414 414 void CrPMgrTerm(); 415 415 416 typedef DECLCALLBACKPTR(bool, PFNCR_FRAMEBUFFER_ENTRIES_VISITOR_CB)(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext); 417 418 void CrFbVisitCreatedEntries(HCR_FRAMEBUFFER hFb, PFNCR_FRAMEBUFFER_ENTRIES_VISITOR_CB pfnVisitorCb, void *pvContext); 416 419 int CrFbResize(HCR_FRAMEBUFFER hFb, const struct VBVAINFOSCREEN * pScreen, void *pvVRAM); 417 420 bool CrFbIsEnabled(HCR_FRAMEBUFFER hFb); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r50276 r50280 807 807 } 808 808 809 void CrFbVisitCreatedEntries(HCR_FRAMEBUFFER hFb, PFNCR_FRAMEBUFFER_ENTRIES_VISITOR_CB pfnVisitorCb, void *pvContext) 810 { 811 HCR_FRAMEBUFFER_ENTRY hEntry, hNext; 812 RTListForEachSafe(&hFb->EntriesList, hEntry, hNext, CR_FRAMEBUFFER_ENTRY, Node) 813 { 814 if (hEntry->Flags.fCreateNotified) 815 { 816 if (!pfnVisitorCb(hFb, hEntry, pvContext)) 817 return; 818 } 819 } 820 } 821 822 809 823 CRHTABLE_HANDLE CrFbDDataAllocSlot(CR_FRAMEBUFFER *pFb) 810 824 { … … 815 829 { 816 830 HCR_FRAMEBUFFER_ENTRY hEntry, hNext; 817 RTListForEachSafe Cpp(&pFb->EntriesList, hEntry, hNext, CR_FRAMEBUFFER_ENTRY, Node)831 RTListForEachSafe(&pFb->EntriesList, hEntry, hNext, CR_FRAMEBUFFER_ENTRY, Node) 818 832 { 819 833 if (CrFbDDataEntryGet(hEntry, hSlot)) 820 834 { 821 pfnReleaseCb(pFb, hEntry, pvContext); 835 if (pfnReleaseCb) 836 pfnReleaseCb(pFb, hEntry, pvContext); 837 822 838 CrFbDDataEntryClear(hEntry, hSlot); 823 839 } … … 1070 1086 } 1071 1087 1088 static DECLCALLBACK(bool) entriesCreateCb(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext) 1089 { 1090 int rc = ((ICrFbDisplay*)(pvContext))->EntryCreated(hFb, hEntry); 1091 if (!RT_SUCCESS(rc)) 1092 { 1093 WARN(("err")); 1094 } 1095 return true; 1096 } 1097 1098 static DECLCALLBACK(bool) entriesDestroyCb(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext) 1099 { 1100 int rc = ((ICrFbDisplay*)(pvContext))->EntryDestroyed(hFb, hEntry); 1101 if (!RT_SUCCESS(rc)) 1102 { 1103 WARN(("err")); 1104 } 1105 return true; 1106 } 1107 1072 1108 int fbSynchAddAllEntries() 1073 1109 { … … 1079 1115 int rc = VINF_SUCCESS; 1080 1116 1117 CrFbVisitCreatedEntries(mpFb, entriesCreateCb, this); 1118 1081 1119 while ((pEntry = CrVrScrCompositorConstIterNext(&Iter)) != NULL) 1082 1120 { 1083 1121 HCR_FRAMEBUFFER_ENTRY hEntry = CrFbEntryFromCompositorEntry(pEntry); 1084 rc = EntryCreated(mpFb, hEntry);1085 if (!RT_SUCCESS(rc))1086 {1087 WARN(("err"));1088 break;1089 }1090 1122 1091 1123 rc = EntryAdded(mpFb, hEntry); … … 1101 1133 } 1102 1134 1103 int fbCleanupRemoveAllEntries( bool fNotifyDestroy)1135 int fbCleanupRemoveAllEntries() 1104 1136 { 1105 1137 VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR Iter; … … 1120 1152 } 1121 1153 1122 if (fNotifyDestroy) 1123 { 1124 rc = EntryDestroyed(mpFb, hEntry); 1125 if (!RT_SUCCESS(rc)) 1126 { 1127 WARN(("err")); 1128 break; 1129 } 1130 } 1154 CrFbVisitCreatedEntries(mpFb, entriesDestroyCb, this); 1131 1155 } 1132 1156 … … 1145 1169 static DECLCALLBACK(void) slotEntryReleaseCB(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext) 1146 1170 { 1147 ((ICrFbDisplay*)pvContext)->EntryDestroyed(hFb, hEntry);1148 1171 } 1149 1172 … … 2477 2500 virtual int clearCompositor() 2478 2501 { 2479 return fbCleanupRemoveAllEntries( false);2502 return fbCleanupRemoveAllEntries(); 2480 2503 } 2481 2504 … … 2682 2705 virtual int fbCleanup() 2683 2706 { 2684 int rc = fbCleanupRemoveAllEntries( false);2707 int rc = fbCleanupRemoveAllEntries(); 2685 2708 if (!RT_SUCCESS(rc)) 2686 2709 {
Note:
See TracChangeset
for help on using the changeset viewer.