Changeset 40309 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Mar 1, 2012 9:56:01 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r39981 r40309 1653 1653 #define PVBOXWDDMVR_REG_FROM_ENTRY(_pEntry) ((PVBOXWDDMVR_REG)(((uint8_t*)(_pEntry)) - RT_OFFSETOF(VBOXWDDMVR_REG, ListEntry))) 1654 1654 1655 #ifdef DEBUG_misha 1656 # define VBOXVDBG_VR_LAL_DISABLE 1657 #endif 1658 1659 #ifndef VBOXVDBG_VR_LAL_DISABLE 1655 1660 static LOOKASIDE_LIST_EX g_VBoxWddmVrLookasideList; 1661 #endif 1656 1662 1657 1663 static PVBOXWDDMVR_REG vboxWddmVrRegCreate() 1658 1664 { 1665 #ifndef VBOXVDBG_VR_LAL_DISABLE 1659 1666 PVBOXWDDMVR_REG pReg = (PVBOXWDDMVR_REG)ExAllocateFromLookasideListEx(&g_VBoxWddmVrLookasideList); 1660 1667 if (!pReg) … … 1663 1670 } 1664 1671 return pReg; 1672 #else 1673 return (PVBOXWDDMVR_REG)vboxWddmMemAlloc(sizeof (VBOXWDDMVR_REG)); 1674 #endif 1665 1675 } 1666 1676 1667 1677 static void vboxWddmVrRegTerm(PVBOXWDDMVR_REG pReg) 1668 1678 { 1679 #ifndef VBOXVDBG_VR_LAL_DISABLE 1669 1680 ExFreeToLookasideListEx(&g_VBoxWddmVrLookasideList, pReg); 1681 #else 1682 vboxWddmMemFree(pReg); 1683 #endif 1670 1684 } 1671 1685 … … 1686 1700 NTSTATUS VBoxWddmVrInit() 1687 1701 { 1702 #ifndef VBOXVDBG_VR_LAL_DISABLE 1688 1703 NTSTATUS Status = ExInitializeLookasideListEx(&g_VBoxWddmVrLookasideList, 1689 1704 NULL, /* PALLOCATE_FUNCTION_EX Allocate */ … … 1700 1715 return Status; 1701 1716 } 1717 #endif 1718 1702 1719 return STATUS_SUCCESS; 1703 1720 } … … 1705 1722 void VBoxWddmVrTerm() 1706 1723 { 1724 #ifndef VBOXVDBG_VR_LAL_DISABLE 1707 1725 ExDeleteLookasideListEx(&g_VBoxWddmVrLookasideList); 1726 #endif 1708 1727 } 1709 1728 … … 1890 1909 typedef FNVBOXWDDMVR_CB_INTERSECTED_VISITOR *PFNVBOXWDDMVR_CB_INTERSECTED_VISITOR; 1891 1910 1892 static void vboxWddmVrListVisitIntersected(PVBOXWDDMVR_LIST pList1, UINT cRects, const RECT *aRects, BOOLEAN fRectsNonintersectedOrdered,PFNVBOXWDDMVR_CB_INTERSECTED_VISITOR pfnVisitor, void* pvVisitor)1911 static void vboxWddmVrListVisitIntersected(PVBOXWDDMVR_LIST pList1, UINT cRects, const RECT *aRects, PFNVBOXWDDMVR_CB_INTERSECTED_VISITOR pfnVisitor, void* pvVisitor) 1893 1912 { 1894 1913 PLIST_ENTRY pEntry1 = pList1->ListHead.Flink; … … 1904 1923 const RECT *pRect2 = &aRects[i]; 1905 1924 if (pReg1->Rect.bottom <= pRect2->top) 1906 { 1907 if (fRectsNonintersectedOrdered) 1908 break; /* the forthcomming rects won't intersect as well since they have at least not bigget top */ 1909 else 1910 continue; /* no assumptions, just continue */ 1911 } 1925 continue; 1912 1926 else if (pRect2->bottom <= pReg1->Rect.top) 1913 {1914 if (fRectsNonintersectedOrdered)1915 {1916 iFirst2 = i + 1; /* the previous rects including this one have top < pRect2->bottom,1917 * while the forhtcoming pRegs will have top >= pReg1->Rect.top1918 * so we can start with the next rect next time */1919 }1920 1927 continue; 1921 }1922 1928 /* y coords intersect */ 1923 1929 else if (pReg1->Rect.right <= pRect2->left) … … 2112 2118 } 2113 2119 2114 static NTSTATUS vboxWddmVrListSubstNoJoin(PVBOXWDDMVR_LIST pList, UINT cRects, const PRECT aRects, BOOLEAN fRectsNonintersectedOrdered, BOOLEAN*pfChanged)2120 static NTSTATUS vboxWddmVrListSubstNoJoin(PVBOXWDDMVR_LIST pList, UINT cRects, const PRECT aRects, BOOLEAN *pfChanged) 2115 2121 { 2116 2122 if (VBoxWddmVrListIsEmpty(pList)) … … 2123 2129 *pfChanged = FALSE; 2124 2130 2125 vboxWddmVrListVisitIntersected(pList, cRects, aRects, fRectsNonintersectedOrdered,vboxWddmVrListSubstNoJoinCb, &Data);2131 vboxWddmVrListVisitIntersected(pList, cRects, aRects, vboxWddmVrListSubstNoJoinCb, &Data); 2126 2132 if (!NT_SUCCESS(Data.Status)) 2127 2133 { … … 2217 2223 #endif 2218 2224 2219 NTSTATUS Status = vboxWddmVrListSubstNoJoin(pList, cRects, aRects, 2220 FALSE, /* rects can be of any type, i.e. can intersect and can NOT be ordered */ 2221 pfChanged); 2225 NTSTATUS Status = vboxWddmVrListSubstNoJoin(pList, cRects, aRects, pfChanged); 2222 2226 if (!NT_SUCCESS(Status)) 2223 2227 { … … 2337 2341 2338 2342 BOOLEAN fDummyChanged = FALSE; 2339 Status = vboxWddmVrListSubstNoJoin(&DiffList, cListRects, pListRects, TRUE,&fDummyChanged);2343 Status = vboxWddmVrListSubstNoJoin(&DiffList, cListRects, pListRects, &fDummyChanged); 2340 2344 if (!NT_SUCCESS(Status)) 2341 2345 {
Note:
See TracChangeset
for help on using the changeset viewer.