Changeset 105865 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Aug 26, 2024 8:37:09 PM (7 months ago)
- svn:sync-xref-src-repo-rev:
- 164585
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.