Changeset 30588 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display
- Timestamp:
- Jul 2, 2010 6:14:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30585 r30588 3250 3250 pDevice->hWnd = hWnd; 3251 3251 bDevCreated = true; 3252 #ifdef VBOXDISP_TMP_NEWCREATEDEVICE 3253 IDirect3DSwapChain9 *pSwapChain; 3254 hr = pDevice->pDevice9If->GetSwapChain(0, &pSwapChain); 3255 Assert(hr == S_OK); 3256 if (hr == S_OK) 3257 { 3258 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0]; 3259 IDirect3DSurface9* pD3D9Surf; 3260 hr = pSwapChain->GetFrontBufferData(&pD3D9Surf); 3261 Assert(hr == S_OK); 3262 if (hr == S_OK) 3263 { 3264 Assert(pD3D9Surf); 3265 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE; 3266 pAllocation->pD3DIf = pD3D9Surf; 3267 if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM) 3268 { 3269 Assert(pAllocation->pvMem); 3270 D3DLOCKED_RECT lockInfo; 3271 hr = pD3D9Surf->LockRect(&lockInfo, NULL, D3DLOCK_DISCARD); 3272 Assert(hr == S_OK); 3273 if (hr == S_OK) 3274 { 3275 vboxWddmLockUnlockMemSynch(pAllocation, &lockInfo, NULL, true /*bool bToLockInfo*/); 3276 HRESULT tmpHr = pD3D9Surf->UnlockRect(); 3277 Assert(tmpHr == S_OK); 3278 } 3279 } 3280 else 3281 { 3282 Assert(!pAllocation->pvMem); 3283 } 3284 3285 pD3D9Surf->Release(); 3286 3287 if (hr == S_OK) 3288 { 3289 UINT i = 1; 3290 for (; i < pResource->SurfCount; ++i) 3291 { 3292 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 3293 hr = pSwapChain->GetBackBuffer(i - 1, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf); 3294 Assert(hr == S_OK); 3295 if (hr == S_OK) 3296 { 3297 Assert(pD3D9Surf); 3298 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE; 3299 pAllocation->pD3DIf = pD3D9Surf; 3300 if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM) 3301 { 3302 Assert(pAllocation->pvMem); 3303 D3DLOCKED_RECT lockInfo; 3304 hr = pD3D9Surf->LockRect(&lockInfo, NULL, D3DLOCK_DISCARD); 3305 Assert(hr == S_OK); 3306 if (hr == S_OK) 3307 { 3308 vboxWddmLockUnlockMemSynch(pAllocation, &lockInfo, NULL, true /*bool bToLockInfo*/); 3309 HRESULT tmpHr = pD3D9Surf->UnlockRect(); 3310 Assert(tmpHr == S_OK); 3311 } 3312 } 3313 else 3314 { 3315 Assert(!pAllocation->pvMem); 3316 } 3317 pD3D9Surf->Release(); 3318 } 3319 else 3320 { 3321 for (UINT j = 0; j < i; ++j) 3322 { 3323 pRc->aAllocations[j].pD3DIf->Release(); 3324 } 3325 break; 3326 } 3327 } 3328 } 3329 } 3330 } 3331 #endif 3252 3332 } 3253 3333 } 3334 #ifdef VBOXDISP_TMP_NEWCREATEDEVICE 3335 break; 3336 #endif 3254 3337 } 3255 3338 else … … 3258 3341 } 3259 3342 3343 #ifndef VBOXDISP_TMP_NEWCREATEDEVICE 3260 3344 if (hr == S_OK) 3345 #endif 3261 3346 { 3262 3347 Assert(pDevice->pDevice9If); … … 3310 3395 } 3311 3396 } 3312 3397 #ifndef VBOXDISP_TMP_NEWCREATEDEVICE 3313 3398 if (hr != S_OK) 3314 3399 { … … 3319 3404 } 3320 3405 } 3406 #endif 3321 3407 } 3322 3408 else
Note:
See TracChangeset
for help on using the changeset viewer.