cogl: Remove no longer used FramebufferConfig
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
This commit is contained in:
parent
833070ab79
commit
3b386ba5d7
18 changed files with 11 additions and 139 deletions
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "cogl/cogl-display.h"
|
||||
#include "cogl/cogl-renderer.h"
|
||||
#include "cogl/cogl-onscreen-template-private.h"
|
||||
|
||||
struct _CoglDisplay
|
||||
{
|
||||
|
|
|
@ -51,10 +51,6 @@ typedef struct _CoglFramebufferDriverConfig
|
|||
gboolean disable_depth_and_stencil;
|
||||
} CoglFramebufferDriverConfig;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
} CoglFramebufferConfig;
|
||||
|
||||
/* XXX: The order of these indices determines the order they are
|
||||
* flushed.
|
||||
*
|
||||
|
@ -111,13 +107,6 @@ typedef struct _CoglFramebufferBits
|
|||
gboolean
|
||||
cogl_framebuffer_is_allocated (CoglFramebuffer *framebuffer);
|
||||
|
||||
void
|
||||
cogl_framebuffer_init_config (CoglFramebuffer *framebuffer,
|
||||
const CoglFramebufferConfig *config);
|
||||
|
||||
const CoglFramebufferConfig *
|
||||
cogl_framebuffer_get_config (CoglFramebuffer *framebuffer);
|
||||
|
||||
void
|
||||
cogl_framebuffer_update_size (CoglFramebuffer *framebuffer,
|
||||
int width,
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "cogl/cogl-util.h"
|
||||
#include "cogl/cogl-texture-private.h"
|
||||
#include "cogl/cogl-framebuffer-private.h"
|
||||
#include "cogl/cogl-onscreen-template-private.h"
|
||||
#include "cogl/cogl-clip-stack.h"
|
||||
#include "cogl/cogl-journal-private.h"
|
||||
#include "cogl/cogl-pipeline-state-private.h"
|
||||
|
@ -82,9 +81,6 @@ typedef struct _CoglFramebufferPrivate
|
|||
{
|
||||
CoglContext *context;
|
||||
|
||||
/* The user configuration before allocation... */
|
||||
CoglFramebufferConfig config;
|
||||
|
||||
CoglFramebufferDriverConfig driver_config;
|
||||
CoglFramebufferDriver *driver;
|
||||
|
||||
|
@ -293,25 +289,6 @@ cogl_framebuffer_get_internal_format (CoglFramebuffer *framebuffer)
|
|||
return priv->internal_format;
|
||||
}
|
||||
|
||||
const CoglFramebufferConfig *
|
||||
cogl_framebuffer_get_config (CoglFramebuffer *framebuffer)
|
||||
{
|
||||
CoglFramebufferPrivate *priv =
|
||||
cogl_framebuffer_get_instance_private (framebuffer);
|
||||
|
||||
return &priv->config;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_framebuffer_init_config (CoglFramebuffer *framebuffer,
|
||||
const CoglFramebufferConfig *config)
|
||||
{
|
||||
CoglFramebufferPrivate *priv =
|
||||
cogl_framebuffer_get_instance_private (framebuffer);
|
||||
|
||||
priv->config = *config;
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_framebuffer_dispose (GObject *object)
|
||||
{
|
||||
|
|
|
@ -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 "cogl/cogl-framebuffer-private.h"
|
||||
|
||||
struct _CoglOnscreenTemplate
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
CoglFramebufferConfig config;
|
||||
};
|
|
@ -32,11 +32,14 @@
|
|||
#include "config.h"
|
||||
|
||||
#include "cogl/cogl-framebuffer-private.h"
|
||||
#include "cogl/cogl-onscreen-template-private.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
G_DEFINE_TYPE (CoglOnscreenTemplate, cogl_onscreen_template, G_TYPE_OBJECT);
|
||||
struct _CoglOnscreenTemplate {
|
||||
GObject parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (CoglOnscreenTemplate, cogl_onscreen_template, G_TYPE_OBJECT);
|
||||
|
||||
static void
|
||||
cogl_onscreen_template_init (CoglOnscreenTemplate *onscreen_template)
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _CoglOnscreenTemplate CoglOnscreenTemplate;
|
||||
|
||||
#define COGL_TYPE_ONSCREEN_TEMPLATE (cogl_onscreen_template_get_type ())
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "cogl/cogl-onscreen-private.h"
|
||||
#include "cogl/cogl-frame-info-private.h"
|
||||
#include "cogl/cogl-framebuffer-private.h"
|
||||
#include "cogl/cogl-onscreen-template-private.h"
|
||||
#include "cogl/cogl-context-private.h"
|
||||
#include "cogl/cogl-closure-list-private.h"
|
||||
#include "cogl/cogl-renderer-private.h"
|
||||
|
@ -98,32 +97,6 @@ cogl_onscreen_is_y_flipped (CoglFramebuffer *framebuffer)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_onscreen_init_from_template (CoglOnscreen *onscreen,
|
||||
CoglOnscreenTemplate *onscreen_template)
|
||||
{
|
||||
CoglOnscreenPrivate *priv = cogl_onscreen_get_instance_private (onscreen);
|
||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||
|
||||
_cogl_list_init (&priv->frame_closures);
|
||||
|
||||
cogl_framebuffer_init_config (framebuffer, &onscreen_template->config);
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_onscreen_constructed (GObject *object)
|
||||
{
|
||||
CoglOnscreen *onscreen = COGL_ONSCREEN (object);
|
||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||
CoglOnscreenTemplate *onscreen_template;
|
||||
|
||||
onscreen_template = ctx->display->onscreen_template;
|
||||
cogl_onscreen_init_from_template (onscreen, onscreen_template);
|
||||
|
||||
G_OBJECT_CLASS (cogl_onscreen_parent_class)->constructed (object);
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_onscreen_dispose (GObject *object)
|
||||
{
|
||||
|
@ -143,6 +116,9 @@ cogl_onscreen_dispose (GObject *object)
|
|||
static void
|
||||
cogl_onscreen_init (CoglOnscreen *onscreen)
|
||||
{
|
||||
CoglOnscreenPrivate *priv = cogl_onscreen_get_instance_private (onscreen);
|
||||
|
||||
_cogl_list_init (&priv->frame_closures);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -151,7 +127,6 @@ cogl_onscreen_class_init (CoglOnscreenClass *klass)
|
|||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
CoglFramebufferClass *framebuffer_class = COGL_FRAMEBUFFER_CLASS (klass);
|
||||
|
||||
object_class->constructed = cogl_onscreen_constructed;
|
||||
object_class->dispose = cogl_onscreen_dispose;
|
||||
|
||||
framebuffer_class->allocate = cogl_onscreen_allocate;
|
||||
|
|
|
@ -322,7 +322,6 @@ try_creating_fbo (CoglContext *ctx,
|
|||
int texture_level,
|
||||
int texture_level_width,
|
||||
int texture_level_height,
|
||||
const CoglFramebufferConfig *config,
|
||||
CoglOffscreenAllocateFlags flags,
|
||||
CoglGlFbo *gl_fbo)
|
||||
{
|
||||
|
@ -390,7 +389,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
int texture_level;
|
||||
int level_width;
|
||||
int level_height;
|
||||
const CoglFramebufferConfig *config;
|
||||
CoglGlFbo *gl_fbo;
|
||||
CoglGlFramebufferFbo *gl_framebuffer_fbo;
|
||||
CoglOffscreenAllocateFlags allocate_flags;
|
||||
|
@ -428,8 +426,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
_cogl_texture_gl_flush_legacy_texobj_filters (texture,
|
||||
GL_NEAREST, GL_NEAREST);
|
||||
|
||||
config = cogl_framebuffer_get_config (framebuffer);
|
||||
|
||||
gl_framebuffer_fbo = g_object_new (COGL_TYPE_GL_FRAMEBUFFER_FBO,
|
||||
"framebuffer", framebuffer,
|
||||
NULL);
|
||||
|
@ -441,7 +437,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
texture_level,
|
||||
level_width,
|
||||
level_height,
|
||||
config,
|
||||
allocate_flags = 0,
|
||||
gl_fbo)) ||
|
||||
|
||||
|
@ -451,7 +446,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
texture_level,
|
||||
level_width,
|
||||
level_height,
|
||||
config,
|
||||
allocate_flags = context->last_offscreen_allocate_flags,
|
||||
gl_fbo)) ||
|
||||
|
||||
|
@ -467,7 +461,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
texture_level,
|
||||
level_width,
|
||||
level_height,
|
||||
config,
|
||||
allocate_flags = COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH_STENCIL,
|
||||
gl_fbo)) ||
|
||||
|
||||
|
@ -476,7 +469,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
texture_level,
|
||||
level_width,
|
||||
level_height,
|
||||
config,
|
||||
allocate_flags = COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH |
|
||||
COGL_OFFSCREEN_ALLOCATE_FLAG_STENCIL,
|
||||
gl_fbo) ||
|
||||
|
@ -486,7 +478,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
texture_level,
|
||||
level_width,
|
||||
level_height,
|
||||
config,
|
||||
allocate_flags = COGL_OFFSCREEN_ALLOCATE_FLAG_STENCIL,
|
||||
gl_fbo) ||
|
||||
|
||||
|
@ -495,7 +486,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
texture_level,
|
||||
level_width,
|
||||
level_height,
|
||||
config,
|
||||
allocate_flags = COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH,
|
||||
gl_fbo) ||
|
||||
|
||||
|
@ -504,7 +494,6 @@ cogl_gl_framebuffer_fbo_new (CoglFramebuffer *framebuffer,
|
|||
texture_level,
|
||||
level_width,
|
||||
level_height,
|
||||
config,
|
||||
allocate_flags = 0,
|
||||
gl_fbo))
|
||||
{
|
||||
|
|
|
@ -217,7 +217,6 @@ cogl_sources = [
|
|||
'cogl-offscreen-private.h',
|
||||
'cogl-offscreen.c',
|
||||
'cogl-onscreen-private.h',
|
||||
'cogl-onscreen-template-private.h',
|
||||
'cogl-onscreen-template.c',
|
||||
'cogl-onscreen-template.h',
|
||||
'cogl-onscreen.c',
|
||||
|
|
|
@ -54,14 +54,12 @@ cogl_onscreen_egl_choose_config (CoglOnscreenEgl *onscreen_egl,
|
|||
CoglDisplay *display = context->display;
|
||||
CoglRenderer *renderer = display->renderer;
|
||||
CoglRendererEGL *egl_renderer = renderer->winsys;
|
||||
const CoglFramebufferConfig *config;
|
||||
EGLint attributes[MAX_EGL_CONFIG_ATTRIBS];
|
||||
EGLConfig egl_config;
|
||||
EGLint config_count = 0;
|
||||
EGLBoolean status;
|
||||
|
||||
config = cogl_framebuffer_get_config (framebuffer);
|
||||
cogl_display_egl_determine_attributes (display, config, attributes);
|
||||
cogl_display_egl_determine_attributes (display, attributes);
|
||||
|
||||
status = eglChooseConfig (egl_renderer->edpy,
|
||||
attributes,
|
||||
|
|
|
@ -76,14 +76,12 @@ cogl_onscreen_glx_allocate (CoglFramebuffer *framebuffer,
|
|||
_cogl_xlib_renderer_get_data (display->renderer);
|
||||
CoglGLXRenderer *glx_renderer = display->renderer->winsys;
|
||||
Window xwin;
|
||||
const CoglFramebufferConfig *config;
|
||||
GLXFBConfig fbconfig;
|
||||
GError *fbconfig_error = NULL;
|
||||
|
||||
g_return_val_if_fail (glx_display->glx_context, FALSE);
|
||||
|
||||
config = cogl_framebuffer_get_config (framebuffer);
|
||||
if (!cogl_display_glx_find_fbconfig (display, config,
|
||||
if (!cogl_display_glx_find_fbconfig (display,
|
||||
&fbconfig,
|
||||
&fbconfig_error))
|
||||
{
|
||||
|
|
|
@ -81,7 +81,6 @@ typedef struct _CoglWinsysEGLVtable
|
|||
|
||||
int
|
||||
(* add_config_attributes) (CoglDisplay *display,
|
||||
const CoglFramebufferConfig *config,
|
||||
EGLint *attributes);
|
||||
gboolean
|
||||
(* choose_config) (CoglDisplay *display,
|
||||
|
@ -201,5 +200,4 @@ _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
|
|||
|
||||
COGL_EXPORT void
|
||||
cogl_display_egl_determine_attributes (CoglDisplay *display,
|
||||
const CoglFramebufferConfig *config,
|
||||
EGLint *attributes);
|
||||
|
|
|
@ -261,7 +261,6 @@ error:
|
|||
|
||||
static int
|
||||
_cogl_winsys_egl_add_config_attributes (CoglDisplay *display,
|
||||
const CoglFramebufferConfig *config,
|
||||
EGLint *attributes)
|
||||
{
|
||||
int i = 0;
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "cogl/cogl-framebuffer.h"
|
||||
#include "cogl/cogl-onscreen-private.h"
|
||||
#include "cogl/cogl-renderer-private.h"
|
||||
#include "cogl/cogl-onscreen-template-private.h"
|
||||
#include "cogl/cogl-private.h"
|
||||
#include "cogl/cogl-trace.h"
|
||||
#include "cogl/winsys/cogl-winsys-egl-private.h"
|
||||
|
@ -191,7 +190,6 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
|
|||
|
||||
void
|
||||
cogl_display_egl_determine_attributes (CoglDisplay *display,
|
||||
const CoglFramebufferConfig *config,
|
||||
EGLint *attributes)
|
||||
{
|
||||
CoglRenderer *renderer = display->renderer;
|
||||
|
@ -201,7 +199,6 @@ cogl_display_egl_determine_attributes (CoglDisplay *display,
|
|||
/* Let the platform add attributes first, including setting the
|
||||
* EGL_SURFACE_TYPE */
|
||||
i = egl_renderer->platform_vtable->add_config_attributes (display,
|
||||
config,
|
||||
attributes);
|
||||
|
||||
attributes[i++] = EGL_STENCIL_SIZE;
|
||||
|
@ -312,7 +309,6 @@ try_create_context (CoglDisplay *display,
|
|||
cogl_renderer_bind_api (renderer);
|
||||
|
||||
cogl_display_egl_determine_attributes (display,
|
||||
&display->onscreen_template->config,
|
||||
cfg_attribs);
|
||||
|
||||
edpy = egl_renderer->edpy;
|
||||
|
|
|
@ -35,7 +35,6 @@ _cogl_winsys_glx_get_vtable (void);
|
|||
|
||||
gboolean
|
||||
cogl_display_glx_find_fbconfig (CoglDisplay *display,
|
||||
const CoglFramebufferConfig *config,
|
||||
GLXFBConfig *config_ret,
|
||||
GError **error);
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "cogl/cogl-context-private.h"
|
||||
#include "cogl/cogl-framebuffer.h"
|
||||
#include "cogl/cogl-renderer-private.h"
|
||||
#include "cogl/cogl-onscreen-template-private.h"
|
||||
#include "cogl/cogl-private.h"
|
||||
#include "cogl/cogl-texture-2d-private.h"
|
||||
#include "cogl/cogl-frame-info-private.h"
|
||||
|
@ -495,7 +494,6 @@ update_winsys_features (CoglContext *context, GError **error)
|
|||
|
||||
static void
|
||||
glx_attributes_from_framebuffer_config (CoglDisplay *display,
|
||||
const CoglFramebufferConfig *config,
|
||||
int *attributes)
|
||||
{
|
||||
int i = 0;
|
||||
|
@ -532,7 +530,6 @@ glx_attributes_from_framebuffer_config (CoglDisplay *display,
|
|||
* an explicit boolean status. */
|
||||
gboolean
|
||||
cogl_display_glx_find_fbconfig (CoglDisplay *display,
|
||||
const CoglFramebufferConfig *config,
|
||||
GLXFBConfig *config_ret,
|
||||
GError **error)
|
||||
{
|
||||
|
@ -545,7 +542,7 @@ cogl_display_glx_find_fbconfig (CoglDisplay *display,
|
|||
gboolean ret = TRUE;
|
||||
int xscreen_num = DefaultScreen (xlib_renderer->xdpy);
|
||||
|
||||
glx_attributes_from_framebuffer_config (display, config, attributes);
|
||||
glx_attributes_from_framebuffer_config (display, attributes);
|
||||
|
||||
configs = glx_renderer->glXChooseFBConfig (xlib_renderer->xdpy,
|
||||
xscreen_num,
|
||||
|
@ -652,7 +649,6 @@ create_context (CoglDisplay *display, GError **error)
|
|||
|
||||
glx_display->found_fbconfig =
|
||||
cogl_display_glx_find_fbconfig (display,
|
||||
&display->onscreen_template->config,
|
||||
&config,
|
||||
&fbconfig_error);
|
||||
if (!glx_display->found_fbconfig)
|
||||
|
|
|
@ -2074,7 +2074,6 @@ choose_onscreen_egl_config (CoglOnscreen *onscreen,
|
|||
g_return_val_if_fail (META_IS_KMS_PLANE (kms_plane), FALSE);
|
||||
|
||||
cogl_display_egl_determine_attributes (cogl_display,
|
||||
&cogl_display->onscreen_template->config,
|
||||
attrs);
|
||||
|
||||
/* Secondary GPU contexts use GLES3, which doesn't guarantee that 10 bpc
|
||||
|
|
|
@ -338,7 +338,6 @@ fail:
|
|||
|
||||
static int
|
||||
meta_renderer_native_add_egl_config_attributes (CoglDisplay *cogl_display,
|
||||
const CoglFramebufferConfig *config,
|
||||
EGLint *attributes)
|
||||
{
|
||||
CoglRendererEGL *cogl_renderer_egl = cogl_display->renderer->winsys;
|
||||
|
|
Loading…
Reference in a new issue