Changeset 27758 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 26, 2010 6:51:00 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r27757 r27758 1429 1429 public: 1430 1430 VBoxFBSizeInfo() {} 1431 template<class T> VBoxFBSizeInfo(T * e) : 1432 mPixelFormat(e->pixelFormat()), mVRAM(e->VRAM()), mBitsPerPixel(e->bitsPerPixel()), 1433 mBytesPerLine(e->bytesPerLine()), mWidth(e->width()), mHeight(e->height()) {} 1431 template<class T> VBoxFBSizeInfo(T * fb) : 1432 mPixelFormat(fb->pixelFormat()), mVRAM(fb->address()), mBitsPerPixel(fb->bitsPerPixel()), 1433 mBytesPerLine(fb->bytesPerLine()), mWidth(fb->width()), mHeight(fb->height()), 1434 mUsesGuestVram(fb->usesGuestVRAM()) {} 1434 1435 1435 1436 VBoxFBSizeInfo(ulong aPixelFormat, uchar *aVRAM, 1436 1437 ulong aBitsPerPixel, ulong aBytesPerLine, 1437 ulong aWidth, ulong aHeight) : 1438 ulong aWidth, ulong aHeight, 1439 bool bUsesGuestVram) : 1438 1440 mPixelFormat (aPixelFormat), mVRAM (aVRAM), mBitsPerPixel (aBitsPerPixel), 1439 mBytesPerLine (aBytesPerLine), mWidth (aWidth), mHeight (aHeight) {} 1441 mBytesPerLine (aBytesPerLine), mWidth (aWidth), mHeight (aHeight), 1442 mUsesGuestVram(bUsesGuestVram) {} 1440 1443 ulong pixelFormat() const { return mPixelFormat; } 1441 1444 uchar *VRAM() const { return mVRAM; } … … 1444 1447 ulong width() const { return mWidth; } 1445 1448 ulong height() const { return mHeight; } 1449 bool usesGuestVram() const {return mUsesGuestVram;} 1446 1450 1447 1451 private: … … 1452 1456 ulong mWidth; 1453 1457 ulong mHeight; 1458 bool mUsesGuestVram; 1454 1459 }; 1455 1460 … … 1908 1913 mOverlay(pView->viewport(), pView, aSession), 1909 1914 mpView (pView) 1910 {} 1915 { 1916 /* synch with framebuffer */ 1917 mOverlay.onResizeEventPostprocess (VBoxFBSizeInfo(this), QPoint(mpView->contentsX(), mpView->contentsY())); 1918 } 1911 1919 1912 1920 STDMETHOD(ProcessVHWACommand)(BYTE *pCommand) … … 1949 1957 { 1950 1958 T::resizeEvent (re); 1951 mOverlay.onResizeEventPostprocess (VBoxFBSizeInfo( re),1959 mOverlay.onResizeEventPostprocess (VBoxFBSizeInfo(this), 1952 1960 QPoint(mpView->contentsX(), mpView->contentsY())); 1953 1961 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r27757 r27758 527 527 # endif 528 528 # if defined(VBOX_WITH_VIDEOHWACCEL) && defined(DEBUG_misha) /* not tested yet */ 529 /* these two additional template args is a workaround to this [VBox|UI] duplication 530 * @todo: they are to be removed once VBox stuff is gone */ 531 m_pFrameBuffer = m_fAccelerate2DVideo ? new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent> (this, &machineWindowWrapper()->session()) : new UIFrameBufferSDL(this); 529 if (m_fAccelerate2DVideo) 530 { 531 class UIFrameBuffer* pFramebuffer = uisession()->persistedBrameBuffer(screenId()); 532 if (pFramebuffer) 533 pFramebuffer->setView(this); 534 else 535 { 536 /* these two additional template args is a workaround to this [VBox|UI] duplication 537 * @todo: they are to be removed once VBox stuff is gone */ 538 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session()); 539 uisession()->setPersistedBrameBuffer(screenId(), pFramebuffer); 540 } 541 m_pFrameBuffer = pFramebuffer; 542 } 543 else 544 m_pFrameBuffer = new UIFrameBufferSDL(this); 532 545 # else 533 546 m_pFrameBuffer = new UIFrameBufferSDL(this); … … 557 570 viewport()->setAttribute(Qt::WA_PaintOnScreen); 558 571 # ifdef VBOX_WITH_VIDEOHWACCEL 559 /* these two additional template args is a workaround to this [VBox|UI] duplication 560 * @todo: they are to be removed once VBox stuff is gone */ 561 m_pFrameBuffer = m_fAccelerate2DVideo ? new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session()) : new UIFrameBufferQuartz2D(this); 572 if (m_fAccelerate2DVideo) 573 { 574 class UIFrameBuffer* pFramebuffer = uisession()->persistedBrameBuffer(screenId()); 575 if (pFramebuffer) 576 pFramebuffer->setView(this); 577 else 578 { 579 /* these two additional template args is a workaround to this [VBox|UI] duplication 580 * @todo: they are to be removed once VBox stuff is gone */ 581 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session()); 582 uisession()->setPersistedBrameBuffer(screenId(), pFramebuffer); 583 } 584 m_pFrameBuffer = pFramebuffer; 585 } 586 else 587 m_pFrameBuffer = new UIFrameBufferQuartz2D(this); 562 588 # else 563 589 m_pFrameBuffer = new UIFrameBufferQuartz2D(this); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r27757 r27758 38 38 #ifdef VBOX_WITH_VIDEOHWACCEL 39 39 # include "VBoxFBOverlay.h" 40 # include "UIFrameBuffer.h" 40 41 #endif 41 42 … … 594 595 DestroyIcon(m_alphaCursor); 595 596 #endif 597 598 #ifdef VBOX_WITH_VIDEOHWACCEL 599 for (int i = m_FrameBufferVector.size() - 1; i >= 0; --i) 600 { 601 UIFrameBuffer *pFb = m_FrameBufferVector[i]; 602 if (pFb) 603 { 604 /* Warn framebuffer about its no more necessary: */ 605 pFb->setDeleted(true); 606 /* Detach framebuffer from Display: */ 607 CDisplay display = session().GetConsole().GetDisplay(); 608 display.SetFramebuffer(i, CFramebuffer(NULL)); 609 /* Release the reference: */ 610 pFb->Release(); 611 } 612 } 613 #endif 596 614 } 597 615
Note:
See TracChangeset
for help on using the changeset viewer.