cogl: Call init when creating a context from Clutter
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
This commit is contained in:
parent
9ee1a0fc34
commit
54748b7f1f
7 changed files with 8 additions and 12 deletions
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterBackend:
|
* ClutterBackend:
|
||||||
*
|
*
|
||||||
* Backend abstraction
|
* Backend abstraction
|
||||||
*
|
*
|
||||||
* Clutter can be compiled against different backends. Each backend
|
* Clutter can be compiled against different backends. Each backend
|
||||||
|
@ -117,8 +117,9 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
|
||||||
{
|
{
|
||||||
ClutterBackendClass *klass;
|
ClutterBackendClass *klass;
|
||||||
|
|
||||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
cogl_init ();
|
||||||
|
|
||||||
|
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||||
CLUTTER_NOTE (BACKEND, "Creating Cogl renderer");
|
CLUTTER_NOTE (BACKEND, "Creating Cogl renderer");
|
||||||
backend->cogl_renderer = klass->get_renderer (backend, error);
|
backend->cogl_renderer = klass->get_renderer (backend, error);
|
||||||
|
|
||||||
|
|
|
@ -188,8 +188,6 @@ cogl_context_new (CoglDisplay *display,
|
||||||
int i;
|
int i;
|
||||||
GError *local_error = NULL;
|
GError *local_error = NULL;
|
||||||
|
|
||||||
_cogl_init ();
|
|
||||||
|
|
||||||
#ifdef COGL_ENABLE_PROFILE
|
#ifdef COGL_ENABLE_PROFILE
|
||||||
/* We need to be absolutely sure that uprof has been initialized
|
/* We need to be absolutely sure that uprof has been initialized
|
||||||
* before calling _cogl_uprof_init. uprof_init (NULL, NULL)
|
* before calling _cogl_uprof_init. uprof_init (NULL, NULL)
|
||||||
|
|
|
@ -88,8 +88,6 @@ cogl_display_new (CoglRenderer *renderer,
|
||||||
CoglDisplay *display = g_object_new (COGL_TYPE_DISPLAY, NULL);
|
CoglDisplay *display = g_object_new (COGL_TYPE_DISPLAY, NULL);
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
_cogl_init ();
|
|
||||||
|
|
||||||
display->renderer = renderer;
|
display->renderer = renderer;
|
||||||
if (renderer)
|
if (renderer)
|
||||||
g_object_ref (renderer);
|
g_object_ref (renderer);
|
||||||
|
|
|
@ -55,3 +55,6 @@ void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
|
||||||
COGL_EXPORT
|
COGL_EXPORT
|
||||||
gboolean cogl_context_format_supports_upload (CoglContext *ctx,
|
gboolean cogl_context_format_supports_upload (CoglContext *ctx,
|
||||||
CoglPixelFormat format);
|
CoglPixelFormat format);
|
||||||
|
|
||||||
|
COGL_EXPORT
|
||||||
|
void cogl_init (void);
|
||||||
|
|
|
@ -82,9 +82,6 @@ _cogl_transform_point (const graphene_matrix_t *matrix_mv,
|
||||||
gboolean
|
gboolean
|
||||||
_cogl_check_extension (const char *name, char * const *ext);
|
_cogl_check_extension (const char *name, char * const *ext);
|
||||||
|
|
||||||
void
|
|
||||||
_cogl_init (void);
|
|
||||||
|
|
||||||
#define _cogl_has_private_feature(ctx, feature) \
|
#define _cogl_has_private_feature(ctx, feature) \
|
||||||
COGL_FLAGS_GET ((ctx)->private_features, (feature))
|
COGL_FLAGS_GET ((ctx)->private_features, (feature))
|
||||||
|
|
||||||
|
|
|
@ -194,8 +194,6 @@ cogl_renderer_new (void)
|
||||||
{
|
{
|
||||||
CoglRenderer *renderer = g_object_new (COGL_TYPE_RENDERER, NULL);
|
CoglRenderer *renderer = g_object_new (COGL_TYPE_RENDERER, NULL);
|
||||||
|
|
||||||
_cogl_init ();
|
|
||||||
|
|
||||||
renderer->connected = FALSE;
|
renderer->connected = FALSE;
|
||||||
renderer->event_filters = NULL;
|
renderer->event_filters = NULL;
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include "cogl/cogl-private.h"
|
#include "cogl/cogl-private.h"
|
||||||
#include "cogl/cogl-offscreen.h"
|
#include "cogl/cogl-offscreen.h"
|
||||||
#include "cogl/winsys/cogl-winsys-private.h"
|
#include "cogl/winsys/cogl-winsys-private.h"
|
||||||
|
#include "cogl/cogl-mutter.h"
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_cogl_check_extension (const char *name, char * const *ext)
|
_cogl_check_extension (const char *name, char * const *ext)
|
||||||
|
@ -124,7 +125,7 @@ _cogl_system_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_cogl_init (void)
|
cogl_init (void)
|
||||||
{
|
{
|
||||||
static gboolean initialized = FALSE;
|
static gboolean initialized = FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue