mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
2006-07-27 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-feature.c: No need to call clutter_feature_init() each time: it's private and should never be seen from the outside; add a warning, just in case something screws up and calls it more than once.
This commit is contained in:
parent
ad29f37780
commit
3146bdbf16
@ -1,3 +1,10 @@
|
||||
2006-07-27 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-feature.c: No need to call clutter_feature_init()
|
||||
each time: it's private and should never be seen from the outside;
|
||||
add a warning, just in case something screws up and calls it more
|
||||
than once.
|
||||
|
||||
2006-07-27 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-private.h: Move clutter_feature_init()
|
||||
|
@ -34,8 +34,7 @@
|
||||
#include "clutter-feature.h"
|
||||
#include "string.h"
|
||||
|
||||
G_LOCK_DEFINE_STATIC (__features);
|
||||
static ClutterFeatureFlags __features;
|
||||
static ClutterFeatureFlags __features = -1;
|
||||
|
||||
/* Note must be called after context created */
|
||||
static gboolean
|
||||
@ -66,12 +65,15 @@ check_gl_extension (const gchar *name)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* HOLDS: __features lock */
|
||||
static void
|
||||
clutter_feature_init_do (void)
|
||||
void
|
||||
clutter_feature_init (void)
|
||||
{
|
||||
if (__features)
|
||||
return;
|
||||
if (__features != -1)
|
||||
{
|
||||
g_warning ("You should never call clutter_feature_init() "
|
||||
"more than once.");
|
||||
return;
|
||||
}
|
||||
|
||||
__features = 0;
|
||||
|
||||
@ -79,14 +81,6 @@ clutter_feature_init_do (void)
|
||||
__features |= CLUTTER_FEATURE_TEXTURE_RECTANGLE;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_feature_init (void)
|
||||
{
|
||||
G_LOCK (__features);
|
||||
clutter_feature_init_do ();
|
||||
G_UNLOCK (__features);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_feature_available:
|
||||
* @feature: a #ClutterFeatureFlags
|
||||
@ -101,7 +95,6 @@ clutter_feature_init (void)
|
||||
gboolean
|
||||
clutter_feature_available (ClutterFeatureFlags feature)
|
||||
{
|
||||
clutter_feature_init ();
|
||||
return (__features & feature);
|
||||
}
|
||||
|
||||
@ -117,6 +110,5 @@ clutter_feature_available (ClutterFeatureFlags feature)
|
||||
ClutterFeatureFlags
|
||||
clutter_feature_all (void)
|
||||
{
|
||||
clutter_feature_init ();
|
||||
return __features;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user