1
0
Fork 0

cogl: Drop CoglSwapChain

CoglSwapChain is currently unused, and doesn't hold any information
nor is used for anything in particular.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3759>
This commit is contained in:
Georges Basile Stavracas Neto 2024-05-20 11:12:49 +02:00 committed by Marge Bot
parent c13956fb9e
commit 638d3355b4
16 changed files with 5 additions and 202 deletions

View file

@ -69,7 +69,6 @@ struct _ClutterBackendClass
GError **error);
CoglDisplay * (* get_display) (ClutterBackend *backend,
CoglRenderer *renderer,
CoglSwapChain *swap_chain,
GError **error);
gboolean (* create_context) (ClutterBackend *backend,
GError **error);

View file

@ -118,12 +118,9 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
GError **error)
{
ClutterBackendClass *klass;
CoglSwapChain *swap_chain;
klass = CLUTTER_BACKEND_GET_CLASS (backend);
swap_chain = NULL;
CLUTTER_NOTE (BACKEND, "Creating Cogl renderer");
backend->cogl_renderer = klass->get_renderer (backend, error);
@ -135,15 +132,11 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
if (!cogl_renderer_connect (backend->cogl_renderer, error))
goto error;
CLUTTER_NOTE (BACKEND, "Creating Cogl swap chain");
swap_chain = cogl_swap_chain_new ();
CLUTTER_NOTE (BACKEND, "Creating Cogl display");
if (klass->get_display != NULL)
{
backend->cogl_display = klass->get_display (backend,
backend->cogl_renderer,
swap_chain,
error);
}
else
@ -151,7 +144,7 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
CoglOnscreenTemplate *tmpl;
gboolean res;
tmpl = cogl_onscreen_template_new (swap_chain);
tmpl = cogl_onscreen_template_new ();
/* XXX: I have some doubts that this is a good design.
*
@ -185,7 +178,6 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
/* the display owns the renderer and the swap chain */
g_object_unref (backend->cogl_renderer);
g_object_unref (swap_chain);
return TRUE;
@ -193,9 +185,6 @@ error:
g_clear_object (&backend->cogl_display);
g_clear_object (&backend->cogl_renderer);
if (swap_chain != NULL)
g_object_unref (swap_chain);
return FALSE;
}

View file

@ -129,7 +129,7 @@ cogl_display_set_onscreen_template (CoglDisplay *display,
/* NB: we want to maintain the invariable that there is always an
* onscreen template associated with a CoglDisplay... */
if (!onscreen_template)
display->onscreen_template = cogl_onscreen_template_new (NULL);
display->onscreen_template = cogl_onscreen_template_new ();
}
gboolean

View file

@ -53,7 +53,6 @@ struct _CoglFramebufferDriverConfig
typedef struct
{
CoglSwapChain *swap_chain;
gboolean need_stencil;
int samples_per_pixel;
gboolean stereo_enabled;

View file

@ -322,7 +322,6 @@ cogl_framebuffer_init_config (CoglFramebuffer *framebuffer,
cogl_framebuffer_get_instance_private (framebuffer);
priv->config = *config;
g_object_ref (priv->config.swap_chain);
}
static void

View file

@ -30,7 +30,6 @@
#pragma once
#include "cogl/cogl-swap-chain.h"
#include "cogl/cogl-framebuffer-private.h"
struct _CoglOnscreenTemplate

View file

@ -49,17 +49,11 @@ cogl_onscreen_template_class_init (CoglOnscreenTemplateClass *class)
}
CoglOnscreenTemplate *
cogl_onscreen_template_new (CoglSwapChain *swap_chain)
cogl_onscreen_template_new (void)
{
CoglOnscreenTemplate *onscreen_template = g_object_new (COGL_TYPE_ONSCREEN_TEMPLATE, NULL);
char *user_config;
onscreen_template->config.swap_chain = swap_chain;
if (swap_chain)
g_object_ref (swap_chain);
else
onscreen_template->config.swap_chain = cogl_swap_chain_new ();
onscreen_template->config.need_stencil = TRUE;
onscreen_template->config.samples_per_pixel = 0;

View file

@ -36,8 +36,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
#include "cogl/cogl-swap-chain.h"
#include <glib-object.h>
G_BEGIN_DECLS
@ -51,7 +49,7 @@ G_DECLARE_FINAL_TYPE (CoglOnscreenTemplate, cogl_onscreen_template,
COGL, ONSCREEN_TEMPLATE, GObject)
COGL_EXPORT CoglOnscreenTemplate *
cogl_onscreen_template_new (CoglSwapChain *swap_chain);
cogl_onscreen_template_new (void);
/**
* cogl_onscreen_template_set_samples_per_pixel:

View file

@ -1,40 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2011 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
*/
#pragma once
#include <glib-object.h>
struct _CoglSwapChain
{
GObject parent_instance;
int length;
};

View file

@ -1,64 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2011 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Robert Bragg <robert@linux.intel.com>
*/
#include "config.h"
#include "cogl/cogl-swap-chain-private.h"
#include "cogl/cogl-swap-chain.h"
G_DEFINE_TYPE (CoglSwapChain, cogl_swap_chain, G_TYPE_OBJECT);
static void
cogl_swap_chain_init (CoglSwapChain *swap_chain)
{
}
static void
cogl_swap_chain_class_init (CoglSwapChainClass *class)
{
}
CoglSwapChain *
cogl_swap_chain_new (void)
{
CoglSwapChain *swap_chain = g_object_new (COGL_TYPE_SWAP_CHAIN, NULL);
swap_chain->length = -1; /* no preference */
return swap_chain;
}
void
cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
int length)
{
swap_chain->length = length;
}

View file

@ -1,61 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2011 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma once
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
#error "Only <cogl/cogl.h> can be included directly."
#endif
#include "cogl/cogl-types.h"
#include <glib-object.h>
G_BEGIN_DECLS
typedef struct _CoglSwapChain CoglSwapChain;
#define COGL_TYPE_SWAP_CHAIN (cogl_swap_chain_get_type ())
COGL_EXPORT
G_DECLARE_FINAL_TYPE (CoglSwapChain, cogl_swap_chain,
COGL, SWAP_CHAIN, GObject)
COGL_EXPORT CoglSwapChain *
cogl_swap_chain_new (void);
COGL_EXPORT void
cogl_swap_chain_set_has_alpha (CoglSwapChain *swap_chain,
gboolean has_alpha);
COGL_EXPORT void
cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
int length);
G_END_DECLS

View file

@ -62,7 +62,6 @@
#include "cogl/cogl-mutter.h"
#endif
#include "cogl/cogl-swap-chain.h"
#include "cogl/cogl-renderer.h"
#include "cogl/cogl-output.h"
#include "cogl/cogl-display.h"

View file

@ -56,7 +56,6 @@ cogl_headers = [
'cogl-scanout.h',
'cogl-snippet.h',
'cogl-sub-texture.h',
'cogl-swap-chain.h',
'cogl-texture-2d.h',
'cogl-texture-2d-sliced.h',
'cogl-texture.h',
@ -280,9 +279,6 @@ cogl_sources = [
'cogl-spans.h',
'cogl-sub-texture-private.h',
'cogl-sub-texture.c',
'cogl-swap-chain-private.h',
'cogl-swap-chain.c',
'cogl-swap-chain.h',
'cogl-texture-2d-private.h',
'cogl-texture-2d-sliced-private.h',
'cogl-texture-2d-sliced.c',

View file

@ -38,7 +38,6 @@
#include "cogl/cogl-context-private.h"
#include "cogl/cogl-framebuffer.h"
#include "cogl/cogl-onscreen-private.h"
#include "cogl/cogl-swap-chain-private.h"
#include "cogl/cogl-renderer-private.h"
#include "cogl/cogl-onscreen-template-private.h"
#include "cogl/cogl-egl.h"

View file

@ -37,7 +37,6 @@
#include "cogl/cogl-feature-private.h"
#include "cogl/cogl-context-private.h"
#include "cogl/cogl-framebuffer.h"
#include "cogl/cogl-swap-chain-private.h"
#include "cogl/cogl-renderer-private.h"
#include "cogl/cogl-onscreen-template-private.h"
#include "cogl/cogl-private.h"
@ -45,7 +44,6 @@
#include "cogl/cogl-frame-info-private.h"
#include "cogl/cogl-framebuffer-private.h"
#include "cogl/cogl-onscreen-private.h"
#include "cogl/cogl-swap-chain-private.h"
#include "cogl/cogl-xlib-renderer.h"
#include "cogl/cogl-util.h"
#include "cogl/cogl-poll-private.h"

View file

@ -110,14 +110,13 @@ check_onscreen_template (CoglRenderer *renderer,
static CoglDisplay *
meta_clutter_backend_x11_get_display (ClutterBackend *clutter_backend,
CoglRenderer *renderer,
CoglSwapChain *swap_chain,
GError **error)
{
CoglOnscreenTemplate *onscreen_template;
CoglDisplay *display = NULL;
gboolean res = FALSE;
onscreen_template = cogl_onscreen_template_new (swap_chain);
onscreen_template = cogl_onscreen_template_new ();
/* It's possible that the current renderer doesn't support transparency
* or doesn't support stereo, so we try the different combinations.