diff --git a/clutter/clutter/clutter-backend.c b/clutter/clutter/clutter-backend.c index c38cffc09..d430742dc 100644 --- a/clutter/clutter/clutter-backend.c +++ b/clutter/clutter/clutter-backend.c @@ -140,27 +140,7 @@ clutter_backend_do_real_create_context (ClutterBackend *backend, } else { - CoglOnscreenTemplate *tmpl; - gboolean res; - - tmpl = cogl_onscreen_template_new (); - - /* XXX: I have some doubts that this is a good design. - * - * Conceptually should we be able to check an onscreen_template - * without more details about the CoglDisplay configuration? - */ - res = cogl_renderer_check_onscreen_template (backend->cogl_renderer, - tmpl, - error); - - if (!res) - goto error; - - backend->cogl_display = cogl_display_new (backend->cogl_renderer, tmpl); - - /* the display owns the template */ - g_object_unref (tmpl); + backend->cogl_display = cogl_display_new (backend->cogl_renderer); } if (backend->cogl_display == NULL) diff --git a/cogl/cogl/cogl-display-private.h b/cogl/cogl/cogl-display-private.h index 15c4aaaa0..f6d331fed 100644 --- a/cogl/cogl/cogl-display-private.h +++ b/cogl/cogl/cogl-display-private.h @@ -41,7 +41,6 @@ struct _CoglDisplay gboolean setup; CoglRenderer *renderer; - CoglOnscreenTemplate *onscreen_template; void *winsys; }; diff --git a/cogl/cogl/cogl-display.c b/cogl/cogl/cogl-display.c index 796031db8..54387a00d 100644 --- a/cogl/cogl/cogl-display.c +++ b/cogl/cogl/cogl-display.c @@ -63,7 +63,6 @@ cogl_display_dispose (GObject *object) } g_clear_object (&display->renderer); - g_clear_object (&display->onscreen_template); G_OBJECT_CLASS (cogl_display_parent_class)->dispose (object); } @@ -82,8 +81,7 @@ cogl_display_class_init (CoglDisplayClass *class) } CoglDisplay * -cogl_display_new (CoglRenderer *renderer, - CoglOnscreenTemplate *onscreen_template) +cogl_display_new (CoglRenderer *renderer) { g_return_val_if_fail (renderer != NULL, NULL); @@ -93,8 +91,6 @@ cogl_display_new (CoglRenderer *renderer, renderer->display = display; display->setup = FALSE; - cogl_display_set_onscreen_template (display, onscreen_template); - return display; } @@ -104,26 +100,6 @@ cogl_display_get_renderer (CoglDisplay *display) return display->renderer; } -void -cogl_display_set_onscreen_template (CoglDisplay *display, - CoglOnscreenTemplate *onscreen_template) -{ - g_return_if_fail (display->setup == FALSE); - - if (onscreen_template) - g_object_ref (onscreen_template); - - if (display->onscreen_template) - g_object_unref (display->onscreen_template); - - display->onscreen_template = onscreen_template; - - /* 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 (); -} - gboolean cogl_display_setup (CoglDisplay *display, GError **error) diff --git a/cogl/cogl/cogl-display.h b/cogl/cogl/cogl-display.h index fa6f9ec65..dadf106e7 100644 --- a/cogl/cogl/cogl-display.h +++ b/cogl/cogl/cogl-display.h @@ -37,7 +37,6 @@ #endif #include "cogl/cogl-renderer.h" -#include "cogl/cogl-onscreen-template.h" #include @@ -80,7 +79,6 @@ G_DECLARE_FINAL_TYPE (CoglDisplay, /** * cogl_display_new: * @renderer: A #CoglRenderer - * @onscreen_template: A #CoglOnscreenTemplate * * Explicitly allocates a new #CoglDisplay object to encapsulate the * common state of the display pipeline that applies to the whole @@ -89,11 +87,6 @@ G_DECLARE_FINAL_TYPE (CoglDisplay, * A @display can only be made for a specific choice of renderer which * is why this takes the @renderer argument. * - * A common use for explicitly allocating a display object is to - * define a template for allocating onscreen framebuffers which is - * what the @onscreen_template argument is for, or alternatively - * you can use cogl_display_set_onscreen_template(). - * * When a display is first allocated via cogl_display_new() it is in a * mutable configuration mode. It's designed this way so we can * extend the apis available for configuring a display without @@ -111,8 +104,7 @@ G_DECLARE_FINAL_TYPE (CoglDisplay, * object in a mutable configuration mode. */ COGL_EXPORT CoglDisplay * -cogl_display_new (CoglRenderer *renderer, - CoglOnscreenTemplate *onscreen_template); +cogl_display_new (CoglRenderer *renderer); /** * cogl_display_get_renderer: @@ -126,23 +118,6 @@ cogl_display_new (CoglRenderer *renderer, COGL_EXPORT CoglRenderer * cogl_display_get_renderer (CoglDisplay *display); -/** - * cogl_display_set_onscreen_template: - * @display: a #CoglDisplay - * @onscreen_template: A template for creating #CoglOnscreen framebuffers - * - * Specifies a template for creating #CoglOnscreen framebuffers. - * - * Depending on the system, the constraints for creating #CoglOnscreen - * framebuffers need to be known before setting up a #CoglDisplay because the - * final setup of the display may constrain how onscreen framebuffers may be - * allocated. If Cogl knows how an application wants to allocate onscreen - * framebuffers then it can try to make sure to setup the display accordingly. - */ -COGL_EXPORT void -cogl_display_set_onscreen_template (CoglDisplay *display, - CoglOnscreenTemplate *onscreen_template); - /** * cogl_display_setup: * @display: a #CoglDisplay diff --git a/cogl/cogl/cogl-onscreen-template.c b/cogl/cogl/cogl-onscreen-template.c deleted file mode 100644 index b516945b9..000000000 --- a/cogl/cogl/cogl-onscreen-template.c +++ /dev/null @@ -1,60 +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 - */ - -#include "config.h" - -#include "cogl/cogl-framebuffer-private.h" - -#include - -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) -{ -} - -static void -cogl_onscreen_template_class_init (CoglOnscreenTemplateClass *class) -{ -} - -CoglOnscreenTemplate * -cogl_onscreen_template_new (void) -{ - CoglOnscreenTemplate *onscreen_template = g_object_new (COGL_TYPE_ONSCREEN_TEMPLATE, NULL); - - return onscreen_template; -} diff --git a/cogl/cogl/cogl-onscreen-template.h b/cogl/cogl/cogl-onscreen-template.h deleted file mode 100644 index 84563f5f3..000000000 --- a/cogl/cogl/cogl-onscreen-template.h +++ /dev/null @@ -1,53 +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 - * - */ - -#pragma once - -#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION) -#error "Only can be included directly." -#endif - -#include - -G_BEGIN_DECLS - - -#define COGL_TYPE_ONSCREEN_TEMPLATE (cogl_onscreen_template_get_type ()) - -COGL_EXPORT -G_DECLARE_FINAL_TYPE (CoglOnscreenTemplate, cogl_onscreen_template, - COGL, ONSCREEN_TEMPLATE, GObject) - -COGL_EXPORT CoglOnscreenTemplate * -cogl_onscreen_template_new (void); - -G_END_DECLS diff --git a/cogl/cogl/cogl-renderer.c b/cogl/cogl/cogl-renderer.c index 7feab4b20..2ed04ee2d 100644 --- a/cogl/cogl/cogl-renderer.c +++ b/cogl/cogl/cogl-renderer.c @@ -215,28 +215,6 @@ cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer, } #endif /* HAVE_X11 */ -gboolean -cogl_renderer_check_onscreen_template (CoglRenderer *renderer, - CoglOnscreenTemplate *onscreen_template, - GError **error) -{ - CoglDisplay *display; - - if (!cogl_renderer_connect (renderer, error)) - return FALSE; - - display = cogl_display_new (renderer, onscreen_template); - if (!cogl_display_setup (display, error)) - { - g_object_unref (display); - return FALSE; - } - - g_object_unref (display); - - return TRUE; -} - typedef gboolean (*CoglDriverCallback) (CoglDriverDescription *description, void *user_data); diff --git a/cogl/cogl/cogl-renderer.h b/cogl/cogl/cogl-renderer.h index 369011abc..c910732b5 100644 --- a/cogl/cogl/cogl-renderer.h +++ b/cogl/cogl/cogl-renderer.h @@ -33,7 +33,6 @@ #endif #include "cogl/cogl-types.h" -#include "cogl/cogl-onscreen-template.h" #include "cogl/cogl-pixel-format.h" #include @@ -156,23 +155,6 @@ typedef enum COGL_EXPORT CoglWinsysID cogl_renderer_get_winsys_id (CoglRenderer *renderer); -/** - * cogl_renderer_check_onscreen_template: - * @renderer: A #CoglRenderer - * @onscreen_template: A #CoglOnscreenTemplate - * @error: A pointer to a #GError for reporting exceptions - * - * Tests if a given @onscreen_template can be supported with the given - * @renderer. - * - * Return value: %TRUE if the @onscreen_template can be supported, - * else %FALSE. - */ -COGL_EXPORT gboolean -cogl_renderer_check_onscreen_template (CoglRenderer *renderer, - CoglOnscreenTemplate *onscreen_template, - GError **error); - /* Final connection API */ /** diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build index 69c815de5..c29dca724 100644 --- a/cogl/cogl/meson.build +++ b/cogl/cogl/meson.build @@ -41,7 +41,6 @@ cogl_headers = [ 'cogl-meta-texture.h', 'cogl-offscreen.h', 'cogl-onscreen.h', - 'cogl-onscreen-template.h', 'cogl-pipeline.h', 'cogl-pipeline-layer-state.h', 'cogl-pipeline-state.h', @@ -217,8 +216,6 @@ cogl_sources = [ 'cogl-offscreen-private.h', 'cogl-offscreen.c', 'cogl-onscreen-private.h', - 'cogl-onscreen-template.c', - 'cogl-onscreen-template.h', 'cogl-onscreen.c', 'cogl-pipeline-cache-private.h', 'cogl-pipeline-cache.c', diff --git a/src/backends/x11/meta-clutter-backend-x11.c b/src/backends/x11/meta-clutter-backend-x11.c index bbf5d8ff0..86ed9dcfe 100644 --- a/src/backends/x11/meta-clutter-backend-x11.c +++ b/src/backends/x11/meta-clutter-backend-x11.c @@ -71,19 +71,7 @@ meta_clutter_backend_x11_get_display (ClutterBackend *clutter_backend, CoglRenderer *renderer, GError **error) { - g_autoptr (CoglOnscreenTemplate) onscreen_template = NULL; - CoglDisplay *display = NULL; - gboolean res = FALSE; - - onscreen_template = cogl_onscreen_template_new (); - res = cogl_renderer_check_onscreen_template (renderer, - onscreen_template, - error); - - if (res) - display = cogl_display_new (renderer, onscreen_template); - - return display; + return cogl_display_new (renderer); } static CoglRenderer *