Changeset 54100 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 6, 2015 3:00:48 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 98066
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r53964 r54100 1906 1906 } 1907 1907 1908 void resizeEvent(int iWidth, int iHeight)1909 { 1910 UIFrameBuffer:: resizeEvent(iWidth, iHeight);1908 void performResize(int iWidth, int iHeight) 1909 { 1910 UIFrameBuffer::performResize(iWidth, iHeight); 1911 1911 mOverlay.onResizeEventPostprocess(VBoxFBSizeInfo(this), 1912 1912 QPoint(mpView->contentsX(), mpView->contentsY())); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r53964 r54100 93 93 94 94 /* Resize frame-buffer to default size: */ 95 resizeEvent(640, 480);95 performResize(640, 480); 96 96 97 97 #ifdef Q_OS_WIN … … 571 571 } 572 572 573 void UIFrameBuffer:: notifyChange(int iWidth, int iHeight)574 { 575 LogRel(("UIFrameBuffer:: notifyChange: Size=%dx%d\n", iWidth, iHeight));573 void UIFrameBuffer::handleNotifyChange(int iWidth, int iHeight) 574 { 575 LogRel(("UIFrameBuffer::handleNotifyChange: Size=%dx%d\n", iWidth, iHeight)); 576 576 577 577 /* Make sure machine-view is assigned: */ … … 585 585 { 586 586 /* Do nothing, change-event already processed: */ 587 LogRel2(("UIFrameBuffer:: notifyChange: Already processed.\n"));587 LogRel2(("UIFrameBuffer::handleNotifyChange: Already processed.\n")); 588 588 /* Unlock access to frame-buffer: */ 589 589 unlock(); … … 600 600 601 601 /* Perform frame-buffer resize: */ 602 resizeEvent(iWidth, iHeight); 603 } 604 605 void UIFrameBuffer::resizeEvent(int iWidth, int iHeight) 606 { 607 LogRel(("UIFrameBuffer::resizeEvent: Size=%dx%d\n", iWidth, iHeight)); 602 performResize(iWidth, iHeight); 603 } 604 605 void UIFrameBuffer::handlePaintEvent(QPaintEvent *pEvent) 606 { 607 LogRel2(("UIFrameBuffer::handlePaintEvent: Origin=%lux%lu, Size=%dx%d\n", 608 pEvent->rect().x(), pEvent->rect().y(), 609 pEvent->rect().width(), pEvent->rect().height())); 610 611 /* On mode switch the enqueued paint-event may still come 612 * while the machine-view is already null (before the new machine-view set), 613 * ignore paint-event in that case. */ 614 if (!m_pMachineView) 615 return; 616 617 /* Lock access to frame-buffer: */ 618 lock(); 619 620 /* But if updates disabled: */ 621 if (!m_fUpdatesAllowed) 622 { 623 /* Unlock access to frame-buffer: */ 624 unlock(); 625 /* And return immediately: */ 626 return; 627 } 628 629 /* Depending on visual-state type: */ 630 switch (m_pMachineView->machineLogic()->visualStateType()) 631 { 632 case UIVisualStateType_Seamless: 633 paintSeamless(pEvent); 634 break; 635 default: 636 paintDefault(pEvent); 637 break; 638 } 639 640 /* Unlock access to frame-buffer: */ 641 unlock(); 642 } 643 644 void UIFrameBuffer::handleSetVisibleRegion(const QRegion ®ion) 645 { 646 /* Make sure async visible-region has changed: */ 647 if (m_asyncVisibleRegion == region) 648 return; 649 650 /* We are accounting async visible-regions one-by-one 651 * to keep corresponding viewport area always updated! */ 652 if (!m_asyncVisibleRegion.isEmpty()) 653 m_pMachineView->viewport()->update(m_asyncVisibleRegion - region); 654 655 /* Remember last visible region: */ 656 m_asyncVisibleRegion = region; 657 658 #ifdef VBOX_WITH_MASKED_SEAMLESS 659 /* We have to use async visible-region to apply to [Q]Widget [set]Mask: */ 660 m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion); 661 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 662 } 663 664 void UIFrameBuffer::performResize(int iWidth, int iHeight) 665 { 666 LogRel(("UIFrameBuffer::performResize: Size=%dx%d\n", iWidth, iHeight)); 608 667 609 668 /* Make sure machine-view is assigned: */ … … 623 682 if (m_sourceBitmap.isNull()) 624 683 { 625 LogRel(("UIFrameBuffer:: resizeEvent: "684 LogRel(("UIFrameBuffer::performResize: " 626 685 "Using FALLBACK buffer due to source-bitmap is not provided..\n")); 627 686 … … 637 696 else 638 697 { 639 LogRel(("UIFrameBuffer:: resizeEvent: "698 LogRel(("UIFrameBuffer::performResize: " 640 699 "Directly using source-bitmap content\n")); 641 700 … … 667 726 LONG yOrigin = 0; 668 727 KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled; 669 CDisplay display = m_pMachineView->uisession()-> session().GetConsole().GetDisplay();728 CDisplay display = m_pMachineView->uisession()->display(); 670 729 display.GetScreenResolution(m_pMachineView->screenId(), 671 730 ulWidth, ulHeight, ulGuestBitsPerPixel, xOrigin, yOrigin, monitorStatus); … … 695 754 696 755 /* And send async-signal to update asynchronous one: */ 697 LogRel2(("UIFrameBuffer:: resizeEvent: Rectangle count=%lu, Sending to async-handler\n",756 LogRel2(("UIFrameBuffer::performResize: Rectangle count=%lu, Sending to async-handler\n", 698 757 (unsigned long)m_syncVisibleRegion.rectCount())); 699 758 emit sigSetVisibleRegion(m_syncVisibleRegion); … … 705 764 if (m_pMachineView->machineLogic()->visualStateType() != UIVisualStateType_Scale) 706 765 setScaledSize(scaleFactor() == 1.0 ? QSize() : QSize((int)(m_iWidth * scaleFactor()), (int)(m_iHeight * scaleFactor()))); 707 }708 709 void UIFrameBuffer::paintEvent(QPaintEvent *pEvent)710 {711 LogRel2(("UIFrameBuffer::paintEvent: Origin=%lux%lu, Size=%dx%d\n",712 pEvent->rect().x(), pEvent->rect().y(),713 pEvent->rect().width(), pEvent->rect().height()));714 715 /* On mode switch the enqueued paint-event may still come716 * while the machine-view is already null (before the new machine-view set),717 * ignore paint-event in that case. */718 if (!m_pMachineView)719 return;720 721 /* Lock access to frame-buffer: */722 lock();723 724 /* But if updates disabled: */725 if (!m_fUpdatesAllowed)726 {727 /* Unlock access to frame-buffer: */728 unlock();729 /* And return immediately: */730 return;731 }732 733 /* Depending on visual-state type: */734 switch (m_pMachineView->machineLogic()->visualStateType())735 {736 case UIVisualStateType_Seamless:737 paintSeamless(pEvent);738 break;739 default:740 paintDefault(pEvent);741 break;742 }743 744 /* Unlock access to frame-buffer: */745 unlock();746 }747 748 void UIFrameBuffer::applyVisibleRegion(const QRegion ®ion)749 {750 /* Make sure async visible-region has changed: */751 if (m_asyncVisibleRegion == region)752 return;753 754 /* We are accounting async visible-regions one-by-one755 * to keep corresponding viewport area always updated! */756 if (!m_asyncVisibleRegion.isEmpty())757 m_pMachineView->viewport()->update(m_asyncVisibleRegion - region);758 759 /* Remember last visible region: */760 m_asyncVisibleRegion = region;761 762 #ifdef VBOX_WITH_MASKED_SEAMLESS763 /* We have to use async visible-region to apply to [Q]Widget [set]Mask: */764 m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion);765 #endif /* VBOX_WITH_MASKED_SEAMLESS */766 766 } 767 767 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r53964 r54100 200 200 201 201 /** Handles frame-buffer notify-change-event. */ 202 virtual void notifyChange(int iWidth, int iHeight); 203 /** Handles frame-buffer resize-event. */ 204 virtual void resizeEvent(int iWidth, int iHeight); 202 virtual void handleNotifyChange(int iWidth, int iHeight); 205 203 /** Handles frame-buffer paint-event. */ 206 virtual void paintEvent(QPaintEvent *pEvent); 207 /** Handles frame-buffer apply-visible-region-event. */ 208 virtual void applyVisibleRegion(const QRegion ®ion); 204 virtual void handlePaintEvent(QPaintEvent *pEvent); 205 /** Handles frame-buffer set-visible-region-event. */ 206 virtual void handleSetVisibleRegion(const QRegion ®ion); 207 208 /** Performs frame-buffer resizing. */ 209 virtual void performResize(int iWidth, int iHeight); 209 210 210 211 #ifdef VBOX_WITH_VIDEOHWACCEL -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r54082 r54100 218 218 void UIMachineView::sltHandleNotifyChange(int iWidth, int iHeight) 219 219 { 220 LogRel Flow(("UIMachineView::HandleNotifyChange: Screen=%d, Size=%dx%d.\n",221 220 LogRel(("UIMachineView::sltHandleNotifyChange: Screen=%d, Size=%dx%d.\n", 221 (unsigned long)m_uScreenId, iWidth, iHeight)); 222 222 223 223 // TODO: Move to appropriate place! … … 242 242 243 243 /* Perform frame-buffer mode-change: */ 244 frameBuffer()-> notifyChange(iWidth, iHeight);244 frameBuffer()->handleNotifyChange(iWidth, iHeight); 245 245 246 246 /* Scale-mode doesn't need this.. */ … … 281 281 display().InvalidateAndUpdateScreen(m_uScreenId); 282 282 283 LogRelFlow(("UIMachineView:: ResizeHandled:Screen=%d, Size=%dx%d.\n",283 LogRelFlow(("UIMachineView::sltHandleNotifyChange: Complete for Screen=%d, Size=%dx%d.\n", 284 284 (unsigned long)m_uScreenId, iWidth, iHeight)); 285 285 } … … 364 364 /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */ 365 365 sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height()); 366 frameBuffer()-> resizeEvent(frameBuffer()->width(), frameBuffer()->height());366 frameBuffer()->performResize(frameBuffer()->width(), frameBuffer()->height()); 367 367 machineWindow()->normalizeGeometry(true /* adjust position */); 368 368 adjustGuestScreenSize(); … … 385 385 /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */ 386 386 sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height()); 387 frameBuffer()-> resizeEvent(frameBuffer()->width(), frameBuffer()->height());387 frameBuffer()->performResize(frameBuffer()->width(), frameBuffer()->height()); 388 388 machineWindow()->normalizeGeometry(true /* adjust position */); 389 389 adjustGuestScreenSize(); … … 600 600 /* If we have a valid size, resize the framebuffer. */ 601 601 if (size.width() > 0 && size.height() > 0) 602 frameBuffer()-> resizeEvent(size.width(), size.height());602 frameBuffer()->performResize(size.width(), size.height()); 603 603 } 604 604 } … … 1280 1280 /* Delegate the paint function to the UIFrameBuffer interface: */ 1281 1281 if (m_pFrameBuffer) 1282 m_pFrameBuffer-> paintEvent(pPaintEvent);1282 m_pFrameBuffer->handlePaintEvent(pPaintEvent); 1283 1283 #ifdef Q_WS_MAC 1284 1284 /* Update the dock icon if we are in the running state: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r53912 r54100 85 85 { 86 86 /* Apply new seamless-region: */ 87 m_pFrameBuffer-> applyVisibleRegion(region);87 m_pFrameBuffer->handleSetVisibleRegion(region); 88 88 } 89 89
Note:
See TracChangeset
for help on using the changeset viewer.