mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
Merge branch 'master' into msvc-support-master
This commit is contained in:
commit
b55656b698
@ -96,6 +96,8 @@ ClutterAction *clutter_actor_get_action (ClutterActor *self,
|
||||
GList * clutter_actor_get_actions (ClutterActor *self);
|
||||
void clutter_actor_clear_actions (ClutterActor *self);
|
||||
|
||||
gboolean clutter_actor_has_actions (ClutterActor *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_ACTION_H__ */
|
||||
|
@ -75,6 +75,8 @@ void _clutter_meta_group_clear_metas (ClutterMetaGroup *group
|
||||
ClutterActorMeta * _clutter_meta_group_get_meta (ClutterMetaGroup *group,
|
||||
const gchar *name);
|
||||
|
||||
gboolean _clutter_meta_group_has_metas_no_internal (ClutterMetaGroup *group);
|
||||
|
||||
GList * _clutter_meta_group_get_metas_no_internal (ClutterMetaGroup *group);
|
||||
void _clutter_meta_group_clear_metas_no_internal (ClutterMetaGroup *group);
|
||||
|
||||
|
@ -552,6 +552,27 @@ _clutter_meta_group_get_metas_no_internal (ClutterMetaGroup *group)
|
||||
return g_list_reverse (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_meta_group_has_metas_no_internal:
|
||||
* @group: a #ClutterMetaGroup
|
||||
*
|
||||
* Returns whether the group has any metas that don't have an internal priority.
|
||||
*
|
||||
* Return value: %TRUE if metas without internal priority exist
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
_clutter_meta_group_has_metas_no_internal (ClutterMetaGroup *group)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = group->meta; l; l = l->next)
|
||||
if (!_clutter_actor_meta_is_internal (l->data))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_meta_group_clear_metas:
|
||||
* @group: a #ClutterMetaGroup
|
||||
|
@ -12452,6 +12452,66 @@ clutter_actor_has_overlaps (ClutterActor *self)
|
||||
return CLUTTER_ACTOR_GET_CLASS (self)->has_overlaps (self);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_has_effects:
|
||||
* @self: A #ClutterActor
|
||||
*
|
||||
* Returns whether the actor has any effects applied.
|
||||
*
|
||||
* Return value: %TRUE if the actor has any effects,
|
||||
* %FALSE otherwise
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
gboolean
|
||||
clutter_actor_has_effects (ClutterActor *self)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), TRUE);
|
||||
|
||||
if (self->priv->effects == NULL)
|
||||
return FALSE;
|
||||
|
||||
return _clutter_meta_group_has_metas_no_internal (self->priv->effects);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_has_constraints:
|
||||
* @self: A #ClutterActor
|
||||
*
|
||||
* Returns whether the actor has any constraints applied.
|
||||
*
|
||||
* Return value: %TRUE if the actor has any constraints,
|
||||
* %FALSE otherwise
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
gboolean
|
||||
clutter_actor_has_constraints (ClutterActor *self)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), TRUE);
|
||||
|
||||
return self->priv->constraints != NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_has_actions:
|
||||
* @self: A #ClutterActor
|
||||
*
|
||||
* Returns whether the actor has any actions applied.
|
||||
*
|
||||
* Return value: %TRUE if the actor has any actions,
|
||||
* %FALSE otherwise
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
gboolean
|
||||
clutter_actor_has_actions (ClutterActor *self)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), TRUE);
|
||||
|
||||
return self->priv->actions != NULL;
|
||||
}
|
||||
|
||||
gint
|
||||
_clutter_actor_get_n_children (ClutterActor *self)
|
||||
{
|
||||
|
@ -101,6 +101,8 @@ ClutterConstraint *clutter_actor_get_constraint (ClutterActor *s
|
||||
const gchar *name);
|
||||
void clutter_actor_clear_constraints (ClutterActor *self);
|
||||
|
||||
gboolean clutter_actor_has_constraints (ClutterActor *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_CONSTRAINT_H__ */
|
||||
|
@ -126,6 +126,8 @@ ClutterEffect *clutter_actor_get_effect (ClutterActor *self,
|
||||
const gchar *name);
|
||||
void clutter_actor_clear_effects (ClutterActor *self);
|
||||
|
||||
gboolean clutter_actor_has_effects (ClutterActor *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_EFFECT_H__ */
|
||||
|
@ -44,6 +44,8 @@
|
||||
* Sets @value to @fixed_.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use g_value_set_int() instead.
|
||||
*/
|
||||
void
|
||||
clutter_value_set_fixed (GValue *value,
|
||||
@ -63,6 +65,8 @@ clutter_value_set_fixed (GValue *value,
|
||||
* Return value: the value inside the passed #GValue
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use g_value_get_int() instead.
|
||||
*/
|
||||
CoglFixed
|
||||
clutter_value_get_fixed (const GValue *value)
|
||||
@ -164,9 +168,11 @@ clutter_param_fixed_get_type (void)
|
||||
*
|
||||
* Creates a #GParamSpec for properties using #CoglFixed values
|
||||
*
|
||||
* Return value: the newly created #GParamSpec
|
||||
* Return value: (transfer full): the newly created #GParamSpec
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use #GParamSpecInt instead.
|
||||
*/
|
||||
GParamSpec *
|
||||
clutter_param_spec_fixed (const gchar *name,
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_PARAM_FIXED (clutter_param_fixed_get_type ())
|
||||
#define CLUTTER_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), CLUTTER_TYPE_PARAM_FIXED, ClutterParamSpecFixed))
|
||||
#define CLUTTER_IS_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), CLUTTER_TYPE_PARAM_FIXED))
|
||||
@ -45,6 +47,8 @@ G_BEGIN_DECLS
|
||||
* Evaluates to %TRUE if @x holds a #CoglFixed .
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use %G_VALUE_HOLDS_INT instead
|
||||
*/
|
||||
#define CLUTTER_VALUE_HOLDS_FIXED(x) (G_VALUE_HOLDS ((x), COGL_TYPE_FIXED))
|
||||
|
||||
@ -59,6 +63,8 @@ typedef struct _ClutterParamSpecFixed ClutterParamSpecFixed;
|
||||
* #GParamSpec subclass for fixed point based properties
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: Use #GParamSpecInt instead
|
||||
*/
|
||||
struct _ClutterParamSpecFixed
|
||||
{
|
||||
@ -86,6 +92,8 @@ GParamSpec * clutter_param_spec_fixed (const gchar *name,
|
||||
GParamFlags flags);
|
||||
|
||||
|
||||
#endif /* DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_FIXED_H__ */
|
||||
|
@ -77,7 +77,7 @@
|
||||
* multi-threaded environment is to never access the API from a thread that
|
||||
* did not call clutter_init() and clutter_main().</para>
|
||||
* <para>The common pattern for using threads with Clutter is to use worker
|
||||
* threads to perform blocking operations and then install idle or timeour
|
||||
* threads to perform blocking operations and then install idle or timeout
|
||||
* sources with the result when the thread finished.</para>
|
||||
* <para>Clutter provides thread-aware variants of g_idle_add() and
|
||||
* g_timeout_add() that acquire the Clutter lock before invoking the provided
|
||||
|
@ -654,6 +654,9 @@ _clutter_paint_volume_complete (ClutterPaintVolume *pv)
|
||||
if (pv->is_empty)
|
||||
return;
|
||||
|
||||
if (pv->is_complete)
|
||||
return;
|
||||
|
||||
/* Find the vector that takes us from any vertex on the left face to
|
||||
* the corresponding vertex on the right face. */
|
||||
dx_l2r = pv->vertices[1].x - pv->vertices[0].x;
|
||||
|
@ -37,36 +37,43 @@
|
||||
* <refsect2 id="ClutterShaderEffect-implementing">
|
||||
* <title>Implementing a ClutterShaderEffect</title>
|
||||
* <para>Creating a sub-class of #ClutterShaderEffect requires the
|
||||
* overriding of the <function>pre_paint()</function> virtual function
|
||||
* from the #ClutterEffect class.</para>
|
||||
* <para>The <function>pre_paint()</function> should set the shader's
|
||||
* source and eventually set the uniforms. The sub-class should call
|
||||
* clutter_shader_effect_set_shader_source() to set the shader source
|
||||
* code, and clutter_shader_effect_set_uniform_value() or
|
||||
* clutter_shader_effect_set_uniform() to set the values of the shader
|
||||
* uniforms, if any; the sub-class should then chain up to the
|
||||
* #ClutterShaderEffect implementation.</para>
|
||||
* overriding of the <function>paint_target()</function> virtual
|
||||
* function from the #ClutterOffscreenEffect class as well as the
|
||||
* <function>get_static_shader_source()</function> virtual from the
|
||||
* #ClutterShaderEffect class.</para>
|
||||
* <para>The <function>get_static_shader_source()</function>
|
||||
* function should return a copy of the shader source to use. This
|
||||
* function is only called once per subclass of #ClutterShaderEffect
|
||||
* regardless of how many instances of the effect are created. The
|
||||
* source for the shader is typically stored in a static const
|
||||
* string which is returned from this function via
|
||||
* g_strdup().</para>
|
||||
* <para>The <function>paint_target()</function> should set the
|
||||
* shader's uniforms if any. This is done by calling
|
||||
* clutter_shader_effect_set_uniform_value() or
|
||||
* clutter_shader_effect_set_uniform(). The sub-class should then
|
||||
* chain up to the #ClutterShaderEffect implementation.</para>
|
||||
* <example id="ClutterShaderEffect-example-uniforms">
|
||||
* <title>Setting uniforms on a ClutterShaderEffect</title>
|
||||
* <para>The example below shows a typical implementation of the
|
||||
* <function>pre_paint()</function> phase of a #ClutterShaderEffect
|
||||
* sub-class.</para>
|
||||
* <function>get_static_shader_source()</function> and
|
||||
* <function>paint_target()</function> phases of a
|
||||
* #ClutterShaderEffect sub-class.</para>
|
||||
* <programlisting>
|
||||
* static gchar *
|
||||
* my_effect_get_static_shader_source (ClutterShaderEffect *effect)
|
||||
* {
|
||||
* return g_strdup (shader_source);
|
||||
* }
|
||||
*
|
||||
* static gboolean
|
||||
* my_effect_pre_paint (ClutterEffect *effect)
|
||||
* my_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
* {
|
||||
* MyEffect *self = MY_EFFECT (effect);
|
||||
* ClutterShaderEffect *shader = CLUTTER_SHADER_EFFECT (effect);
|
||||
* ClutterEffectClass *parent_class;
|
||||
* gfloat component_r, component_g, component_b;
|
||||
*
|
||||
* /* if the effect is not enabled we can bail out now */
|
||||
* if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||
* return FALSE;
|
||||
*
|
||||
* /* this function is a no-op after the first call */
|
||||
* clutter_shader_effect_set_shader_source (shader, shader_source);
|
||||
*
|
||||
* /* the "tex" uniform is declared in the shader as:
|
||||
* *
|
||||
* * uniform int tex;
|
||||
@ -92,8 +99,8 @@
|
||||
* component_b);
|
||||
*
|
||||
* /* chain up to the parent's implementation */
|
||||
* parent_class = CLUTTER_EFFECT_CLASS (my_effect_parent_class);
|
||||
* return parent_class->pre_paint (effect);
|
||||
* parent_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (my_effect_parent_class);
|
||||
* return parent_class->paint_target (effect);
|
||||
* }
|
||||
* </programlisting>
|
||||
* </example>
|
||||
@ -134,11 +141,18 @@ struct _ClutterShaderEffectPrivate
|
||||
CoglHandle shader;
|
||||
|
||||
GHashTable *uniforms;
|
||||
|
||||
guint is_compiled : 1;
|
||||
guint source_set : 1;
|
||||
};
|
||||
|
||||
typedef struct _ClutterShaderEffectClassPrivate
|
||||
{
|
||||
/* These are the per-class pre-compiled shader and program which is
|
||||
used when the class implements get_static_shader_source without
|
||||
calling set_shader_source. They will be shared by all instances
|
||||
of this class */
|
||||
CoglHandle program;
|
||||
CoglHandle shader;
|
||||
} ClutterShaderEffectClassPrivate;
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
@ -150,9 +164,11 @@ enum
|
||||
|
||||
static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
G_DEFINE_TYPE (ClutterShaderEffect,
|
||||
clutter_shader_effect,
|
||||
CLUTTER_TYPE_OFFSCREEN_EFFECT);
|
||||
G_DEFINE_TYPE_WITH_CODE (ClutterShaderEffect,
|
||||
clutter_shader_effect,
|
||||
CLUTTER_TYPE_OFFSCREEN_EFFECT,
|
||||
g_type_add_class_private (g_define_type_id,
|
||||
sizeof (ClutterShaderEffectClassPrivate)))
|
||||
|
||||
static inline void
|
||||
clutter_shader_effect_clear (ClutterShaderEffect *self,
|
||||
@ -160,15 +176,18 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
|
||||
{
|
||||
ClutterShaderEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->shader != COGL_INVALID_HANDLE && !priv->is_compiled)
|
||||
cogl_handle_unref (priv->shader);
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_handle_unref (priv->shader);
|
||||
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (priv->program != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_handle_unref (priv->program);
|
||||
|
||||
priv->program = COGL_INVALID_HANDLE;
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (reset_uniforms && priv->uniforms != NULL)
|
||||
@ -178,8 +197,6 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
|
||||
}
|
||||
|
||||
priv->actor = NULL;
|
||||
priv->is_compiled = FALSE;
|
||||
priv->source_set = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -298,52 +315,102 @@ clutter_shader_effect_set_actor (ClutterActorMeta *meta,
|
||||
G_OBJECT_TYPE_NAME (meta));
|
||||
}
|
||||
|
||||
static CoglHandle
|
||||
clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
||||
{
|
||||
ClutterShaderEffectPrivate *priv = self->priv;
|
||||
|
||||
switch (priv->shader_type)
|
||||
{
|
||||
case CLUTTER_FRAGMENT_SHADER:
|
||||
return cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
|
||||
break;
|
||||
|
||||
case CLUTTER_VERTEX_SHADER:
|
||||
return cogl_create_shader (COGL_SHADER_TYPE_VERTEX);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
{
|
||||
ClutterShaderEffectPrivate *priv = self->priv;
|
||||
ClutterShaderEffectClass *shader_effect_class =
|
||||
CLUTTER_SHADER_EFFECT_GET_CLASS (self);
|
||||
|
||||
if (shader_effect_class->get_static_shader_source != NULL)
|
||||
{
|
||||
ClutterShaderEffectClassPrivate *class_priv;
|
||||
|
||||
class_priv =
|
||||
G_TYPE_CLASS_GET_PRIVATE (shader_effect_class,
|
||||
CLUTTER_TYPE_SHADER_EFFECT,
|
||||
ClutterShaderEffectClassPrivate);
|
||||
|
||||
if (class_priv->shader == COGL_INVALID_HANDLE)
|
||||
{
|
||||
gchar *source;
|
||||
|
||||
class_priv->shader = clutter_shader_effect_create_shader (self);
|
||||
|
||||
source = shader_effect_class->get_static_shader_source (self);
|
||||
|
||||
cogl_shader_source (class_priv->shader, source);
|
||||
|
||||
g_free (source);
|
||||
|
||||
CLUTTER_NOTE (SHADER, "Compiling shader effect");
|
||||
|
||||
cogl_shader_compile (class_priv->shader);
|
||||
|
||||
if (cogl_shader_is_compiled (class_priv->shader))
|
||||
{
|
||||
class_priv->program = cogl_create_program ();
|
||||
|
||||
cogl_program_attach_shader (class_priv->program,
|
||||
class_priv->shader);
|
||||
|
||||
cogl_program_link (class_priv->program);
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *log_buf = cogl_shader_get_info_log (class_priv->shader);
|
||||
|
||||
g_warning ("Unable to compile the GLSL shader: %s", log_buf);
|
||||
g_free (log_buf);
|
||||
}
|
||||
}
|
||||
|
||||
priv->shader = cogl_handle_ref (class_priv->shader);
|
||||
|
||||
if (class_priv->program != COGL_INVALID_HANDLE)
|
||||
priv->program = cogl_handle_ref (class_priv->program);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_shader_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterShaderEffectPrivate *priv = CLUTTER_SHADER_EFFECT (effect)->priv;
|
||||
ClutterShaderEffect *self = CLUTTER_SHADER_EFFECT (effect);
|
||||
ClutterShaderEffectPrivate *priv = self->priv;
|
||||
ClutterOffscreenEffectClass *parent;
|
||||
CoglHandle material;
|
||||
|
||||
/* If the source hasn't been set then we'll try to get it from the
|
||||
static source instead */
|
||||
if (priv->shader == COGL_INVALID_HANDLE)
|
||||
clutter_shader_effect_try_static_source (self);
|
||||
|
||||
/* we haven't been prepared or we don't have support for
|
||||
* GLSL shaders in Clutter
|
||||
*/
|
||||
if (priv->program == COGL_INVALID_HANDLE ||
|
||||
priv->shader == COGL_INVALID_HANDLE)
|
||||
if (priv->program == COGL_INVALID_HANDLE)
|
||||
goto out;
|
||||
|
||||
if (!priv->source_set)
|
||||
goto out;
|
||||
|
||||
if (!priv->is_compiled)
|
||||
{
|
||||
CLUTTER_NOTE (SHADER, "Compiling shader effect");
|
||||
|
||||
cogl_shader_compile (priv->shader);
|
||||
if (!cogl_shader_is_compiled (priv->shader))
|
||||
{
|
||||
gchar *log_buf = cogl_shader_get_info_log (priv->shader);
|
||||
|
||||
g_warning ("Unable to compile the GLSL shader: %s", log_buf);
|
||||
g_free (log_buf);
|
||||
|
||||
cogl_handle_unref (priv->shader);
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
|
||||
cogl_handle_unref (priv->program);
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
cogl_program_attach_shader (priv->program, priv->shader);
|
||||
cogl_handle_unref (priv->shader);
|
||||
|
||||
cogl_program_link (priv->program);
|
||||
|
||||
priv->is_compiled = TRUE;
|
||||
}
|
||||
|
||||
CLUTTER_NOTE (SHADER, "Applying the shader effect of type '%s'",
|
||||
G_OBJECT_TYPE_NAME (effect));
|
||||
|
||||
@ -566,12 +633,6 @@ clutter_shader_effect_add_uniform (ClutterShaderEffect *effect,
|
||||
else
|
||||
shader_uniform_update (uniform, value);
|
||||
|
||||
if (priv->is_compiled)
|
||||
{
|
||||
uniform->location =
|
||||
cogl_program_get_uniform_location (priv->program, uniform->name);
|
||||
}
|
||||
|
||||
if (priv->actor != NULL && !CLUTTER_ACTOR_IN_PAINT (priv->actor))
|
||||
clutter_actor_queue_redraw (priv->actor);
|
||||
}
|
||||
@ -832,35 +893,32 @@ clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
||||
|
||||
priv = effect->priv;
|
||||
|
||||
if (priv->source_set)
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
return TRUE;
|
||||
|
||||
if (priv->program == COGL_INVALID_HANDLE)
|
||||
priv->program = cogl_create_program ();
|
||||
|
||||
if (priv->shader == COGL_INVALID_HANDLE)
|
||||
{
|
||||
switch (priv->shader_type)
|
||||
{
|
||||
case CLUTTER_FRAGMENT_SHADER:
|
||||
priv->shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
|
||||
break;
|
||||
|
||||
case CLUTTER_VERTEX_SHADER:
|
||||
priv->shader = cogl_create_shader (COGL_SHADER_TYPE_VERTEX);
|
||||
break;
|
||||
|
||||
default:
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_assert (priv->shader != COGL_INVALID_HANDLE);
|
||||
priv->shader = clutter_shader_effect_create_shader (effect);
|
||||
|
||||
cogl_shader_source (priv->shader, source);
|
||||
|
||||
priv->source_set = TRUE;
|
||||
CLUTTER_NOTE (SHADER, "Compiling shader effect");
|
||||
|
||||
cogl_shader_compile (priv->shader);
|
||||
|
||||
if (cogl_shader_is_compiled (priv->shader))
|
||||
{
|
||||
priv->program = cogl_create_program ();
|
||||
|
||||
cogl_program_attach_shader (priv->program, priv->shader);
|
||||
|
||||
cogl_program_link (priv->program);
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *log_buf = cogl_shader_get_info_log (priv->shader);
|
||||
|
||||
g_warning ("Unable to compile the GLSL shader: %s", log_buf);
|
||||
g_free (log_buf);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -62,6 +62,11 @@ struct _ClutterShaderEffect
|
||||
|
||||
/**
|
||||
* ClutterShaderEffectClass:
|
||||
* @get_static_shader_source: Returns the GLSL source code to use for
|
||||
* instances of this shader effect. Note that this function is only
|
||||
* called once per subclass of #ClutterShaderEffect regardless of how
|
||||
* many instances are used. It is expected that subclasses will return
|
||||
* a copy of a static string from this function.
|
||||
*
|
||||
* The <structname>ClutterShaderEffectClass</structname> structure contains
|
||||
* only private data
|
||||
@ -73,13 +78,16 @@ struct _ClutterShaderEffectClass
|
||||
/*< private >*/
|
||||
ClutterOffscreenEffectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
gchar * (* get_static_shader_source) (ClutterShaderEffect *effect);
|
||||
|
||||
/*< private >*/
|
||||
/* padding */
|
||||
void (*_clutter_shader1) (void);
|
||||
void (*_clutter_shader2) (void);
|
||||
void (*_clutter_shader3) (void);
|
||||
void (*_clutter_shader4) (void);
|
||||
void (*_clutter_shader5) (void);
|
||||
void (*_clutter_shader6) (void);
|
||||
};
|
||||
|
||||
GType clutter_shader_effect_get_type (void) G_GNUC_CONST;
|
||||
|
184
po/fr.po
184
po/fr.po
@ -10,7 +10,7 @@ msgstr ""
|
||||
"Project-Id-Version: clutter 1.3.14\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=clutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2011-09-23 14:34+0000\n"
|
||||
"POT-Creation-Date: 2011-10-01 11:10+0000\n"
|
||||
"PO-Revision-Date: 2011-09-12 22:43+0200 \n"
|
||||
"Last-Translator: Bruno Brouard <annoa.b@gmail.com>\n"
|
||||
"Language-Team: GNOME French Team <gnomefr@traduc.org>\n"
|
||||
@ -403,6 +403,14 @@ msgstr "Contraintes"
|
||||
msgid "Adds a constraint to the actor"
|
||||
msgstr "Ajoute une contrainte à l'acteur"
|
||||
|
||||
#: ../clutter/clutter-actor.c:4733
|
||||
msgid "Effect"
|
||||
msgstr "Effet"
|
||||
|
||||
#: ../clutter/clutter-actor.c:4734
|
||||
msgid "Add an effect to be applied on the actor"
|
||||
msgstr "Ajoute un effet à appliquer à l'acteur"
|
||||
|
||||
#: ../clutter/clutter-actor-meta.c:193 ../clutter/clutter-child-meta.c:142
|
||||
msgid "Actor"
|
||||
msgstr "Acteur"
|
||||
@ -779,7 +787,7 @@ msgid "The layout manager used by the box"
|
||||
msgstr "Le gestionnaire de disposition utilisé par la boite"
|
||||
|
||||
#: ../clutter/clutter-box.c:564 ../clutter/clutter-rectangle.c:267
|
||||
#: ../clutter/clutter-stage.c:1778
|
||||
#: ../clutter/clutter-stage.c:1790
|
||||
msgid "Color"
|
||||
msgstr "Couleur"
|
||||
|
||||
@ -974,27 +982,27 @@ msgstr "Teinte"
|
||||
msgid "The tint to apply"
|
||||
msgstr "La teinte à appliquer"
|
||||
|
||||
#: ../clutter/clutter-deform-effect.c:527
|
||||
#: ../clutter/clutter-deform-effect.c:547
|
||||
msgid "Horizontal Tiles"
|
||||
msgstr "Tuiles horizontal"
|
||||
|
||||
#: ../clutter/clutter-deform-effect.c:528
|
||||
#: ../clutter/clutter-deform-effect.c:548
|
||||
msgid "The number of horizontal tiles"
|
||||
msgstr "Le nombre de tuiles horizontales"
|
||||
|
||||
#: ../clutter/clutter-deform-effect.c:543
|
||||
#: ../clutter/clutter-deform-effect.c:563
|
||||
msgid "Vertical Tiles"
|
||||
msgstr "Tuiles verticales"
|
||||
|
||||
#: ../clutter/clutter-deform-effect.c:544
|
||||
#: ../clutter/clutter-deform-effect.c:564
|
||||
msgid "The number of vertical tiles"
|
||||
msgstr "Le nombre de tuiles verticales"
|
||||
|
||||
#: ../clutter/clutter-deform-effect.c:561
|
||||
#: ../clutter/clutter-deform-effect.c:581
|
||||
msgid "Back Material"
|
||||
msgstr "Matériau de l'arrière"
|
||||
|
||||
#: ../clutter/clutter-deform-effect.c:562
|
||||
#: ../clutter/clutter-deform-effect.c:582
|
||||
msgid "The material to be used when painting the back of the actor"
|
||||
msgstr "Le matériau à utiliser lors du dessin de l'arrière de l'acteur"
|
||||
|
||||
@ -1181,65 +1189,66 @@ msgstr "Gestionnaire"
|
||||
msgid "The manager that created this data"
|
||||
msgstr "Le gestionnaire qui a créé ces données"
|
||||
|
||||
#. Translate to default:RTL if you want your widgets
|
||||
#. * to be RTL, otherwise translate to default:LTR.
|
||||
#. Translators: Leave this UNTRANSLATED if your language is
|
||||
#. * left-to-right. If your language is right-to-left
|
||||
#. * (e.g. Hebrew, Arabic), translate it to "default:RTL".
|
||||
#. *
|
||||
#. * Do *not* translate it to "predefinito:LTR": if it
|
||||
#. * it isn't default:LTR or default:RTL it will not work
|
||||
#. * Do NOT translate it to non-English e.g. "predefinito:LTR"! If
|
||||
#. * it isn't default:LTR or default:RTL it will not work.
|
||||
#.
|
||||
#: ../clutter/clutter-main.c:492
|
||||
#: ../clutter/clutter-main.c:494
|
||||
msgid "default:LTR"
|
||||
msgstr "default:LTR"
|
||||
|
||||
#: ../clutter/clutter-main.c:1323
|
||||
#: ../clutter/clutter-main.c:1325
|
||||
msgid "Show frames per second"
|
||||
msgstr "Afficher le nombre d'images par seconde"
|
||||
|
||||
#: ../clutter/clutter-main.c:1325
|
||||
#: ../clutter/clutter-main.c:1327
|
||||
msgid "Default frame rate"
|
||||
msgstr "Nombre d'images par seconde par défaut"
|
||||
|
||||
#: ../clutter/clutter-main.c:1327
|
||||
#: ../clutter/clutter-main.c:1329
|
||||
msgid "Make all warnings fatal"
|
||||
msgstr "Rendre tous les avertissements fatals"
|
||||
|
||||
#: ../clutter/clutter-main.c:1330
|
||||
#: ../clutter/clutter-main.c:1332
|
||||
msgid "Direction for the text"
|
||||
msgstr "Sens des textes"
|
||||
|
||||
#: ../clutter/clutter-main.c:1333
|
||||
#: ../clutter/clutter-main.c:1335
|
||||
msgid "Disable mipmapping on text"
|
||||
msgstr "Désactiver le MIP mapping pour le texte"
|
||||
|
||||
#: ../clutter/clutter-main.c:1336
|
||||
#: ../clutter/clutter-main.c:1338
|
||||
msgid "Use 'fuzzy' picking"
|
||||
msgstr "Utiliser la sélection « approximative »"
|
||||
|
||||
#: ../clutter/clutter-main.c:1339
|
||||
#: ../clutter/clutter-main.c:1341
|
||||
msgid "Clutter debugging flags to set"
|
||||
msgstr "Drapeau de débogage de Clutter à activer"
|
||||
|
||||
#: ../clutter/clutter-main.c:1341
|
||||
#: ../clutter/clutter-main.c:1343
|
||||
msgid "Clutter debugging flags to unset"
|
||||
msgstr "Drapeau de débogage de Clutter à désactiver"
|
||||
|
||||
#: ../clutter/clutter-main.c:1345
|
||||
#: ../clutter/clutter-main.c:1347
|
||||
msgid "Clutter profiling flags to set"
|
||||
msgstr "Drapeau de profilage de Clutter à activer"
|
||||
|
||||
#: ../clutter/clutter-main.c:1347
|
||||
#: ../clutter/clutter-main.c:1349
|
||||
msgid "Clutter profiling flags to unset"
|
||||
msgstr "Drapeau de profilage de Clutter à désactiver"
|
||||
|
||||
#: ../clutter/clutter-main.c:1350
|
||||
#: ../clutter/clutter-main.c:1352
|
||||
msgid "Enable accessibility"
|
||||
msgstr "Activer l'accessibilité"
|
||||
|
||||
#: ../clutter/clutter-main.c:1532
|
||||
#: ../clutter/clutter-main.c:1534
|
||||
msgid "Clutter Options"
|
||||
msgstr "Options de Clutter"
|
||||
|
||||
#: ../clutter/clutter-main.c:1533
|
||||
#: ../clutter/clutter-main.c:1535
|
||||
msgid "Show Clutter Options"
|
||||
msgstr "Afficher les options de Clutter"
|
||||
|
||||
@ -1355,7 +1364,7 @@ msgstr "« Filename » défini"
|
||||
msgid "Whether the :filename property is set"
|
||||
msgstr "Indique si la propriété :filename est définie"
|
||||
|
||||
#: ../clutter/clutter-script.c:449 ../clutter/clutter-texture.c:1081
|
||||
#: ../clutter/clutter-script.c:449 ../clutter/clutter-texture.c:1067
|
||||
msgid "Filename"
|
||||
msgstr "Nom de fichier"
|
||||
|
||||
@ -1467,8 +1476,9 @@ msgstr "Durée avant masquage du mot de passe"
|
||||
|
||||
#: ../clutter/clutter-settings.c:612
|
||||
msgid "How long to show the last input character in hidden entries"
|
||||
msgstr "Pendant combien de temps il faut afficher le dernier caractère saisi "
|
||||
"dans les entrées masquées"
|
||||
msgstr ""
|
||||
"Pendant combien de temps il faut afficher le dernier caractère saisi dans "
|
||||
"les entrées masquées"
|
||||
|
||||
#: ../clutter/clutter-shader.c:255
|
||||
msgid "Vertex Source"
|
||||
@ -1511,11 +1521,11 @@ msgstr "Shader vertex"
|
||||
msgid "Fragment shader"
|
||||
msgstr "Shader fragment"
|
||||
|
||||
#: ../clutter/clutter-shader-effect.c:415
|
||||
#: ../clutter/clutter-shader-effect.c:482
|
||||
msgid "Shader Type"
|
||||
msgstr "Type de shader"
|
||||
|
||||
#: ../clutter/clutter-shader-effect.c:416
|
||||
#: ../clutter/clutter-shader-effect.c:483
|
||||
msgid "The type of shader used"
|
||||
msgstr "Le type de shader utilisé"
|
||||
|
||||
@ -1543,106 +1553,106 @@ msgstr "Le bord de la source qui doit être attrapé"
|
||||
msgid "The offset in pixels to apply to the constraint"
|
||||
msgstr "Le décalage, en pixels, à appliquer à la contrainte"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1720
|
||||
#: ../clutter/clutter-stage.c:1732
|
||||
msgid "Fullscreen Set"
|
||||
msgstr "Plein écran renseigné"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1721
|
||||
#: ../clutter/clutter-stage.c:1733
|
||||
msgid "Whether the main stage is fullscreen"
|
||||
msgstr "Indique si la scène principale est en plein écran"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1737
|
||||
#: ../clutter/clutter-stage.c:1749
|
||||
msgid "Offscreen"
|
||||
msgstr "Hors écran"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1738
|
||||
#: ../clutter/clutter-stage.c:1750
|
||||
msgid "Whether the main stage should be rendered offscreen"
|
||||
msgstr "Indique si la scène principale doit être rendue hors écran"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1750 ../clutter/clutter-text.c:3108
|
||||
#: ../clutter/clutter-stage.c:1762 ../clutter/clutter-text.c:3108
|
||||
msgid "Cursor Visible"
|
||||
msgstr "Curseur visible"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1751
|
||||
#: ../clutter/clutter-stage.c:1763
|
||||
msgid "Whether the mouse pointer is visible on the main stage"
|
||||
msgstr ""
|
||||
"Indique si le pointeur de la souris est visible sur la scène principale"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1765
|
||||
#: ../clutter/clutter-stage.c:1777
|
||||
msgid "User Resizable"
|
||||
msgstr "Redimensionnable par l'utilisateur"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1766
|
||||
#: ../clutter/clutter-stage.c:1778
|
||||
msgid "Whether the stage is able to be resized via user interaction"
|
||||
msgstr ""
|
||||
"Indique si la scène peut être redimensionnée par des interactions de "
|
||||
"l'utilisateur"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1779
|
||||
#: ../clutter/clutter-stage.c:1791
|
||||
msgid "The color of the stage"
|
||||
msgstr "La couleur de la scène"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1793
|
||||
#: ../clutter/clutter-stage.c:1805
|
||||
msgid "Perspective"
|
||||
msgstr "Perspective"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1794
|
||||
#: ../clutter/clutter-stage.c:1806
|
||||
msgid "Perspective projection parameters"
|
||||
msgstr "Paramètres de projection de la perspective"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1809
|
||||
#: ../clutter/clutter-stage.c:1821
|
||||
msgid "Title"
|
||||
msgstr "Titre"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1810
|
||||
#: ../clutter/clutter-stage.c:1822
|
||||
msgid "Stage Title"
|
||||
msgstr "Titre de la scène"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1825
|
||||
#: ../clutter/clutter-stage.c:1837
|
||||
msgid "Use Fog"
|
||||
msgstr "Utiliser le brouillard"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1826
|
||||
#: ../clutter/clutter-stage.c:1838
|
||||
msgid "Whether to enable depth cueing"
|
||||
msgstr "Indique s'il faut activer la troncature d'arrière-plan"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1840
|
||||
#: ../clutter/clutter-stage.c:1852
|
||||
msgid "Fog"
|
||||
msgstr "Brouillard"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1841
|
||||
#: ../clutter/clutter-stage.c:1853
|
||||
msgid "Settings for the depth cueing"
|
||||
msgstr "Paramétrages de la troncature d'arrière-plan"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1857
|
||||
#: ../clutter/clutter-stage.c:1869
|
||||
msgid "Use Alpha"
|
||||
msgstr "Utiliser l'alpha"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1858
|
||||
#: ../clutter/clutter-stage.c:1870
|
||||
msgid "Whether to honour the alpha component of the stage color"
|
||||
msgstr "S'il faut respecter le composant alpha de la couleur de la scène"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1874
|
||||
#: ../clutter/clutter-stage.c:1886
|
||||
msgid "Key Focus"
|
||||
msgstr "Focus clavier"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1875
|
||||
#: ../clutter/clutter-stage.c:1887
|
||||
msgid "The currently key focused actor"
|
||||
msgstr "L'acteur possédant actuellement le focus"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1891
|
||||
#: ../clutter/clutter-stage.c:1903
|
||||
msgid "No Clear Hint"
|
||||
msgstr "Aucun indicateur d'effacement"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1892
|
||||
#: ../clutter/clutter-stage.c:1904
|
||||
msgid "Whether the stage should clear its contents"
|
||||
msgstr "Indique si la scène doit effacer son contenu"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1905
|
||||
#: ../clutter/clutter-stage.c:1917
|
||||
msgid "Accept Focus"
|
||||
msgstr "Accepte le focus"
|
||||
|
||||
#: ../clutter/clutter-stage.c:1906
|
||||
#: ../clutter/clutter-stage.c:1918
|
||||
msgid "Whether the stage should accept focus on show"
|
||||
msgstr "Indique si la scène doit accepter le focus à l'affichage"
|
||||
|
||||
@ -1917,21 +1927,21 @@ msgstr "Couleur du texte sélectionné renseignée"
|
||||
msgid "Whether the selected text color has been set"
|
||||
msgstr "Indique si la couleur du texte sélectionné a été renseignée ou non"
|
||||
|
||||
#: ../clutter/clutter-texture.c:995
|
||||
#: ../clutter/clutter-texture.c:981
|
||||
msgid "Sync size of actor"
|
||||
msgstr "Synchronise la taille de l'acteur"
|
||||
|
||||
#: ../clutter/clutter-texture.c:996
|
||||
#: ../clutter/clutter-texture.c:982
|
||||
msgid "Auto sync size of actor to underlying pixbuf dimensions"
|
||||
msgstr ""
|
||||
"Synchronisation de la taille de l'acteur avec les dimensions du pixbuf sous-"
|
||||
"jacent"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1003
|
||||
#: ../clutter/clutter-texture.c:989
|
||||
msgid "Disable Slicing"
|
||||
msgstr "Désactive le découpage"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1004
|
||||
#: ../clutter/clutter-texture.c:990
|
||||
msgid ""
|
||||
"Forces the underlying texture to be singular and not made of smaller space "
|
||||
"saving individual textures"
|
||||
@ -1939,72 +1949,72 @@ msgstr ""
|
||||
"Force la texture sous-jacente à être singulière et non composée de plus "
|
||||
"petites sous-textures économes en espace"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1013
|
||||
#: ../clutter/clutter-texture.c:999
|
||||
msgid "Tile Waste"
|
||||
msgstr "Perte de mosaïque"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1014
|
||||
#: ../clutter/clutter-texture.c:1000
|
||||
msgid "Maximum waste area of a sliced texture"
|
||||
msgstr "Zone maximale de perte d'une texture par morceaux"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1022
|
||||
#: ../clutter/clutter-texture.c:1008
|
||||
msgid "Horizontal repeat"
|
||||
msgstr "Répétition horizontale"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1023
|
||||
#: ../clutter/clutter-texture.c:1009
|
||||
msgid "Repeat the contents rather than scaling them horizontally"
|
||||
msgstr "Répète le contenu plutôt de le redimensionner horizontalement"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1030
|
||||
#: ../clutter/clutter-texture.c:1016
|
||||
msgid "Vertical repeat"
|
||||
msgstr "Répétition verticale"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1031
|
||||
#: ../clutter/clutter-texture.c:1017
|
||||
msgid "Repeat the contents rather than scaling them vertically"
|
||||
msgstr "Répète le contenu plutôt de le redimensionner verticalement"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1038
|
||||
#: ../clutter/clutter-texture.c:1024
|
||||
msgid "Filter Quality"
|
||||
msgstr "Qualité de filtrage"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1039
|
||||
#: ../clutter/clutter-texture.c:1025
|
||||
msgid "Rendering quality used when drawing the texture"
|
||||
msgstr "La qualité de rendu utilisée lors du dessin de la texture"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1047
|
||||
#: ../clutter/clutter-texture.c:1033
|
||||
msgid "Pixel Format"
|
||||
msgstr "Format des pixels"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1048
|
||||
#: ../clutter/clutter-texture.c:1034
|
||||
msgid "The Cogl pixel format to use"
|
||||
msgstr "Le format des pixels Cogl à utiliser"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1056
|
||||
#: ../clutter/clutter-texture.c:1042
|
||||
msgid "Cogl Texture"
|
||||
msgstr "Texture Cogl"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1057
|
||||
#: ../clutter/clutter-texture.c:1043
|
||||
msgid "The underlying Cogl texture handle used to draw this actor"
|
||||
msgstr "L'animateur de texture Cogl sous-jacent utilisé pour tracer cet acteur"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1064
|
||||
#: ../clutter/clutter-texture.c:1050
|
||||
msgid "Cogl Material"
|
||||
msgstr "Matériel Cogl"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1065
|
||||
#: ../clutter/clutter-texture.c:1051
|
||||
msgid "The underlying Cogl material handle used to draw this actor"
|
||||
msgstr ""
|
||||
"L'animateur de matériel Cogl sous-jacent utilisé pour tracer cet acteur"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1082
|
||||
#: ../clutter/clutter-texture.c:1068
|
||||
msgid "The path of the file containing the image data"
|
||||
msgstr "Le chemin du fichier contenant les données de l'image"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1089
|
||||
#: ../clutter/clutter-texture.c:1075
|
||||
msgid "Keep Aspect Ratio"
|
||||
msgstr "Conserver le rapport d'affichage"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1090
|
||||
#: ../clutter/clutter-texture.c:1076
|
||||
msgid ""
|
||||
"Keep the aspect ratio of the texture when requesting the preferred width or "
|
||||
"height"
|
||||
@ -2012,22 +2022,22 @@ msgstr ""
|
||||
"Conserve le rapport d'affichage de la texture au moment d'une requête de "
|
||||
"largeur ou hauteur préférée"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1116
|
||||
#: ../clutter/clutter-texture.c:1102
|
||||
msgid "Load asynchronously"
|
||||
msgstr "Chargement asynchrone"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1117
|
||||
#: ../clutter/clutter-texture.c:1103
|
||||
msgid ""
|
||||
"Load files inside a thread to avoid blocking when loading images from disk"
|
||||
msgstr ""
|
||||
"Charger les fichiers à l'intérieur d'un thread pour éviter un blocage lors "
|
||||
"du chargement des images à partir du disque"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1133
|
||||
#: ../clutter/clutter-texture.c:1119
|
||||
msgid "Load data asynchronously"
|
||||
msgstr "Charger les données de manière asynchrone"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1134
|
||||
#: ../clutter/clutter-texture.c:1120
|
||||
msgid ""
|
||||
"Decode image data files inside a thread to reduce blocking when loading "
|
||||
"images from disk"
|
||||
@ -2035,26 +2045,26 @@ msgstr ""
|
||||
"Décode les fichiers de données d'image à l'intérieur d'un thread pour éviter "
|
||||
"un blocage lors du chargement des images à partir du disque"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1158
|
||||
#: ../clutter/clutter-texture.c:1144
|
||||
msgid "Pick With Alpha"
|
||||
msgstr "Sélection avec alpha"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1159
|
||||
#: ../clutter/clutter-texture.c:1145
|
||||
msgid "Shape actor with alpha channel when picking"
|
||||
msgstr "Acteur de forme avec canal alpha lors d'une sélection"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1557 ../clutter/clutter-texture.c:1967
|
||||
#: ../clutter/clutter-texture.c:2062 ../clutter/clutter-texture.c:2343
|
||||
#: ../clutter/clutter-texture.c:1543 ../clutter/clutter-texture.c:1926
|
||||
#: ../clutter/clutter-texture.c:2020 ../clutter/clutter-texture.c:2301
|
||||
#, c-format
|
||||
msgid "Failed to load the image data"
|
||||
msgstr "Impossible de charger les données de l'image"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1703
|
||||
#: ../clutter/clutter-texture.c:1689
|
||||
#, c-format
|
||||
msgid "YUV textures are not supported"
|
||||
msgstr "Les textures YUV ne sont pas prises en charge"
|
||||
|
||||
#: ../clutter/clutter-texture.c:1712
|
||||
#: ../clutter/clutter-texture.c:1698
|
||||
#, c-format
|
||||
msgid "YUV2 textues are not supported"
|
||||
msgstr "Les textures YUV2 ne sont pas prises en charge"
|
||||
|
@ -75,6 +75,7 @@ units_sources += \
|
||||
test-pick.c \
|
||||
test-texture-fbo.c \
|
||||
test-text-cache.c \
|
||||
test-shader-effect.c \
|
||||
$(NULL)
|
||||
|
||||
# objects tests
|
||||
|
@ -134,6 +134,7 @@ main (int argc, char **argv)
|
||||
TEST_CONFORM_SIMPLE ("/actor", actor_fixed_size);
|
||||
TEST_CONFORM_SIMPLE ("/actor", actor_preferred_size);
|
||||
TEST_CONFORM_SIMPLE ("/actor", test_offscreen_redirect);
|
||||
TEST_CONFORM_SIMPLE ("/actor", test_shader_effect);
|
||||
|
||||
TEST_CONFORM_SIMPLE ("/invariants", test_initial_state);
|
||||
TEST_CONFORM_SIMPLE ("/invariants", test_shown_not_parented);
|
||||
|
267
tests/conform/test-shader-effect.c
Normal file
267
tests/conform/test-shader-effect.c
Normal file
@ -0,0 +1,267 @@
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "test-conform-common.h"
|
||||
|
||||
/****************************************************************
|
||||
Old style shader effect
|
||||
This uses clutter_shader_effect_set_source
|
||||
****************************************************************/
|
||||
|
||||
static const gchar
|
||||
old_shader_effect_source[] =
|
||||
"uniform vec3 override_color;\n"
|
||||
"\n"
|
||||
"void\n"
|
||||
"main ()\n"
|
||||
"{\n"
|
||||
" cogl_color_out = vec4 (override_color, 1.0);\n"
|
||||
"}";
|
||||
|
||||
typedef struct _FooOldShaderEffectClass
|
||||
{
|
||||
ClutterShaderEffectClass parent_class;
|
||||
} FooOldShaderEffectClass;
|
||||
|
||||
typedef struct _FooOldShaderEffect
|
||||
{
|
||||
ClutterShaderEffect parent;
|
||||
} FooOldShaderEffect;
|
||||
|
||||
G_DEFINE_TYPE (FooOldShaderEffect,
|
||||
foo_old_shader_effect,
|
||||
CLUTTER_TYPE_SHADER_EFFECT);
|
||||
|
||||
static void
|
||||
foo_old_shader_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
clutter_shader_effect_set_shader_source (CLUTTER_SHADER_EFFECT (effect),
|
||||
old_shader_effect_source);
|
||||
clutter_shader_effect_set_uniform (CLUTTER_SHADER_EFFECT (effect),
|
||||
"override_color",
|
||||
G_TYPE_FLOAT, 3,
|
||||
1.0f, 0.0f, 0.0f);
|
||||
|
||||
CLUTTER_OFFSCREEN_EFFECT_CLASS (foo_old_shader_effect_parent_class)->
|
||||
paint_target (effect);
|
||||
}
|
||||
|
||||
static void
|
||||
foo_old_shader_effect_class_init (FooOldShaderEffectClass *klass)
|
||||
{
|
||||
ClutterOffscreenEffectClass *offscreen_effect_class =
|
||||
CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
|
||||
|
||||
offscreen_effect_class->paint_target = foo_old_shader_effect_paint_target;
|
||||
}
|
||||
|
||||
static void
|
||||
foo_old_shader_effect_init (FooOldShaderEffect *self)
|
||||
{
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
New style shader effect
|
||||
This overrides get_static_shader_source()
|
||||
****************************************************************/
|
||||
|
||||
static const gchar
|
||||
new_shader_effect_source[] =
|
||||
"uniform vec3 override_color;\n"
|
||||
"\n"
|
||||
"void\n"
|
||||
"main ()\n"
|
||||
"{\n"
|
||||
" cogl_color_out = (vec4 (override_color, 1.0) +\n"
|
||||
" vec4 (0.0, 0.0, 1.0, 0.0));\n"
|
||||
"}";
|
||||
|
||||
typedef struct _FooNewShaderEffectClass
|
||||
{
|
||||
ClutterShaderEffectClass parent_class;
|
||||
} FooNewShaderEffectClass;
|
||||
|
||||
typedef struct _FooNewShaderEffect
|
||||
{
|
||||
ClutterShaderEffect parent;
|
||||
} FooNewShaderEffect;
|
||||
|
||||
G_DEFINE_TYPE (FooNewShaderEffect,
|
||||
foo_new_shader_effect,
|
||||
CLUTTER_TYPE_SHADER_EFFECT);
|
||||
|
||||
static gchar *
|
||||
foo_new_shader_effect_get_static_source (ClutterShaderEffect *effect)
|
||||
{
|
||||
static gboolean already_called = FALSE;
|
||||
|
||||
/* This should only be called once even though we have two actors
|
||||
using this effect */
|
||||
g_assert (!already_called);
|
||||
|
||||
already_called = TRUE;
|
||||
|
||||
return g_strdup (new_shader_effect_source);
|
||||
}
|
||||
|
||||
static void
|
||||
foo_new_shader_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
clutter_shader_effect_set_uniform (CLUTTER_SHADER_EFFECT (effect),
|
||||
"override_color",
|
||||
G_TYPE_FLOAT, 3,
|
||||
0.0f, 1.0f, 0.0f);
|
||||
|
||||
CLUTTER_OFFSCREEN_EFFECT_CLASS (foo_new_shader_effect_parent_class)->
|
||||
paint_target (effect);
|
||||
}
|
||||
|
||||
static void
|
||||
foo_new_shader_effect_class_init (FooNewShaderEffectClass *klass)
|
||||
{
|
||||
ClutterOffscreenEffectClass *offscreen_effect_class =
|
||||
CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
|
||||
ClutterShaderEffectClass *shader_effect_class =
|
||||
CLUTTER_SHADER_EFFECT_CLASS (klass);
|
||||
|
||||
offscreen_effect_class->paint_target = foo_new_shader_effect_paint_target;
|
||||
|
||||
shader_effect_class->get_static_shader_source =
|
||||
foo_new_shader_effect_get_static_source;
|
||||
}
|
||||
|
||||
static void
|
||||
foo_new_shader_effect_init (FooNewShaderEffect *self)
|
||||
{
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Another new style shader effect
|
||||
This is the same but with a different shader. This is just
|
||||
sanity check that each class gets its own copy of the private
|
||||
data
|
||||
****************************************************************/
|
||||
|
||||
static const gchar
|
||||
another_new_shader_effect_source[] =
|
||||
"\n"
|
||||
"void\n"
|
||||
"main ()\n"
|
||||
"{\n"
|
||||
" cogl_color_out = vec4 (1.0, 0.0, 1.0, 1.0);\n"
|
||||
"}";
|
||||
|
||||
typedef struct _FooAnotherNewShaderEffectClass
|
||||
{
|
||||
ClutterShaderEffectClass parent_class;
|
||||
} FooAnotherNewShaderEffectClass;
|
||||
|
||||
typedef struct _FooAnotherNewShaderEffect
|
||||
{
|
||||
ClutterShaderEffect parent;
|
||||
} FooAnotherNewShaderEffect;
|
||||
|
||||
G_DEFINE_TYPE (FooAnotherNewShaderEffect,
|
||||
foo_another_new_shader_effect,
|
||||
CLUTTER_TYPE_SHADER_EFFECT);
|
||||
|
||||
static gchar *
|
||||
foo_another_new_shader_effect_get_static_source (ClutterShaderEffect *effect)
|
||||
{
|
||||
return g_strdup (another_new_shader_effect_source);
|
||||
}
|
||||
|
||||
static void
|
||||
foo_another_new_shader_effect_class_init (FooAnotherNewShaderEffectClass *klass)
|
||||
{
|
||||
ClutterShaderEffectClass *shader_effect_class =
|
||||
CLUTTER_SHADER_EFFECT_CLASS (klass);
|
||||
|
||||
shader_effect_class->get_static_shader_source =
|
||||
foo_another_new_shader_effect_get_static_source;
|
||||
}
|
||||
|
||||
static void
|
||||
foo_another_new_shader_effect_init (FooAnotherNewShaderEffect *self)
|
||||
{
|
||||
}
|
||||
|
||||
/****************************************************************/
|
||||
|
||||
static ClutterActor *
|
||||
make_actor (GType shader_type)
|
||||
{
|
||||
ClutterActor *rect;
|
||||
const ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
rect = clutter_rectangle_new ();
|
||||
clutter_rectangle_set_color (CLUTTER_RECTANGLE (rect), &white);
|
||||
clutter_actor_set_size (rect, 50, 50);
|
||||
|
||||
clutter_actor_add_effect (rect, g_object_new (shader_type, NULL));
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
static guint32
|
||||
get_pixel (int x, int y)
|
||||
{
|
||||
guint8 data[4];
|
||||
|
||||
cogl_read_pixels (x, y, 1, 1,
|
||||
COGL_READ_PIXELS_COLOR_BUFFER,
|
||||
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
|
||||
data);
|
||||
|
||||
return (((guint32) data[0] << 16) |
|
||||
((guint32) data[1] << 8) |
|
||||
data[2]);
|
||||
}
|
||||
|
||||
static void
|
||||
paint_cb (ClutterActor *stage)
|
||||
{
|
||||
/* old shader effect */
|
||||
g_assert_cmpint (get_pixel (50, 50), ==, 0xff0000);
|
||||
/* new shader effect */
|
||||
g_assert_cmpint (get_pixel (150, 50), ==, 0x00ffff);
|
||||
/* another new shader effect */
|
||||
g_assert_cmpint (get_pixel (250, 50), ==, 0xff00ff);
|
||||
/* new shader effect */
|
||||
g_assert_cmpint (get_pixel (350, 50), ==, 0x00ffff);
|
||||
|
||||
clutter_main_quit ();
|
||||
}
|
||||
|
||||
void
|
||||
test_shader_effect (TestConformSimpleFixture *fixture,
|
||||
gconstpointer data)
|
||||
{
|
||||
ClutterActor *stage;
|
||||
ClutterActor *rect;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
|
||||
rect = make_actor (foo_old_shader_effect_get_type ());
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
|
||||
|
||||
rect = make_actor (foo_new_shader_effect_get_type ());
|
||||
clutter_actor_set_x (rect, 100);
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
|
||||
|
||||
rect = make_actor (foo_another_new_shader_effect_get_type ());
|
||||
clutter_actor_set_x (rect, 200);
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
|
||||
|
||||
rect = make_actor (foo_new_shader_effect_get_type ());
|
||||
clutter_actor_set_x (rect, 300);
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
|
||||
|
||||
clutter_actor_show (stage);
|
||||
|
||||
g_signal_connect_after (stage, "paint", G_CALLBACK (paint_cb), NULL);
|
||||
|
||||
clutter_main ();
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("OK\n");
|
||||
}
|
@ -195,7 +195,11 @@ main (int argc, char **argv)
|
||||
|
||||
unit_test_main = func;
|
||||
|
||||
ret = unit_test_main (argc, argv);
|
||||
ret = unit_test_main (n_unit_names, unit_names);
|
||||
|
||||
g_free (unit_test);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
g_free (unit_test);
|
||||
|
Loading…
Reference in New Issue
Block a user