Changeset 84792 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 11, 2020 1:12:17 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r84791 r84792 310 310 , m_fWrappersValid(false) 311 311 , m_fVBoxSVCAvailable(true) 312 , m_i3DAvailable(-1)313 312 , m_pThreadPool(0) 314 313 , m_pThreadPoolCloud(0) … … 3732 3731 } 3733 3732 3734 bool UICommon::is3DAvailableWorker() const3735 {3736 /* Rational is that when starting a text mode guest (like DOS) that does not3737 * have 3D enabled, don't wast the developer's or user's time on launching the3738 * test application when starting the VM or editing it's settings.3739 *3740 * Keep in mind that if we ever end up checking this concurrently on multiple threads,3741 * use a RTONCE construct to serialize the efforts. */3742 3743 #ifdef VBOX_WITH_3D_ACCELERATION3744 bool fSupported = true;3745 #else3746 bool fSupported = false;3747 #endif3748 m_i3DAvailable = fSupported;3749 return fSupported;3750 }3751 3752 bool UICommon::is3DAvailable() const3753 {3754 if (m_i3DAvailable < 0)3755 return is3DAvailableWorker();3756 return m_i3DAvailable != 0;3757 }3758 3759 3733 #ifdef VBOX_WITH_3D_ACCELERATION 3760 3734 /* static */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r84741 r84792 634 634 /** @name Display stuff. 635 635 * @{ */ 636 /** Inner worker for lazily querying for 3D support. */637 bool is3DAvailableWorker() const;638 /** Returns whether 3D is available, runs worker above if necessary. */639 bool is3DAvailable() const;640 641 636 #ifdef VBOX_WITH_3D_ACCELERATION 642 637 /** Returns whether guest OS type with passed @a strGuestOSTypeId is WDDM compatible. */ … … 925 920 /** @} */ 926 921 927 /** @name Display stuff.928 * @{ */929 /** Holds whether 3D is available. */930 mutable int m_i3DAvailable;931 /** @} */932 933 922 /** @name Thread stuff. 934 923 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r82968 r84792 762 762 763 763 /* 3D acceleration: */ 764 const bool fAcceleration3D = comGraphics.GetAccelerate3DEnabled() && uiCommon().is3DAvailable();764 const bool fAcceleration3D = comGraphics.GetAccelerate3DEnabled(); 765 765 if (fAcceleration3D) 766 766 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r84790 r84792 218 218 219 219 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 220 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())220 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 221 221 { 222 222 double dScaleFactorFor3D = dScaleFactor; … … 494 494 495 495 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 496 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())496 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 497 497 { 498 498 double dScaleFactorFor3D = dScaleFactor; … … 714 714 715 715 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 716 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())716 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 717 717 { 718 718 double dScaleFactorFor3D = dScaleFactor; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r84790 r84792 62 62 { 63 63 /* Propagate scale-factor to 3D service if necessary: */ 64 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())64 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 65 65 { 66 66 double xScaleFactor = (double)scaledSize.width() / frameBuffer()->width(); … … 121 121 { 122 122 /* Propagate scale-factor to 3D service if necessary: */ 123 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())123 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 124 124 { 125 125 double xScaleFactor = (double)scaledSize.width() / frameBuffer()->width(); … … 144 144 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 145 145 /* Propagate unscaled-hidpi-output feature to 3D service if necessary: */ 146 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())146 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 147 147 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 148 148 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r84790 r84792 594 594 #endif /* VBOX_WITH_3D_ACCELERATION */ 595 595 } 596 597 #ifdef VBOX_WITH_3D_ACCELERATION598 /* 3D acceleration test: */599 if (m_pCheckbox3D->isChecked() && !uiCommon().is3DAvailable())600 {601 message.second << tr("The virtual machine is set up to use hardware graphics acceleration. "602 "However the host system does not currently provide this, "603 "so you will not be able to start the machine.");604 }605 #endif /* VBOX_WITH_3D_ACCELERATION */606 596 607 597 /* Graphics controller type test: */ -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp
r84790 r84792 1719 1719 QStringList aReport; 1720 1720 /* 3D Acceleration? */ 1721 if (comGraphics.GetAccelerate3DEnabled() && uiCommon().is3DAvailable())1721 if (comGraphics.GetAccelerate3DEnabled()) 1722 1722 aReport << QApplication::translate("UIDetails", "3D", "details (display)"); 1723 1723 /* Compose and return report: */
Note:
See TracChangeset
for help on using the changeset viewer.