1
0
Fork 0

cogl: Don't allow overriding renderer constraints

It is an API that no longer makes sense, as Cogl is only usable inside of Mutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3781>
This commit is contained in:
Bilal Elmoussaoui 2024-05-26 16:10:21 +02:00
parent 1b64353427
commit dad9f64b5f
3 changed files with 0 additions and 69 deletions

View file

@ -51,7 +51,6 @@ struct _CoglRenderer
void *custom_winsys_user_data;
CoglCustomWinsysVtableGetter custom_winsys_vtable_getter;
CoglWinsysID winsys_id_override;
GList *constraints;
GArray *poll_fds;
int poll_fds_age;

View file

@ -521,8 +521,6 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error)
{
const CoglWinsysVtable *winsys = _cogl_winsys_vtable_getters[i]();
GError *tmp_error = NULL;
GList *l;
gboolean skip_due_to_constraints = FALSE;
if (renderer->winsys_id_override != COGL_WINSYS_ID_ANY)
{
@ -530,21 +528,6 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error)
continue;
}
for (l = renderer->constraints; l; l = l->next)
{
CoglRendererConstraint constraint = GPOINTER_TO_UINT (l->data);
if (!(winsys->constraints & constraint))
{
skip_due_to_constraints = TRUE;
break;
}
}
if (skip_due_to_constraints)
{
constraints_failed |= TRUE;
continue;
}
/* At least temporarily we will associate this winsys with
* the renderer in-case ->renderer_connect calls API that
* wants to query the current winsys... */
@ -672,24 +655,6 @@ _cogl_renderer_get_proc_address (CoglRenderer *renderer,
return winsys->renderer_get_proc_address (renderer, name);
}
void
cogl_renderer_add_constraint (CoglRenderer *renderer,
CoglRendererConstraint constraint)
{
g_return_if_fail (!renderer->connected);
renderer->constraints = g_list_prepend (renderer->constraints,
GUINT_TO_POINTER (constraint));
}
void
cogl_renderer_remove_constraint (CoglRenderer *renderer,
CoglRendererConstraint constraint)
{
g_return_if_fail (!renderer->connected);
renderer->constraints = g_list_remove (renderer->constraints,
GUINT_TO_POINTER (constraint));
}
void
cogl_renderer_set_driver (CoglRenderer *renderer,
CoglDriver driver)

View file

@ -98,10 +98,6 @@ G_DECLARE_FINAL_TYPE (CoglRenderer,
* selection of an underlying driver, such as OpenGL or OpenGL-ES and
* a selection of a window system binding API such as GLX or EGL.
*
* While the renderer is unconnected it can be configured so that
* applications may specify backend constraints, such as "must use
* x11" for example via cogl_renderer_add_constraint().
*
* There are also some platform specific configuration apis such
* as cogl_xlib_renderer_set_foreign_display() that may also be
* used while the renderer is unconnected.
@ -239,35 +235,6 @@ typedef enum
COGL_RENDERER_CONSTRAINT_USES_EGL = (1 << 2),
} CoglRendererConstraint;
/**
* cogl_renderer_add_constraint:
* @renderer: An unconnected #CoglRenderer
* @constraint: A #CoglRendererConstraint to add
*
* This adds a renderer selection @constraint.
*
* Applications should ideally minimize how many of these constraints they
* depend on to ensure maximum portability.
*/
COGL_EXPORT void
cogl_renderer_add_constraint (CoglRenderer *renderer,
CoglRendererConstraint constraint);
/**
* cogl_renderer_remove_constraint:
* @renderer: An unconnected #CoglRenderer
* @constraint: A #CoglRendererConstraint to remove
*
* This removes a renderer selection @constraint.
*
* Applications should ideally minimize how many of these constraints they
* depend on to ensure maximum portability.
*/
COGL_EXPORT void
cogl_renderer_remove_constraint (CoglRenderer *renderer,
CoglRendererConstraint constraint);
/**
* CoglDriver:
* @COGL_DRIVER_ANY: Implies no preference for which driver is used