[cogl/cogl-1.18] mir: return whether a foreign connection has been set or not



commit 8e6997db449bcc58e79f9b9219f2f24427794a7f
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Thu Nov 20 07:17:19 2014 +0100

    mir: return whether a foreign connection has been set or not

 cogl/cogl-mir-renderer.h          |    4 +++-
 cogl/winsys/cogl-winsys-egl-mir.c |   11 ++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/cogl/cogl-mir-renderer.h b/cogl/cogl-mir-renderer.h
index d03fbea..f3da5ea 100644
--- a/cogl/cogl-mir-renderer.h
+++ b/cogl/cogl-mir-renderer.h
@@ -49,10 +49,12 @@ COGL_BEGIN_DECLS
  * to work with instead of leaving Cogl to automatically connect to a
  * mir server.
  *
+ * Returns: whether @connection has been marked as been set as connection or not.
+ *
  * Since: 1.8
  * Stability: unstable
  */
-void
+CoglBool
 cogl_mir_renderer_set_foreign_connection (CoglRenderer *renderer,
                                           MirConnection *connection);
 
diff --git a/cogl/winsys/cogl-winsys-egl-mir.c b/cogl/winsys/cogl-winsys-egl-mir.c
index 4edad37..5173727 100644
--- a/cogl/winsys/cogl-winsys-egl-mir.c
+++ b/cogl/winsys/cogl-winsys-egl-mir.c
@@ -626,17 +626,18 @@ _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
   mir_surface_set_state (mir_onscreen->mir_surface, new_state);
 }
 
-void
+CoglBool
 cogl_mir_renderer_set_foreign_connection (CoglRenderer *renderer,
-                                              MirConnection *connection)
+                                          MirConnection *connection)
 {
-  _COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
-  _COGL_RETURN_IF_FAIL (mir_connection_is_valid (connection));
+  _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), FALSE);
+  _COGL_RETURN_VAL_IF_FAIL (mir_connection_is_valid (connection), FALSE);
 
   /* NB: Renderers are considered immutable once connected */
-  _COGL_RETURN_IF_FAIL (!renderer->connected);
+  _COGL_RETURN_VAL_IF_FAIL (!renderer->connected, FALSE);
 
   renderer->foreign_mir_connection = connection;
+  return TRUE;
 }
 
 MirConnection *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]