Changeset 81964 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Nov 18, 2019 8:42:02 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134761
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r81882 r81964 2769 2769 * Constructor. Needs to set sane defaults which stand the test of time. 2770 2770 */ 2771 GraphicsAdapter::GraphicsAdapter() : 2772 graphicsControllerType(GraphicsControllerType_VBoxVGA), 2773 ulVRAMSizeMB(8), 2774 cMonitors(1), 2775 fAccelerate3D(false), 2776 fAccelerate2DVideo(false) 2777 { 2778 } 2779 2780 /** 2781 * Check if all settings have default values. 2782 */ 2783 bool GraphicsAdapter::areDefaultSettings() const 2784 { 2785 return graphicsControllerType == GraphicsControllerType_VBoxVGA 2786 && ulVRAMSizeMB == 8 2787 && cMonitors <= 1 2788 && !fAccelerate3D 2789 && !fAccelerate2DVideo; 2790 } 2791 2792 /** 2793 * Comparison operator. This gets called from MachineConfigFile::operator==, 2794 * which in turn gets called from Machine::saveSettings to figure out whether 2795 * machine settings have really changed and thus need to be written out to disk. 2796 */ 2797 bool GraphicsAdapter::operator==(const GraphicsAdapter &g) const 2798 { 2799 return (this == &g) 2800 || ( graphicsControllerType == g.graphicsControllerType 2801 && ulVRAMSizeMB == g.ulVRAMSizeMB 2802 && cMonitors == g.cMonitors 2803 && fAccelerate3D == g.fAccelerate3D 2804 && fAccelerate2DVideo == g.fAccelerate2DVideo); 2805 } 2806 2807 /** 2808 * Constructor. Needs to set sane defaults which stand the test of time. 2809 */ 2771 2810 USBController::USBController() : 2772 2811 enmType(USBControllerType_Null) … … 3305 3344 strCpuProfile("host"), 3306 3345 ulMemorySizeMB((uint32_t)-1), 3307 graphicsControllerType(GraphicsControllerType_VBoxVGA),3308 ulVRAMSizeMB(8),3309 cMonitors(1),3310 fAccelerate3D(false),3311 fAccelerate2DVideo(false),3312 3346 firmwareType(FirmwareType_BIOS), 3313 3347 pointingHIDType(PointingHIDType_PS2Mouse), … … 3375 3409 && (it1 != mapBootOrder.end() && it1->second == DeviceType_DVD) 3376 3410 && (it2 != mapBootOrder.end() && it2->second == DeviceType_HardDisk); 3377 }3378 3379 /**3380 * Check if all Display settings have default values.3381 */3382 bool Hardware::areDisplayDefaultSettings() const3383 {3384 return graphicsControllerType == GraphicsControllerType_VBoxVGA3385 && ulVRAMSizeMB == 83386 && cMonitors <= 13387 && !fAccelerate3D3388 && !fAccelerate2DVideo;3389 3411 } 3390 3412 … … 3445 3467 && ulMemorySizeMB == h.ulMemorySizeMB 3446 3468 && mapBootOrder == h.mapBootOrder 3447 && graphicsControllerType == h.graphicsControllerType3448 && ulVRAMSizeMB == h.ulVRAMSizeMB3449 && cMonitors == h.cMonitors3450 && fAccelerate3D == h.fAccelerate3D3451 && fAccelerate2DVideo == h.fAccelerate2DVideo3452 3469 && firmwareType == h.firmwareType 3453 3470 && pointingHIDType == h.pointingHIDType … … 3459 3476 && vrdeSettings == h.vrdeSettings 3460 3477 && biosSettings == h.biosSettings 3478 && graphicsAdapter == h.graphicsAdapter 3461 3479 && usbSettings == h.usbSettings 3462 3480 && llNetworkAdapters == h.llNetworkAdapters … … 4645 4663 Utf8Str strGraphicsControllerType; 4646 4664 if (!pelmHwChild->getAttributeValue("controller", strGraphicsControllerType)) 4647 hw.graphics ControllerType = GraphicsControllerType_VBoxVGA;4665 hw.graphicsAdapter.graphicsControllerType = GraphicsControllerType_VBoxVGA; 4648 4666 else 4649 4667 { … … 4660 4678 else 4661 4679 throw ConfigFileError(this, pelmHwChild, N_("Invalid value '%s' in Display/@controller attribute"), strGraphicsControllerType.c_str()); 4662 hw.graphics ControllerType = type;4663 } 4664 pelmHwChild->getAttributeValue("VRAMSize", hw. ulVRAMSizeMB);4665 if (!pelmHwChild->getAttributeValue("monitorCount", hw. cMonitors))4666 pelmHwChild->getAttributeValue("MonitorCount", hw. cMonitors); // pre-v1.5 variant4667 if (!pelmHwChild->getAttributeValue("accelerate3D", hw. fAccelerate3D))4668 pelmHwChild->getAttributeValue("Accelerate3D", hw. fAccelerate3D); // pre-v1.5 variant4669 pelmHwChild->getAttributeValue("accelerate2DVideo", hw. fAccelerate2DVideo);4680 hw.graphicsAdapter.graphicsControllerType = type; 4681 } 4682 pelmHwChild->getAttributeValue("VRAMSize", hw.graphicsAdapter.ulVRAMSizeMB); 4683 if (!pelmHwChild->getAttributeValue("monitorCount", hw.graphicsAdapter.cMonitors)) 4684 pelmHwChild->getAttributeValue("MonitorCount", hw.graphicsAdapter.cMonitors); // pre-v1.5 variant 4685 if (!pelmHwChild->getAttributeValue("accelerate3D", hw.graphicsAdapter.fAccelerate3D)) 4686 pelmHwChild->getAttributeValue("Accelerate3D", hw.graphicsAdapter.fAccelerate3D); // pre-v1.5 variant 4687 pelmHwChild->getAttributeValue("accelerate2DVideo", hw.graphicsAdapter.fAccelerate2DVideo); 4670 4688 } 4671 4689 else if (pelmHwChild->nameEquals("VideoCapture")) … … 4692 4710 pelmHwChild->getAttributeValue("fps", screen0Settings.Video.ulFPS); 4693 4711 4694 for (unsigned i = 0; i < hw. cMonitors; i++) /* Don't add more settings than we have monitors configured. */4712 for (unsigned i = 0; i < hw.graphicsAdapter.cMonitors; i++) /* Don't add more settings than we have monitors configured. */ 4695 4713 { 4696 4714 /* Add screen i to config in any case. */ … … 6080 6098 } 6081 6099 6082 if (!hw. areDisplayDefaultSettings())6100 if (!hw.graphicsAdapter.areDefaultSettings()) 6083 6101 { 6084 6102 xml::ElementNode *pelmDisplay = pelmHardware->createChild("Display"); 6085 if (hw.graphics ControllerType != GraphicsControllerType_VBoxVGA)6103 if (hw.graphicsAdapter.graphicsControllerType != GraphicsControllerType_VBoxVGA) 6086 6104 { 6087 6105 const char *pcszGraphics; 6088 switch (hw.graphics ControllerType)6106 switch (hw.graphicsAdapter.graphicsControllerType) 6089 6107 { 6090 6108 case GraphicsControllerType_VBoxVGA: pcszGraphics = "VBoxVGA"; break; … … 6095 6113 pelmDisplay->setAttribute("controller", pcszGraphics); 6096 6114 } 6097 if (hw. ulVRAMSizeMB != 8)6098 pelmDisplay->setAttribute("VRAMSize", hw. ulVRAMSizeMB);6099 if (hw. cMonitors > 1)6100 pelmDisplay->setAttribute("monitorCount", hw. cMonitors);6101 if (hw. fAccelerate3D)6102 pelmDisplay->setAttribute("accelerate3D", hw. fAccelerate3D);6115 if (hw.graphicsAdapter.ulVRAMSizeMB != 8) 6116 pelmDisplay->setAttribute("VRAMSize", hw.graphicsAdapter.ulVRAMSizeMB); 6117 if (hw.graphicsAdapter.cMonitors > 1) 6118 pelmDisplay->setAttribute("monitorCount", hw.graphicsAdapter.cMonitors); 6119 if (hw.graphicsAdapter.fAccelerate3D) 6120 pelmDisplay->setAttribute("accelerate3D", hw.graphicsAdapter.fAccelerate3D); 6103 6121 6104 6122 if (m->sv >= SettingsVersion_v1_8) 6105 6123 { 6106 if (hw. fAccelerate2DVideo)6107 pelmDisplay->setAttribute("accelerate2DVideo", hw. fAccelerate2DVideo);6124 if (hw.graphicsAdapter.fAccelerate2DVideo) 6125 pelmDisplay->setAttribute("accelerate2DVideo", hw.graphicsAdapter.fAccelerate2DVideo); 6108 6126 } 6109 6127 } … … 7786 7804 // setting, explicit long mode setting, (video) capturing and NAT networking. 7787 7805 if ( !hardwareMachine.strDefaultFrontend.isEmpty() 7788 || hardwareMachine.graphics ControllerType != GraphicsControllerType_VBoxVGA7806 || hardwareMachine.graphicsAdapter.graphicsControllerType != GraphicsControllerType_VBoxVGA 7789 7807 || hardwareMachine.enmLongMode != Hardware::LongMode_Legacy 7790 7808 || machineUserData.ovIcon.size() > 0 … … 8171 8189 // "accelerate 2d video" requires settings version 1.8 8172 8190 if ( (m->sv < SettingsVersion_v1_8) 8173 && (hardwareMachine. fAccelerate2DVideo)8191 && (hardwareMachine.graphicsAdapter.fAccelerate2DVideo) 8174 8192 ) 8175 8193 m->sv = SettingsVersion_v1_8;
Note:
See TracChangeset
for help on using the changeset viewer.