diff --git a/clutter/clutter/clutter-backend-private.h b/clutter/clutter/clutter-backend-private.h index 88bb3ea5f..95e992ac0 100644 --- a/clutter/clutter/clutter-backend-private.h +++ b/clutter/clutter/clutter-backend-private.h @@ -71,7 +71,6 @@ struct _ClutterBackendClass ClutterStageWindow * (* create_stage) (ClutterBackend *backend, ClutterStage *wrapper, GError **error); - void (* init_features) (ClutterBackend *backend); CoglRenderer * (* get_renderer) (ClutterBackend *backend, GError **error); CoglDisplay * (* get_display) (ClutterBackend *backend, diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h index 99debc1c1..a5c9d6ad0 100644 --- a/clutter/clutter/clutter-enums.h +++ b/clutter/clutter/clutter-enums.h @@ -903,20 +903,6 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/ CLUTTER_SCROLL_SMOOTH } ClutterScrollDirection; -/** - * ClutterFeatureFlags: - * @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders. - * - * Runtime flags indicating specific features available via Clutter window - * system and graphics backend. - * - * Since: 0.4 - */ -typedef enum -{ - CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9), -} ClutterFeatureFlags; - /** * ClutterFlowOrientation: * @CLUTTER_FLOW_HORIZONTAL: Arrange the children of the flow layout diff --git a/clutter/clutter/clutter-feature.c b/clutter/clutter/clutter-feature.c deleted file mode 100644 index 8d216529d..000000000 --- a/clutter/clutter/clutter-feature.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * - */ - -/** - * SECTION:clutter-feature - * @short_description: Run-time detection of Clutter features - * - * Parts of Clutter depend on the underlying platform, including the - * capabilities of the backend used and the OpenGL features exposed through the - * Clutter and COGL API. - * - * It is possible to ask whether Clutter has support for specific features at - * run-time. - */ - -#include "clutter-build-config.h" - -#include -#include -#include - -#include "clutter-backend-private.h" -#include "clutter-feature.h" -#include "clutter-main.h" -#include "clutter-private.h" -#include "clutter-debug.h" - -#include "cogl/cogl.h" - -typedef struct ClutterFeatures -{ - ClutterFeatureFlags flags; - guint features_set : 1; -} ClutterFeatures; - -static ClutterFeatures* __features = NULL; - -static ClutterFeatureFlags -clutter_features_from_cogl (void) -{ - ClutterFeatureFlags clutter_flags = 0; - - clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL; - - return clutter_flags; -} - -gboolean -clutter_feature_init (ClutterMainContext *context, - GError **error) -{ - CLUTTER_NOTE (MISC, "checking features"); - - if (!__features) - { - CLUTTER_NOTE (MISC, "allocating features data"); - __features = g_new0 (ClutterFeatures, 1); - __features->features_set = FALSE; /* don't rely on zero-ing */ - } - - if (__features->features_set) - return TRUE; - - /* makes sure we have a GL context; if we have, this is a no-op */ - if (!_clutter_backend_create_context (context->backend, error)) - return FALSE; - - __features->flags = clutter_features_from_cogl (); - - __features->features_set = TRUE; - - CLUTTER_NOTE (MISC, "features checked"); - - return TRUE; -} - -/** - * clutter_feature_available: - * @feature: a #ClutterFeatureFlags - * - * Checks whether @feature is available. @feature can be a logical - * OR of #ClutterFeatureFlags. - * - * Return value: %TRUE if a feature is available - * - * Since: 0.2 - */ -gboolean -clutter_feature_available (ClutterFeatureFlags feature) -{ - if (G_UNLIKELY (!__features)) - { - g_critical ("Unable to check features. Have you initialized Clutter?"); - return FALSE; - } - - return (__features->flags & feature); -} - -/** - * clutter_feature_get_all: - * - * Returns all the supported features. - * - * Return value: a logical OR of all the supported features. - * - * Since: 0.2 - */ -ClutterFeatureFlags -clutter_feature_get_all (void) -{ - if (G_UNLIKELY (!__features)) - { - g_critical ("Unable to check features. Have you initialized Clutter?"); - return FALSE; - } - - return __features->flags; -} - diff --git a/clutter/clutter/clutter-feature.h b/clutter/clutter/clutter-feature.h deleted file mode 100644 index 5c1b12449..000000000 --- a/clutter/clutter/clutter-feature.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifndef __CLUTTER_FEATURE_H__ -#define __CLUTTER_FEATURE_H__ - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#include - -G_BEGIN_DECLS - -CLUTTER_EXPORT -gboolean clutter_feature_available (ClutterFeatureFlags feature); -CLUTTER_EXPORT -ClutterFeatureFlags clutter_feature_get_all (void); - -G_END_DECLS - -#endif /* __CLUTTER_FEATURE_H__ */ diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index 5b01783e5..d1aec04e5 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -55,7 +55,6 @@ #include "clutter-backend-private.h" #include "clutter-debug.h" #include "clutter-event-private.h" -#include "clutter-feature.h" #include "clutter-input-device-private.h" #include "clutter-input-pointer-a11y-private.h" #include "clutter-graphene.h" @@ -522,10 +521,7 @@ clutter_init_real (ClutterMainContext *clutter_context, if (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION) g_message ("Enabling damaged region"); - /* this will take care of initializing Cogl's state and - * query the GL machinery for features - */ - if (!clutter_feature_init (clutter_context, error)) + if (!_clutter_backend_create_context (clutter_context->backend, error)) return FALSE; clutter_text_direction = clutter_get_text_direction (); diff --git a/clutter/clutter/clutter-private.h b/clutter/clutter/clutter-private.h index 117902a35..f16333e0a 100644 --- a/clutter/clutter/clutter-private.h +++ b/clutter/clutter/clutter-private.h @@ -34,7 +34,6 @@ #include "clutter-backend.h" #include "clutter-effect.h" #include "clutter-event.h" -#include "clutter-feature.h" #include "clutter-id-pool.h" #include "clutter-layout-manager.h" #include "clutter-settings.h" @@ -167,9 +166,6 @@ CLUTTER_EXPORT gboolean _clutter_context_is_initialized (void); gboolean _clutter_context_get_show_fps (void); -gboolean clutter_feature_init (ClutterMainContext *clutter_context, - GError **error); - /* Diagnostic mode */ gboolean _clutter_diagnostic_enabled (void); void _clutter_diagnostic_message (const char *fmt, ...) G_GNUC_PRINTF (1, 2); diff --git a/clutter/clutter/clutter-shader-effect.c b/clutter/clutter/clutter-shader-effect.c index a23480567..b2e577b63 100644 --- a/clutter/clutter/clutter-shader-effect.c +++ b/clutter/clutter/clutter-shader-effect.c @@ -119,7 +119,6 @@ #include "clutter-debug.h" #include "clutter-enum-types.h" -#include "clutter-feature.h" #include "clutter-private.h" #include "clutter-shader-types.h" diff --git a/clutter/clutter/clutter.h b/clutter/clutter/clutter.h index be788b9e5..0d43ce478 100644 --- a/clutter/clutter/clutter.h +++ b/clutter/clutter/clutter.h @@ -59,7 +59,6 @@ #include "clutter-enums.h" #include "clutter-enum-types.h" #include "clutter-event.h" -#include "clutter-feature.h" #include "clutter-fixed-layout.h" #include "clutter-flow-layout.h" #include "clutter-frame-clock.h" diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build index 2b8764a0f..f30edadd5 100644 --- a/clutter/clutter/meson.build +++ b/clutter/clutter/meson.build @@ -33,7 +33,6 @@ clutter_headers = [ 'clutter-effect.h', 'clutter-enums.h', 'clutter-event.h', - 'clutter-feature.h', 'clutter-fixed-layout.h', 'clutter-flow-layout.h', 'clutter-frame-clock.h', @@ -123,7 +122,6 @@ clutter_sources = [ 'clutter-desaturate-effect.c', 'clutter-effect.c', 'clutter-event.c', - 'clutter-feature.c', 'clutter-fixed-layout.c', 'clutter-flatten-effect.c', 'clutter-flow-layout.c',