[cogl/wip/kms-gbm-surface: 1/6] Add a feature ID for the swap event notification



commit 04f2e4f1d60d2860b19b0f62f841fcd0c3404d5f
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 4ac29ac..ff03b22 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 8779af6..66bfcd8 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]