Changeset 105865 in vbox for trunk/src/VBox/Main/src-all
- Timestamp:
- Aug 26, 2024 8:37:09 PM (9 months ago)
- svn:sync-xref-src-repo-rev:
- 164585
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp
r105864 r105865 33 33 #include "Global.h" 34 34 35 #include <algorithm> 36 35 37 #include <iprt/asm.h> 36 38 #include <iprt/cpp/utils.h> … … 851 853 852 854 /** 855 * Static helper function to return all supported features for a given graphics controller. 856 * 857 * @returns VBox status code. 858 * @param enmController Graphics controller to return supported features for. 859 * @param vecSupportedGraphicsControllerFeatures Returned features on success. 860 */ 861 /* static */ 862 int PlatformProperties::s_getSupportedGraphicsControllerFeatures(GraphicsControllerType_T enmController, 863 std::vector<GraphicsFeature_T> &vecSupportedGraphicsFeatures) 864 { 865 switch (enmController) 866 { 867 #ifdef VBOX_WITH_VMSVGA 868 case GraphicsControllerType_VBoxSVGA: 869 { 870 static const GraphicsFeature_T s_aGraphicsFeatures[] = 871 { 872 # ifdef VBOX_WITH_VIDEOHWACCEL 873 GraphicsFeature_Acceleration2DVideo, 874 # endif 875 # ifdef VBOX_WITH_3D_ACCELERATION 876 GraphicsFeature_Acceleration3D 877 # endif 878 }; 879 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures); 880 break; 881 } 882 #endif 883 case GraphicsControllerType_VBoxVGA: 884 RT_FALL_THROUGH(); 885 case GraphicsControllerType_QemuRamFB: 886 { 887 static const GraphicsFeature_T s_aGraphicsFeatures[] = 888 { 889 GraphicsFeature_None 890 }; 891 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures); 892 break; 893 } 894 895 default: 896 return VERR_INVALID_PARAMETER; 897 } 898 899 return VINF_SUCCESS; 900 } 901 902 /** 903 * Static helper function to return whether a given graphics feature for a graphics controller is enabled or not. 904 * 905 * @returns \c true if the given feature is supported, or \c false if not. 906 * @param enmController Graphics controlller to query a feature for. 907 * @param enmFeature Feature to query. 908 */ 909 /* static */ 910 bool PlatformProperties::s_isGraphicsControllerFeatureSupported(GraphicsControllerType_T enmController, GraphicsFeature_T enmFeature) 911 { 912 std::vector<GraphicsFeature_T> vecSupportedGraphicsFeatures; 913 int vrc = PlatformProperties::s_getSupportedGraphicsControllerFeatures(enmController, vecSupportedGraphicsFeatures); 914 if (RT_SUCCESS(vrc)) 915 return std::find(vecSupportedGraphicsFeatures.begin(), 916 vecSupportedGraphicsFeatures.end(), enmFeature) != vecSupportedGraphicsFeatures.end(); 917 return false; 918 } 919 920 /** 853 921 * Returns the [minimum, maximum] VRAM range and stride size for a given graphics controller. 854 922 * … … 948 1016 std::vector<GraphicsFeature_T> &aSupportedGraphicsFeatures) 949 1017 { 950 int vrc = GraphicsAdapter::s_getSupportedFeatures(aGraphicsControllerType, aSupportedGraphicsFeatures);1018 int vrc = PlatformProperties::s_getSupportedGraphicsControllerFeatures(aGraphicsControllerType, aSupportedGraphicsFeatures); 951 1019 if (RT_FAILURE(vrc)) 952 1020 return setError(E_INVALIDARG, tr("The graphics controller type (%d) is invalid"), aGraphicsControllerType);
Note:
See TracChangeset
for help on using the changeset viewer.