PROP_KEEP_ASPECT_RATIO,
PROP_LOAD_ASYNC,
PROP_LOAD_DATA_ASYNC,
- PROP_LOAD_SIZE_ASYNC
};
enum
case PROP_KEEP_ASPECT_RATIO:
priv->keep_aspect_ratio = g_value_get_boolean (value);
break;
- case PROP_LOAD_ASYNC:
- if (g_value_get_boolean (value))
- {
- priv->load_data_async = TRUE;
- priv->load_async_set = TRUE;
- priv->load_size_async = TRUE;
- }
- break;
case PROP_LOAD_DATA_ASYNC:
if (g_value_get_boolean (value))
{
priv->load_data_async = TRUE;
}
break;
- case PROP_LOAD_SIZE_ASYNC:
+ case PROP_LOAD_ASYNC:
if (g_value_get_boolean (value))
{
+ priv->load_data_async = TRUE;
priv->load_async_set = TRUE;
priv->load_size_async = TRUE;
}
case PROP_KEEP_ASPECT_RATIO:
g_value_set_boolean (value, priv->keep_aspect_ratio);
break;
- case PROP_LOAD_DATA_ASYNC:
- g_value_set_boolean (value, priv->load_data_async);
- break;
- case PROP_LOAD_SIZE_ASYNC:
- g_value_set_boolean (value, priv->load_size_async);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
"Load files inside a thread to avoid blocking when "
"loading images.",
FALSE,
- CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
+ CLUTTER_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
- /**
- * ClutterTexture:load-size-sync:
- *
- * When set to TRUE clutter will not block loading the size initially,
- * when used in this manner the size of the texture will initially be
- * 0x0 when the size is available a "size-change" signal will be emitted.
- *
- * Since: 1.0
- */
- g_object_class_install_property
- (gobject_class, PROP_LOAD_SIZE_ASYNC,
- g_param_spec_boolean ("load-size-async",
- "Load size asynchronously",
- "If set to TRUE clutter will not block until it has "
- "loaded the size of the file.",
- FALSE,
- CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* ClutterTexture:load-async:
*
- * Load texture fully asynchronosuly, loading both the size and data
- * in a separate thread. Setting this to TRUE is equivalent of setting
- * both load-data-async and load-size-async.
+ * When set to TRUE load the texture asynchronously, loading both the data
+ * async as when load-data-async is set, but also deferring the loading of
+ * the size to the thread. The size of the texture will initially be 0x0
+ * a "size-change" signal is emitted when the dimensions of the texture
+ * has been loaded from disk.
*
* Since: 1.0
*/
clutter_texture_set_cogl_texture (self, handle);
if (priv->load_size_async)
{
- g_signal_emit (self, texture_signals[SIZE_CHANGE], 0, cogl_texture_get_width(handle), cogl_texture_get_height (handle));
- clutter_actor_queue_redraw (self);
+ g_signal_emit (self, texture_signals[SIZE_CHANGE], 0,
+ cogl_texture_get_width(handle),
+ cogl_texture_get_height (handle));
}
}
NULL);
image[1] = g_object_new (CLUTTER_TYPE_TEXTURE,
"filename", path,
- "load-async", TRUE,
+ "load-data-async", TRUE,
NULL);
image[2] = g_object_new (CLUTTER_TYPE_TEXTURE,
"filename", path,
- "load-data-async", TRUE,
+ "load-async", TRUE,
NULL);
- /* this is a synonym of image[1], is image[1] really needed? (or is this needed? */
-
- image[3] = g_object_new (CLUTTER_TYPE_TEXTURE,
- "filename", path,
- "load-data-async", TRUE,
- "load-size-async", TRUE,
- NULL);
#endif
- for (i=0;i<4;i++)
+ for (i=0;i<3;i++)
{
clutter_container_add (CLUTTER_CONTAINER (stage), image[i], NULL);
}
- for (i=0;i<4;i++)
+ for (i=0;i<3;i++)
{
clutter_actor_set_position (image[i], 50+i*100, 0+i*50);
clone[i]=clutter_clone_new (image[i]);
clutter_actor_set_position (clone[i], 50+i*100, 150+i*50+100);
}
- /* center the image */
-
- for (i=0; i<4; i++)
+ for (i=0; i<3; i++)
{
timeline = clutter_timeline_new (60*5, 60);
alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR);
error = NULL;
- if (!argv[1])
- g_print ("Hint: the redhand.png isn't a good test image for this test.\n"
- "This test can take any clutter loadable image as an argument\n");
-
path = argv[1]?argv[1]:"redhand.png";