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)
This commit is contained in:
Neil Roberts 2013-06-27 09:30:04 +01:00 committed by Robert Bragg
parent 627e518da0
commit e7b50a6cba
2 changed files with 10 additions and 0 deletions

View File

@ -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);

View File

@ -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))