cogl: Remove default context gross hack
As nothing uses it anymore Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
This commit is contained in:
parent
c23bc80ba4
commit
1d465461a7
2 changed files with 0 additions and 40 deletions
|
@ -276,9 +276,6 @@ struct _CoglContext
|
|||
#undef COGL_EXT_END
|
||||
};
|
||||
|
||||
COGL_EXPORT CoglContext *
|
||||
_cogl_context_get_default (void);
|
||||
|
||||
const CoglWinsysVtable *
|
||||
_cogl_context_get_winsys (CoglContext *context);
|
||||
|
||||
|
@ -292,13 +289,6 @@ gboolean
|
|||
_cogl_context_update_features (CoglContext *context,
|
||||
GError **error);
|
||||
|
||||
/* Obtains the context and returns retval if NULL */
|
||||
#define _COGL_GET_CONTEXT(ctxvar, retval) \
|
||||
CoglContext *ctxvar = _cogl_context_get_default (); \
|
||||
if (ctxvar == NULL) return retval;
|
||||
|
||||
#define NO_RETVAL
|
||||
|
||||
void
|
||||
_cogl_context_set_current_projection_entry (CoglContext *context,
|
||||
CoglMatrixEntry *entry);
|
||||
|
|
|
@ -160,8 +160,6 @@ cogl_context_class_init (CoglContextClass *class)
|
|||
extern void
|
||||
_cogl_create_context_driver (CoglContext *context);
|
||||
|
||||
static CoglContext *_cogl_context = NULL;
|
||||
|
||||
static void
|
||||
_cogl_init_feature_overrides (CoglContext *ctx)
|
||||
{
|
||||
|
@ -209,15 +207,6 @@ cogl_context_new (CoglDisplay *display,
|
|||
/* Allocate context memory */
|
||||
context = g_object_new (COGL_TYPE_CONTEXT, NULL);
|
||||
|
||||
/* XXX: Gross hack!
|
||||
* Currently everything in Cogl just assumes there is a default
|
||||
* context which it can access via _COGL_GET_CONTEXT() including
|
||||
* code used to construct a CoglContext. Until all of that code
|
||||
* has been updated to take an explicit context argument we have
|
||||
* to immediately make our pointer the default context.
|
||||
*/
|
||||
_cogl_context = context;
|
||||
|
||||
/* Init default values */
|
||||
memset (context->features, 0, sizeof (context->features));
|
||||
memset (context->private_features, 0, sizeof (context->private_features));
|
||||
|
@ -386,25 +375,6 @@ cogl_context_new (CoglDisplay *display,
|
|||
return context;
|
||||
}
|
||||
|
||||
CoglContext *
|
||||
_cogl_context_get_default (void)
|
||||
{
|
||||
GError *error = NULL;
|
||||
/* Create if doesn't exist yet */
|
||||
if (_cogl_context == NULL)
|
||||
{
|
||||
_cogl_context = cogl_context_new (NULL, &error);
|
||||
if (!_cogl_context)
|
||||
{
|
||||
g_warning ("Failed to create default context: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
return _cogl_context;
|
||||
}
|
||||
|
||||
CoglDisplay *
|
||||
cogl_context_get_display (CoglContext *context)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue