cogl: Remove use_stereo_stage config
Nothing sets it from the X11 backend API, so just get rid of it Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
This commit is contained in:
parent
a1828e7212
commit
41ec1aa0ca
@ -54,7 +54,6 @@ typedef struct _CoglFramebufferDriverConfig
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
gboolean need_stencil;
|
gboolean need_stencil;
|
||||||
gboolean stereo_enabled;
|
|
||||||
} CoglFramebufferConfig;
|
} CoglFramebufferConfig;
|
||||||
|
|
||||||
/* XXX: The order of these indices determines the order they are
|
/* XXX: The order of these indices determines the order they are
|
||||||
|
@ -57,11 +57,3 @@ cogl_onscreen_template_new (void)
|
|||||||
|
|
||||||
return onscreen_template;
|
return onscreen_template;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
cogl_onscreen_template_set_stereo_enabled (
|
|
||||||
CoglOnscreenTemplate *onscreen_template,
|
|
||||||
gboolean enabled)
|
|
||||||
{
|
|
||||||
onscreen_template->config.stereo_enabled = enabled;
|
|
||||||
}
|
|
||||||
|
@ -51,20 +51,4 @@ G_DECLARE_FINAL_TYPE (CoglOnscreenTemplate, cogl_onscreen_template,
|
|||||||
COGL_EXPORT CoglOnscreenTemplate *
|
COGL_EXPORT CoglOnscreenTemplate *
|
||||||
cogl_onscreen_template_new (void);
|
cogl_onscreen_template_new (void);
|
||||||
|
|
||||||
/**
|
|
||||||
* cogl_onscreen_template_set_stereo_enabled:
|
|
||||||
* @onscreen_template: A #CoglOnscreenTemplate template framebuffer
|
|
||||||
* @enabled: Whether framebuffers are created with stereo buffers
|
|
||||||
*
|
|
||||||
* Sets whether future #CoglOnscreen framebuffers derived from this
|
|
||||||
* template are attempted to be created with both left and right
|
|
||||||
* buffers, for use with stereo display. If the display system
|
|
||||||
* does not support stereo, then creation of the framebuffer will
|
|
||||||
* fail.
|
|
||||||
*/
|
|
||||||
COGL_EXPORT void
|
|
||||||
cogl_onscreen_template_set_stereo_enabled (
|
|
||||||
CoglOnscreenTemplate *onscreen_template,
|
|
||||||
gboolean enabled);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -521,11 +521,6 @@ glx_attributes_from_framebuffer_config (CoglDisplay *display,
|
|||||||
attributes[i++] = 1;
|
attributes[i++] = 1;
|
||||||
attributes[i++] = GLX_STENCIL_SIZE;
|
attributes[i++] = GLX_STENCIL_SIZE;
|
||||||
attributes[i++] = config->need_stencil ? 2 : 0;
|
attributes[i++] = config->need_stencil ? 2 : 0;
|
||||||
if (config->stereo_enabled)
|
|
||||||
{
|
|
||||||
attributes[i++] = GLX_STEREO;
|
|
||||||
attributes[i++] = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
attributes[i++] = None;
|
attributes[i++] = None;
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "clutter/clutter.h"
|
#include "clutter/clutter.h"
|
||||||
#include "cogl/cogl-xlib-renderer.h"
|
#include "cogl/cogl-xlib-renderer.h"
|
||||||
#include "core/bell.h"
|
#include "core/bell.h"
|
||||||
|
#include "glib.h"
|
||||||
#include "meta/meta-backend.h"
|
#include "meta/meta-backend.h"
|
||||||
|
|
||||||
typedef struct _MetaClutterBackendX11Private
|
typedef struct _MetaClutterBackendX11Private
|
||||||
@ -65,75 +66,23 @@ static const gchar *atom_names[] = {
|
|||||||
|
|
||||||
#define N_ATOM_NAMES G_N_ELEMENTS (atom_names)
|
#define N_ATOM_NAMES G_N_ELEMENTS (atom_names)
|
||||||
|
|
||||||
/* various flags corresponding to pre init setup calls */
|
|
||||||
static gboolean clutter_enable_stereo = FALSE;
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
check_onscreen_template (CoglRenderer *renderer,
|
|
||||||
CoglOnscreenTemplate *onscreen_template,
|
|
||||||
gboolean enable_stereo,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
GError *internal_error = NULL;
|
|
||||||
|
|
||||||
cogl_onscreen_template_set_stereo_enabled (onscreen_template,
|
|
||||||
clutter_enable_stereo);
|
|
||||||
|
|
||||||
/* cogl_renderer_check_onscreen_template() is actually just a
|
|
||||||
* shorthand for creating a CoglDisplay, and calling
|
|
||||||
* cogl_display_setup() on it, then throwing the display away. If we
|
|
||||||
* could just return that display, then it would be more efficient
|
|
||||||
* not to use cogl_renderer_check_onscreen_template(). However, the
|
|
||||||
* backend API requires that we return an CoglDisplay that has not
|
|
||||||
* yet been setup, so one way or the other we'll have to discard the
|
|
||||||
* first display and make a new fresh one.
|
|
||||||
*/
|
|
||||||
if (cogl_renderer_check_onscreen_template (renderer, onscreen_template, &internal_error))
|
|
||||||
{
|
|
||||||
clutter_enable_stereo = enable_stereo;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
|
||||||
internal_error != NULL
|
|
||||||
? internal_error->message
|
|
||||||
: "Creation of a CoglDisplay failed");
|
|
||||||
|
|
||||||
g_clear_error (&internal_error);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static CoglDisplay *
|
static CoglDisplay *
|
||||||
meta_clutter_backend_x11_get_display (ClutterBackend *clutter_backend,
|
meta_clutter_backend_x11_get_display (ClutterBackend *clutter_backend,
|
||||||
CoglRenderer *renderer,
|
CoglRenderer *renderer,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
CoglOnscreenTemplate *onscreen_template;
|
g_autoptr (CoglOnscreenTemplate) onscreen_template = NULL;
|
||||||
CoglDisplay *display = NULL;
|
CoglDisplay *display = NULL;
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
|
|
||||||
onscreen_template = cogl_onscreen_template_new ();
|
onscreen_template = cogl_onscreen_template_new ();
|
||||||
|
res = cogl_renderer_check_onscreen_template (renderer,
|
||||||
/* It's possible that the current renderer doesn't support transparency
|
onscreen_template,
|
||||||
* or doesn't support stereo, so we try the different combinations.
|
error);
|
||||||
*/
|
|
||||||
if (clutter_enable_stereo)
|
|
||||||
res = check_onscreen_template (renderer, onscreen_template,
|
|
||||||
TRUE, error);
|
|
||||||
|
|
||||||
if (!res)
|
|
||||||
res = check_onscreen_template (renderer, onscreen_template,
|
|
||||||
FALSE, error);
|
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
display = cogl_display_new (renderer, onscreen_template);
|
display = cogl_display_new (renderer, onscreen_template);
|
||||||
|
|
||||||
g_object_unref (onscreen_template);
|
|
||||||
|
|
||||||
return display;
|
return display;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,25 +188,3 @@ meta_clutter_backend_x11_new (MetaBackend *backend)
|
|||||||
|
|
||||||
return clutter_backend_x11;
|
return clutter_backend_x11;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo)
|
|
||||||
{
|
|
||||||
if (_clutter_context_is_initialized ())
|
|
||||||
{
|
|
||||||
g_warning ("%s() can only be used before calling clutter_init()",
|
|
||||||
G_STRFUNC);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_debug ("STEREO stages are %s",
|
|
||||||
use_stereo ? "enabled" : "disabled");
|
|
||||||
|
|
||||||
clutter_enable_stereo = use_stereo;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
meta_clutter_x11_get_use_stereo_stage (void)
|
|
||||||
{
|
|
||||||
return clutter_enable_stereo;
|
|
||||||
}
|
|
||||||
|
@ -57,6 +57,3 @@ G_DECLARE_FINAL_TYPE (MetaClutterBackendX11, meta_clutter_backend_x11,
|
|||||||
ClutterBackend)
|
ClutterBackend)
|
||||||
|
|
||||||
MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend);
|
MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend);
|
||||||
|
|
||||||
void meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo);
|
|
||||||
gboolean meta_clutter_x11_get_use_stereo_stage (void);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user