diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-12-19 19:22:58 +0000 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2012-01-09 18:59:59 +0000 |
commit | cbbac5a2f5e4a15c7207b70066ba0162ca9b967d (patch) | |
tree | ad4612e27bd7ee697de1d3c7873536c3fd961968 | |
parent | f075e4c7d718dad87e2d06fea2e8d421e00581df (diff) | |
download | cogl-cbbac5a2f5e4a15c7207b70066ba0162ca9b967d.tar.gz |
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>
-rw-r--r-- | cogl/cogl.h | 5 | ||||
-rw-r--r-- | cogl/winsys/cogl-winsys-glx.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/cogl/cogl.h b/cogl/cogl.h index 4ac29ac6..ff03b225 100644 --- a/cogl/cogl.h +++ b/cogl/cogl.h @@ -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 diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c index 113d4d96..ccc746af 100644 --- a/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/winsys/cogl-winsys-glx.c @@ -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; } |