[gnome-photos/wip/rishi/imageview: 1/9] base-item: Re-create the processor before processing an item
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/imageview: 1/9] base-item: Re-create the processor before processing an item
- Date: Thu, 4 Feb 2016 12:43:10 +0000 (UTC)
commit b2d319bf8aab2f553411756daa0923fbb5d7ac0a
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Feb 4 13:11:02 2016 +0100
base-item: Re-create the processor before processing an item
Currently, we only create the processor when loading the GeglBuffer for
an item and keep re-using it forever. However, subsequent changes to
the pipeline can change the bounding box of the graph without the
processor knowing about it.
Therefore, let's create a new processor before processing so that it
has the bounding box for the current state of the pipeline.
src/photos-base-item.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index c3b6d9c..2d48b19 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -914,9 +914,6 @@ photos_base_item_load_load_buffer (GObject *source_object, GAsyncResult *res, gp
gegl_node_set (priv->buffer_source, "buffer", buffer, NULL);
- g_clear_object (&priv->processor);
- priv->processor = photos_pipeline_new_processor (priv->pipeline);
-
photos_base_item_process_async (self, cancellable, photos_base_item_load_process, g_object_ref (task));
out:
@@ -2233,13 +2230,18 @@ photos_base_item_process_async (PhotosBaseItem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
+ PhotosBaseItemPrivate *priv;
GTask *task;
g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
+ priv = self->priv;
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, photos_base_item_process_async);
+ g_clear_object (&priv->processor);
+ priv->processor = photos_pipeline_new_processor (priv->pipeline);
+
g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, photos_base_item_process_idle, g_object_ref (task),
g_object_unref);
g_object_unref (task);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]