Changeset 46433 in vbox
- Timestamp:
- Jun 7, 2013 11:28:10 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86275
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r46430 r46433 271 271 , mWarpPct(100) 272 272 , mVerString("1.0") 273 , m3DAvailable( false)273 , m3DAvailable(-1) 274 274 , mSettingsPwSet(false) 275 275 { … … 408 408 return m_pVirtualMachine->activeWindow(); 409 409 } 410 411 412 /** 413 * Inner worker that for lazily querying for 3D support. 414 * 415 * Rational is that when starting a text mode guest (like DOS) that does not 416 * have 3D enabled, don't wast the developer's or user's time on launching the 417 * test application when starting the VM or editing it's settings. 418 * 419 * @returns true / false. 420 * @note If we ever end up checking this concurrently on multiple threads, use a 421 * RTONCE construct to serialize the efforts. 422 */ 423 bool VBoxGlobal::is3DAvailableWorker() const 424 { 425 bool fSupported = VBoxOglIs3DAccelerationSupported(); 426 unconst(this)->m3DAvailable = fSupported; 427 return fSupported; 428 } 429 410 430 411 431 #ifdef VBOX_GUI_WITH_PIDFILE … … 1210 1230 } 1211 1231 1212 QString acc3d = is3DAvailable() && aMachine.GetAccelerate3DEnabled()1232 QString acc3d = aMachine.GetAccelerate3DEnabled() && is3DAvailable() 1213 1233 ? tr ("Enabled", "details report (3D Acceleration)") 1214 1234 : tr ("Disabled", "details report (3D Acceleration)"); … … 4027 4047 } 4028 4048 mHost = virtualBox().GetHost(); 4029 #ifdef VBOX_WITH_CROGL4030 m3DAvailable = VBoxOglIs3DAccelerationSupported();4031 #else4032 m3DAvailable = false;4033 #endif4034 4049 4035 4050 /* create default non-null global settings */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r46430 r46433 96 96 QWidget* activeMachineWindow(); 97 97 98 bool is3DAvailable() const { return m3DAvailable; } 98 bool is3DAvailableWorker() const; 99 bool is3DAvailable() const { if (m3DAvailable < 0) return is3DAvailableWorker(); return m3DAvailable != 0; } 99 100 100 101 #ifdef VBOX_GUI_WITH_PIDFILE
Note:
See TracChangeset
for help on using the changeset viewer.