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:
Emmanuele Bassi 2006-07-27 17:10:33 +00:00
parent ad29f37780
commit 3146bdbf16
2 changed files with 16 additions and 17 deletions

View File

@ -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()

View File

@ -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;
}