Changeset 28240 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 13, 2010 10:26:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DisplayImpl.cpp
r28235 r28240 2392 2392 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[aScreenId]; 2393 2393 2394 /* Copy the bitmap to the guest VRAM. */ 2394 2395 const uint8_t *pu8Src = address; 2395 2396 int32_t xSrc = 0; … … 2420 2421 if (RT_SUCCESS(rc)) 2421 2422 { 2422 pDisplay->handleDisplayUpdate(x + pFBInfo->xOrigin, y + pFBInfo->yOrigin, width, height); 2423 if (!pFBInfo->pFramebuffer.isNull()) 2424 { 2425 /* Update the changed screen area. When framebuffer uses VRAM directly, just notify 2426 * it to update. And for default format, render the guest VRAM to framebuffer. 2427 */ 2428 if (pFBInfo->fDefaultFormat) 2429 { 2430 BYTE *address = NULL; 2431 HRESULT hrc = pFBInfo->pFramebuffer->COMGETTER(Address) (&address); 2432 if (SUCCEEDED(hrc) && address != NULL) 2433 { 2434 const uint8_t *pu8Src = pFBInfo->pu8FramebufferVRAM; 2435 int32_t xSrc = x; 2436 int32_t ySrc = y; 2437 uint32_t u32SrcWidth = pFBInfo->w; 2438 uint32_t u32SrcHeight = pFBInfo->h; 2439 uint32_t u32SrcLineSize = pFBInfo->u32LineSize; 2440 uint32_t u32SrcBitsPerPixel = pFBInfo->u16BitsPerPixel; 2441 2442 /* Default format is 32 bpp. */ 2443 uint8_t *pu8Dst = address; 2444 int32_t xDst = xSrc; 2445 int32_t yDst = ySrc; 2446 uint32_t u32DstWidth = u32SrcWidth; 2447 uint32_t u32DstHeight = u32SrcHeight; 2448 uint32_t u32DstLineSize = u32DstWidth * 4; 2449 uint32_t u32DstBitsPerPixel = 32; 2450 2451 pDisplay->mpDrv->pUpPort->pfnCopyRect(pDisplay->mpDrv->pUpPort, 2452 width, height, 2453 pu8Src, 2454 xSrc, ySrc, 2455 u32SrcWidth, u32SrcHeight, 2456 u32SrcLineSize, u32SrcBitsPerPixel, 2457 pu8Dst, 2458 xDst, yDst, 2459 u32DstWidth, u32DstHeight, 2460 u32DstLineSize, u32DstBitsPerPixel); 2461 } 2462 } 2463 2464 pDisplay->handleDisplayUpdate(x + pFBInfo->xOrigin, y + pFBInfo->yOrigin, width, height); 2465 } 2423 2466 } 2424 2467 } … … 2500 2543 { 2501 2544 pDisplay->vbvaLock(); 2502 pDisplay->mpDrv->pUpPort->pfnUpdateDisplayAll(pDisplay->mpDrv->pUpPort); 2545 unsigned uScreenId; 2546 for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++) 2547 { 2548 if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN) 2549 { 2550 pDisplay->mpDrv->pUpPort->pfnUpdateDisplayAll(pDisplay->mpDrv->pUpPort); 2551 } 2552 else 2553 { 2554 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[uScreenId]; 2555 2556 if (!pFBInfo->pFramebuffer.isNull()) 2557 { 2558 /* Render complete VRAM screen to the framebuffer. 2559 * When framebuffer uses VRAM directly, just notify it to update. 2560 */ 2561 if (pFBInfo->fDefaultFormat) 2562 { 2563 BYTE *address = NULL; 2564 HRESULT hrc = pFBInfo->pFramebuffer->COMGETTER(Address) (&address); 2565 if (SUCCEEDED(hrc) && address != NULL) 2566 { 2567 uint32_t width = pFBInfo->w; 2568 uint32_t height = pFBInfo->h; 2569 2570 const uint8_t *pu8Src = pFBInfo->pu8FramebufferVRAM; 2571 int32_t xSrc = 0; 2572 int32_t ySrc = 0; 2573 uint32_t u32SrcWidth = pFBInfo->w; 2574 uint32_t u32SrcHeight = pFBInfo->h; 2575 uint32_t u32SrcLineSize = pFBInfo->u32LineSize; 2576 uint32_t u32SrcBitsPerPixel = pFBInfo->u16BitsPerPixel; 2577 2578 /* Default format is 32 bpp. */ 2579 uint8_t *pu8Dst = address; 2580 int32_t xDst = xSrc; 2581 int32_t yDst = ySrc; 2582 uint32_t u32DstWidth = u32SrcWidth; 2583 uint32_t u32DstHeight = u32SrcHeight; 2584 uint32_t u32DstLineSize = u32DstWidth * 4; 2585 uint32_t u32DstBitsPerPixel = 32; 2586 2587 pDisplay->mpDrv->pUpPort->pfnCopyRect(pDisplay->mpDrv->pUpPort, 2588 width, height, 2589 pu8Src, 2590 xSrc, ySrc, 2591 u32SrcWidth, u32SrcHeight, 2592 u32SrcLineSize, u32SrcBitsPerPixel, 2593 pu8Dst, 2594 xDst, yDst, 2595 u32DstWidth, u32DstHeight, 2596 u32DstLineSize, u32DstBitsPerPixel); 2597 } 2598 } 2599 2600 pDisplay->handleDisplayUpdate (pFBInfo->xOrigin, pFBInfo->yOrigin, pFBInfo->w, pFBInfo->h); 2601 } 2602 } 2603 } 2503 2604 pDisplay->vbvaUnlock(); 2504 2605 }
Note:
See TracChangeset
for help on using the changeset viewer.