texture: don't use a static bool to gate warning
in create_pick_material we were using a static boolean to gate when we show a warning, but that would mean if the problem recurs between different textures then the warning will only be shown once. We now have a private bitfield flag instead, just so we don't spew millions of warnings if the problem is recurring.
This commit is contained in:
parent
589c8d9579
commit
d0c743787d
@ -93,6 +93,7 @@ struct _ClutterTexturePrivate
|
|||||||
guint load_async_set : 1; /* used to make load_async possible */
|
guint load_async_set : 1; /* used to make load_async possible */
|
||||||
guint pick_with_alpha : 1;
|
guint pick_with_alpha : 1;
|
||||||
guint pick_with_alpha_supported : 1;
|
guint pick_with_alpha_supported : 1;
|
||||||
|
guint seen_create_pick_material_warning : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterTextureAsyncData
|
struct _ClutterTextureAsyncData
|
||||||
@ -550,6 +551,8 @@ gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self)
|
|||||||
static CoglHandle
|
static CoglHandle
|
||||||
create_pick_material (ClutterActor *self)
|
create_pick_material (ClutterActor *self)
|
||||||
{
|
{
|
||||||
|
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||||
|
ClutterTexturePrivate *priv = texture->priv;
|
||||||
CoglHandle pick_material = cogl_material_new ();
|
CoglHandle pick_material = cogl_material_new ();
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
@ -558,11 +561,10 @@ create_pick_material (ClutterActor *self)
|
|||||||
" MODULATE (CONSTANT, TEXTURE[A])",
|
" MODULATE (CONSTANT, TEXTURE[A])",
|
||||||
&error))
|
&error))
|
||||||
{
|
{
|
||||||
static gboolean seen_warning = FALSE;
|
if (!priv->seen_create_pick_material_warning)
|
||||||
if (!seen_warning)
|
|
||||||
g_warning ("Error setting up texture combine for shaped "
|
g_warning ("Error setting up texture combine for shaped "
|
||||||
"texture picking: %s", error->message);
|
"texture picking: %s", error->message);
|
||||||
seen_warning = TRUE;
|
priv->seen_create_pick_material_warning = TRUE;
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
cogl_handle_unref (pick_material);
|
cogl_handle_unref (pick_material);
|
||||||
return COGL_INVALID_HANDLE;
|
return COGL_INVALID_HANDLE;
|
||||||
@ -1226,6 +1228,7 @@ clutter_texture_init (ClutterTexture *self)
|
|||||||
priv->keep_aspect_ratio = FALSE;
|
priv->keep_aspect_ratio = FALSE;
|
||||||
priv->pick_with_alpha = FALSE;
|
priv->pick_with_alpha = FALSE;
|
||||||
priv->pick_with_alpha_supported = TRUE;
|
priv->pick_with_alpha_supported = TRUE;
|
||||||
|
priv->seen_create_pick_material_warning = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user