int CrFbDisplayWindowRootVr::EntryCreated(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) { int rc = CrFbDisplayWindow::EntryCreated(pFb, hEntry); if (!RT_SUCCESS(rc)) { WARN(("err")); return rc; } Assert(!CrFbDDataEntryGet(hEntry, slotGet())); const VBOXVR_SCR_COMPOSITOR_ENTRY* pSrcEntry = CrFbEntryGetCompositorEntry(hEntry); VBOXVR_SCR_COMPOSITOR_ENTRY *pMyEntry = entryAlloc(); CrVrScrCompositorEntryInit(pMyEntry, CrVrScrCompositorEntryRectGet(pSrcEntry), CrVrScrCompositorEntryTexGet(pSrcEntry), NULL); CrVrScrCompositorEntryFlagsSet(pMyEntry, CrVrScrCompositorEntryFlagsGet(pSrcEntry)); rc = CrFbDDataEntryPut(hEntry, slotGet(), pMyEntry); if (!RT_SUCCESS(rc)) { WARN(("CrFbDDataEntryPut failed rc %d", rc)); entryFree(pMyEntry); return rc; } return VINF_SUCCESS; }
void entryDestroy(entry_t *node) { if (node == NULL) return; sdsdel(node->key); sdsdel(node->value); entryFree(node); }
int CrFbDisplayWindowRootVr::EntryDestroyed(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) { int rc = CrFbDisplayWindow::EntryDestroyed(pFb, hEntry); if (!RT_SUCCESS(rc)) { WARN(("err")); return rc; } const VBOXVR_SCR_COMPOSITOR_ENTRY* pSrcEntry = CrFbEntryGetCompositorEntry(hEntry); VBOXVR_SCR_COMPOSITOR_ENTRY *pMyEntry = (VBOXVR_SCR_COMPOSITOR_ENTRY*)CrFbDDataEntryGet(hEntry, slotGet()); CrVrScrCompositorEntryCleanup(pMyEntry); entryFree(pMyEntry); return VINF_SUCCESS; }