2008-02-04 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-actor.c:
	* clutter/clutter-shader.c: Small documentation and style fixes

	* tests/test-scale.c: Constify the gravities array.
This commit is contained in:
Emmanuele Bassi 2008-02-04 22:35:38 +00:00
parent 209793c7a3
commit 2764fa2f87
4 changed files with 23 additions and 22 deletions

View File

@ -1,3 +1,10 @@
2008-02-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
* clutter/clutter-shader.c: Small documentation and style fixes
* tests/test-scale.c: Constify the gravities array.
2008-02-04 Chris Lord <chris@openedhand.com> 2008-02-04 Chris Lord <chris@openedhand.com>
* clutter/clutter-actor.c: (clutter_actor_transform_stage_point): * clutter/clutter-actor.c: (clutter_actor_transform_stage_point):

View File

@ -1218,9 +1218,9 @@ clutter_actor_set_property (GObject *object,
static void static void
clutter_actor_get_property (GObject *object, clutter_actor_get_property (GObject *object,
guint prop_id, guint prop_id,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
ClutterActor *actor; ClutterActor *actor;
ClutterActorPrivate *priv; ClutterActorPrivate *priv;
@ -5033,11 +5033,11 @@ destroy_shader_data (ClutterActor *self)
/** /**
* clutter_actor_get_shader: * clutter_actor_get_shader:
* @self: a #ClutterActor * @self: a #ClutterActor
* @shader: a #ClutterShader or %NULL
* *
* Queries the currently set #ClutterShader on @self. * Queries the currently set #ClutterShader on @self.
* *
* Return value: The currently set #ClutterShader or NULL if no shader is set. * Return value: The currently set #ClutterShader or %NULL if no
* shader is set.
* *
* Since: 0.6 * Since: 0.6
*/ */
@ -5053,9 +5053,8 @@ clutter_actor_get_shader (ClutterActor *self)
shader_data = actor_priv->shader_data; shader_data = actor_priv->shader_data;
if (!shader_data) if (!shader_data)
{ return NULL;
return NULL;
}
return shader_data->shader; return shader_data->shader;
} }
@ -5109,7 +5108,6 @@ clutter_actor_set_shader (ClutterActor *self,
shader_data->shader = g_object_ref (shader); shader_data->shader = g_object_ref (shader);
} }
clutter_actor_queue_redraw (self); clutter_actor_queue_redraw (self);
return TRUE; return TRUE;

View File

@ -340,10 +340,7 @@ clutter_shader_set_fragment_source (ClutterShader *shader,
is_glsl = !g_str_has_prefix (data, "!!ARBfp"); is_glsl = !g_str_has_prefix (data, "!!ARBfp");
if (priv->fragment_source) g_free (priv->fragment_source);
{
g_free (priv->fragment_source);
}
CLUTTER_NOTE (SHADER, "setting fragment shader (GLSL:%s, len:%" CLUTTER_NOTE (SHADER, "setting fragment shader (GLSL:%s, len:%"
G_GSSIZE_FORMAT ")", G_GSSIZE_FORMAT ")",
@ -387,13 +384,9 @@ clutter_shader_set_vertex_source (ClutterShader *shader,
if (clutter_shader_is_bound (shader)) if (clutter_shader_is_bound (shader))
clutter_shader_release (shader); clutter_shader_release (shader);
is_glsl = !g_str_has_prefix (data, "!!ARBvp"); is_glsl = !g_str_has_prefix (data, "!!ARBvp");
if (priv->vertex_source) g_free (priv->vertex_source);
{
g_free (priv->vertex_source);
}
CLUTTER_NOTE (SHADER, "setting vertex shader (GLSL:%s, len:%" CLUTTER_NOTE (SHADER, "setting vertex shader (GLSL:%s, len:%"
G_GSSIZE_FORMAT ")", G_GSSIZE_FORMAT ")",

View File

@ -1,7 +1,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <clutter/clutter.h> #include <clutter/clutter.h>
ClutterGravity gravities[] = { static const ClutterGravity gravities[] = {
CLUTTER_GRAVITY_NORTH_EAST, CLUTTER_GRAVITY_NORTH_EAST,
CLUTTER_GRAVITY_NORTH, CLUTTER_GRAVITY_NORTH,
CLUTTER_GRAVITY_NORTH_WEST, CLUTTER_GRAVITY_NORTH_WEST,
@ -14,9 +14,9 @@ ClutterGravity gravities[] = {
CLUTTER_GRAVITY_NONE CLUTTER_GRAVITY_NONE
}; };
gint gindex = 0; static gint gindex = 0;
void static void
on_timeline_completed (ClutterTimeline *cluttertimeline, on_timeline_completed (ClutterTimeline *cluttertimeline,
gpointer data) gpointer data)
{ {
@ -59,7 +59,7 @@ main (int argc, char *argv[])
clutter_group_add (CLUTTER_GROUP (stage), rect); clutter_group_add (CLUTTER_GROUP (stage), rect);
timeline = clutter_timeline_new (20, 30); timeline = clutter_timeline_new_for_duration (750);
alpha = clutter_alpha_new_full (timeline, alpha = clutter_alpha_new_full (timeline,
CLUTTER_ALPHA_RAMP, CLUTTER_ALPHA_RAMP,
NULL, NULL); NULL, NULL);
@ -79,5 +79,8 @@ main (int argc, char *argv[])
clutter_main(); clutter_main();
g_object_unref (timeline);
g_object_unref (behave);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }