Add a feature ID for the swap event notification

Previously the swap event notification feature was only accessible as
a winsys feature using the semi-internal
cogl_clutter_winsys_has_feature. This just adds a feature ID for it so
it can also be accessed via cogl_has_feature.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2011-12-19 19:22:58 +00:00 committed by Robert Bragg
parent f075e4c7d7
commit cbbac5a2f5
2 changed files with 9 additions and 1 deletions

View File

@ -204,7 +204,9 @@ cogl_features_available (CoglFeatureFlags features);
* supported with CoglBufferAccess including write support.
* @COGL_FEATURE_ID_MIRRORED_REPEAT: Whether
* %COGL_PIPELINE_WRAP_MODE_MIRRORED_REPEAT is supported.
*
* @COGL_FEATURE_ID_SWAP_BUFFERS_EVENT:
* Available if the window system supports reporting an event
* for swap buffer completions.
*
* All the capabilities that can vary between different GPUs supported
* by Cogl. Applications that depend on any of these features should explicitly
@ -231,6 +233,7 @@ typedef enum _CoglFeatureID
COGL_FEATURE_ID_MAP_BUFFER_FOR_READ,
COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE,
COGL_FEATURE_ID_MIRRORED_REPEAT,
COGL_FEATURE_ID_SWAP_BUFFERS_EVENT,
/*< private > */
_COGL_N_FEATURE_IDS

View File

@ -438,6 +438,11 @@ update_winsys_features (CoglContext *context, GError **error)
COGL_FLAGS_SET (context->winsys_features,
COGL_WINSYS_FEATURE_SWAP_REGION_THROTTLE, TRUE);
if (_cogl_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_BUFFERS_EVENT))
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_SWAP_BUFFERS_EVENT,
TRUE);
return TRUE;
}