[cogl/wip/kms-gbm-surface: 7/10] Add a feature ID for the swap event notification
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/kms-gbm-surface: 7/10] Add a feature ID for the swap event notification
- Date: Mon, 19 Dec 2011 19:33:19 +0000 (UTC)
commit ac0c949134902ff367b94ee71fb75116d6194a40
Author: Neil Roberts <neil linux intel com>
Date: Mon Dec 19 19:22:58 2011 +0000
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.
cogl/cogl.h | 5 ++++-
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 248399e..83c7a6e 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -203,7 +203,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
@@ -230,6 +232,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 594e377..24cefe8 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -458,6 +458,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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]