Changeset 105865 in vbox
- Timestamp:
- Aug 26, 2024 8:37:09 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/SDKRef.xml
r105864 r105865 3008 3008 <para><link linkend="IGraphicsAdapter__setFeature">IGraphicsAdapter::setFeature</link></para> 3009 3009 <para>The new IGraphicsAdapter::setFeature enables or disables a graphics feature 3010 for a specific adapter. 3010 for a specific adapter.</para> 3011 3011 </listitem> 3012 3012 </itemizedlist> -
trunk/src/VBox/Main/include/GraphicsAdapterImpl.h
r105864 r105865 66 66 void i_copyFrom(GraphicsAdapter *aThat); 67 67 68 public:69 70 // static helper functions71 static int s_getSupportedFeatures(GraphicsControllerType_T enmController, std::vector<GraphicsFeature_T> &vecSupportedGraphicsFeatures);72 static bool s_isFeatureSupported(GraphicsControllerType_T enmController, GraphicsFeature_T enmFeature);73 74 68 private: 75 69 -
trunk/src/VBox/Main/include/PlatformPropertiesImpl.h
r105864 r105865 68 68 static ULONG s_getMaxNetworkAdaptersOfType(ChipsetType_T aChipset, NetworkAttachmentType_T aType); 69 69 static HRESULT s_getSupportedVRAMRange(GraphicsControllerType_T aGraphicsControllerType, BOOL fAccelerate3DEnabled, ULONG *aMinMB, ULONG *aMaxMB, ULONG *aStrideSizeMB); 70 static int s_getSupportedGraphicsControllerFeatures(GraphicsControllerType_T enmController, std::vector<GraphicsFeature_T> &vecSupportedGraphicsFeatures); 71 static bool s_isGraphicsControllerFeatureSupported(GraphicsControllerType_T enmController, GraphicsFeature_T enmFeature); 70 72 71 73 private: -
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); -
trunk/src/VBox/Main/src-server/GraphicsAdapterImpl.cpp
r105864 r105865 279 279 } 280 280 281 /**282 * Static helper function to return all supported features for a given graphics controller.283 *284 * @returns VBox status code.285 * @param enmController Graphics controller to return supported features for.286 * @param vecSupportedGraphicsControllerFeatures Returned features on success.287 */288 /* static */289 int GraphicsAdapter::s_getSupportedFeatures(GraphicsControllerType_T enmController,290 std::vector<GraphicsFeature_T> &vecSupportedGraphicsFeatures)291 {292 switch (enmController)293 {294 #ifdef VBOX_WITH_VMSVGA295 case GraphicsControllerType_VBoxSVGA:296 {297 static const GraphicsFeature_T s_aGraphicsFeatures[] =298 {299 # ifdef VBOX_WITH_VIDEOHWACCEL300 GraphicsFeature_Acceleration2DVideo,301 # endif302 # ifdef VBOX_WITH_3D_ACCELERATION303 GraphicsFeature_Acceleration3D304 # endif305 };306 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures);307 break;308 }309 #endif310 case GraphicsControllerType_VBoxVGA:311 RT_FALL_THROUGH();312 case GraphicsControllerType_QemuRamFB:313 {314 static const GraphicsFeature_T s_aGraphicsFeatures[] =315 {316 GraphicsFeature_None317 };318 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures);319 break;320 }321 322 default:323 return VERR_INVALID_PARAMETER;324 }325 326 return VINF_SUCCESS;327 }328 329 /**330 * Static helper function to return whether a given graphics feature for a graphics controller is enabled or not.331 *332 * @returns \c true if the given feature is supported, or \c false if not.333 * @param enmController Graphics controlller to query a feature for.334 * @param enmFeature Feature to query.335 */336 /* static */337 bool GraphicsAdapter::s_isFeatureSupported(GraphicsControllerType_T enmController, GraphicsFeature_T enmFeature)338 {339 std::vector<GraphicsFeature_T> vecSupportedGraphicsFeatures;340 int vrc = GraphicsAdapter::s_getSupportedFeatures(enmController, vecSupportedGraphicsFeatures);341 if (RT_SUCCESS(vrc))342 return std::find(vecSupportedGraphicsFeatures.begin(),343 vecSupportedGraphicsFeatures.end(), enmFeature) != vecSupportedGraphicsFeatures.end();344 return false;345 }346 347 281 HRESULT GraphicsAdapter::setFeature(GraphicsFeature_T aFeature, BOOL aEnabled) 348 282 { … … 354 288 355 289 /* Validate if the given feature is supported by this graphics controller. */ 356 if (! GraphicsAdapter::s_isFeatureSupported(mData->graphicsControllerType, aFeature))290 if (!PlatformProperties::s_isGraphicsControllerFeatureSupported(mData->graphicsControllerType, aFeature)) 357 291 return setError(VBOX_E_NOT_SUPPORTED, tr("The graphics controller does not support the given feature")); 358 292
Note:
See TracChangeset
for help on using the changeset viewer.