[cogl/cogl-1.16] renderer: Only check certain constraints when selecting a driver
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.16] renderer: Only check certain constraints when selecting a driver
- Date: Fri, 23 Aug 2013 21:21:20 +0000 (UTC)
commit e7b50a6cba02195060b27a7a4aa1efe340bbc7f2
Author: Neil Roberts <neil linux intel com>
Date: Thu Jun 27 09:30:04 2013 +0100
renderer: Only check certain constraints when selecting a driver
Only COGL_RENDERER_CONSTRAINT_SUPPORTS_COGL_GLES2 affects the driver
selection and all of the the other constraints are only relevant to
the winsys selection. However Cogl was trying to apply all of the
constraints to the driver selection which meant that if any other
constraint was specified then it would always fail. This patch makes
the driver selection filter out all other constraints based on a mask
defined in cogl-renderer-private.h.
Reviewed-by: Robert Bragg <robert linux intel com>
(cherry picked from commit f07febc8913b97fb828e7f2cc2857813af2d3657)
cogl/cogl-renderer-private.h | 5 +++++
cogl/cogl-renderer.c | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-renderer-private.h b/cogl/cogl-renderer-private.h
index 9e4b339..8b8d2bf 100644
--- a/cogl/cogl-renderer-private.h
+++ b/cogl/cogl-renderer-private.h
@@ -90,6 +90,11 @@ struct _CoglRenderer
void *winsys;
};
+/* Mask of constraints that effect driver selection. All of the other
+ * constraints effect only the winsys selection */
+#define COGL_RENDERER_DRIVER_CONSTRAINTS \
+ COGL_RENDERER_CONSTRAINT_SUPPORTS_COGL_GLES2
+
typedef CoglFilterReturn (* CoglNativeFilterFunc) (void *native_event,
void *data);
diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c
index ada3c3b..8136fe1 100644
--- a/cogl/cogl-renderer.c
+++ b/cogl/cogl-renderer.c
@@ -469,6 +469,11 @@ satisfy_constraints (CoglDriverDescription *description,
{
CoglRendererConstraint constraint = GPOINTER_TO_UINT (l->data);
+ /* Most of the constraints only affect the winsys selection so
+ * we'll filter them out */
+ if (!(constraint & COGL_RENDERER_DRIVER_CONSTRAINTS))
+ continue;
+
/* If the driver doesn't satisfy any constraint then continue
* to the next driver description */
if (!(constraint & description->constraints))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]