Changeset 30532 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Jun 30, 2010 3:55:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r30515 r30532 309 309 PVBOXWDDM_CONTEXT pContext = pRectsInfo->pContext; 310 310 PDEVICE_EXTENSION pDevExt = pContext->pDevice->pAdapter; 311 RECT * pContextRect = &pRectsInfo->ContextsRects.ContextRect;312 311 PVBOXWDDM_RECTS_INFO pRects = &pRectsInfo->ContextsRects.UpdateRects; 313 312 NTSTATUS Status = STATUS_SUCCESS; … … 342 341 Assert(pCmd->fFlags.Value == 0); 343 342 pCmd->fFlags.bAddHiddenRects = 1; 344 if (pC ontext->pLastReportedRects)343 if (pCurContext->pLastReportedRects) 345 344 { 346 if (pC ontext->pLastReportedRects->fFlags.bSetVisibleRects)345 if (pCurContext->pLastReportedRects->fFlags.bSetVisibleRects) 347 346 { 348 347 RECT *paPrevRects; 349 348 uint32_t cPrevRects; 350 if (pC ontext->pLastReportedRects->fFlags.bSetViewRect)349 if (pCurContext->pLastReportedRects->fFlags.bSetViewRect) 351 350 { 352 paPrevRects = &pC ontext->pLastReportedRects->RectsInfo.aRects[1];353 cPrevRects = pC ontext->pLastReportedRects->RectsInfo.cRects - 1;351 paPrevRects = &pCurContext->pLastReportedRects->RectsInfo.aRects[1]; 352 cPrevRects = pCurContext->pLastReportedRects->RectsInfo.cRects - 1; 354 353 } 355 354 else 356 355 { 357 paPrevRects = &pC ontext->pLastReportedRects->RectsInfo.aRects[0];358 cPrevRects = pC ontext->pLastReportedRects->RectsInfo.cRects;356 paPrevRects = &pCurContext->pLastReportedRects->RectsInfo.aRects[0]; 357 cPrevRects = pCurContext->pLastReportedRects->RectsInfo.cRects; 359 358 } 360 359 … … 366 365 else 367 366 { 368 Assert(pC ontext->pLastReportedRects->fFlags.bAddHiddenRects);369 if (!vboxVdmaDirtyRectsIsCover(pC ontext->pLastReportedRects->RectsInfo.aRects,370 pC ontext->pLastReportedRects->RectsInfo.cRects,367 Assert(pCurContext->pLastReportedRects->fFlags.bAddHiddenRects); 368 if (!vboxVdmaDirtyRectsIsCover(pCurContext->pLastReportedRects->RectsInfo.aRects, 369 pCurContext->pLastReportedRects->RectsInfo.cRects, 371 370 pCmd->RectsInfo.aRects, pCmd->RectsInfo.cRects)) 372 371 { … … 380 379 if (bSend) 381 380 { 382 if (pC ontext->pLastReportedRects)383 vboxVideoCmCmdRelease(pC ontext->pLastReportedRects);381 if (pCurContext->pLastReportedRects) 382 vboxVideoCmCmdRelease(pCurContext->pLastReportedRects); 384 383 vboxVideoCmCmdRetain(pCmd); 385 pC ontext->pLastReportedRects = pCmd;384 pCurContext->pLastReportedRects = pCmd; 386 385 vboxVideoCmCmdSubmit(pCmd, VBOXVIDEOCM_CMD_RECTS_SIZE4CRECTS(pCmd->RectsInfo.cRects)); 387 386 pCmd = NULL; … … 391 390 else 392 391 { 392 RECT * pContextRect = &pRectsInfo->ContextsRects.ContextRect; 393 393 bool bRectShanged = (pContext->ViewRect.left != pContextRect->left 394 394 || pContext->ViewRect.top != pContextRect->top … … 396 396 || pContext->ViewRect.bottom != pContextRect->bottom); 397 397 PVBOXVIDEOCM_CMD_RECTS pDrCmd; 398 399 bool bSend = false; 398 400 399 401 if (bRectShanged) … … 407 409 break; 408 410 } 411 pDrCmd->fFlags.Value = 0; 409 412 pDrCmd->RectsInfo.cRects = pRects->cRects + 1; 413 pDrCmd->fFlags.bSetViewRect = 1; 414 pDrCmd->RectsInfo.aRects[0] = *pContextRect; 415 pContext->ViewRect = *pContextRect; 416 memcpy(&pDrCmd->RectsInfo.aRects[1], pRects->aRects, sizeof (RECT) * pRects->cRects); 417 bSend = true; 410 418 } 411 419 else … … 426 434 } 427 435 } 436 pDrCmd->fFlags.Value = 0; 428 437 pDrCmd->RectsInfo.cRects = pRects->cRects; 429 } 430 431 Assert(pDrCmd->fFlags.Value == 0); 432 RECT *pDirtyRect; 433 bool bSend = false; 434 if (bRectShanged) 435 { 436 pDrCmd->fFlags.bSetViewRect = 1; 437 pDrCmd->RectsInfo.aRects[0] = *pContextRect; 438 pDirtyRect = &pDrCmd->RectsInfo.aRects[1]; 439 pContext->ViewRect = *pContextRect; 440 bSend = true; 441 } 442 else 443 { 444 pDirtyRect = pDrCmd->RectsInfo.aRects; 438 memcpy(&pDrCmd->RectsInfo.aRects[0], pRects->aRects, sizeof (RECT) * pRects->cRects); 445 439 446 440 if (pContext->pLastReportedRects) … … 460 454 cRects = pContext->pLastReportedRects->RectsInfo.cRects; 461 455 } 462 bSend = (pDrCmd->RectsInfo.cRects == cRects)463 && !memcmp(paRects, pDrCmd->RectsInfo.aRects, cRects * sizeof (RECT));456 bSend = (pDrCmd->RectsInfo.cRects != cRects) 457 || memcmp(paRects, pDrCmd->RectsInfo.aRects, cRects * sizeof (RECT)); 464 458 } 465 459 else … … 481 475 482 476 pDrCmd->fFlags.bSetVisibleRects = 1; 483 memcpy (pDirtyRect, pRects->aRects, sizeof (RECT) * pRects->cRects);484 477 485 478 vboxVideoCmCmdRetain(pDrCmd);
Note:
See TracChangeset
for help on using the changeset viewer.