[gnome-photos/wip/rishi/orientation: 7/8] base-item, thumbnailer: Optimize application of embedded orientation
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/orientation: 7/8] base-item, thumbnailer: Optimize application of embedded orientation
- Date: Thu, 23 Nov 2017 19:34:26 +0000 (UTC)
commit f873823e976d93b4551235515d7ac80f71f2a4cb
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Nov 23 19:24:55 2017 +0100
base-item, thumbnailer: Optimize application of embedded orientation
https://bugzilla.gnome.org/show_bug.cgi?id=781736
src/photos-base-item.c | 8 ++++----
src/photos-thumbnailer.c | 9 +++++----
2 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index e0e1e00..134c173 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1391,11 +1391,11 @@ static GeglBuffer *
photos_base_item_load_buffer (PhotosBaseItem *self, GCancellable *cancellable, GError **error)
{
PhotosBaseItemPrivate *priv;
+ GeglBuffer *buffer = NULL;
GeglBuffer *ret_val = NULL;
GeglNode *buffer_sink;
GeglNode *graph = NULL;
GeglNode *load;
- GeglNode *orientation;
gchar *path = NULL;
gint64 end;
gint64 start;
@@ -1408,14 +1408,14 @@ photos_base_item_load_buffer (PhotosBaseItem *self, GCancellable *cancellable, G
graph = gegl_node_new ();
load = gegl_node_new_child (graph, "operation", "gegl:load", "path", path, NULL);
- orientation = photos_gegl_create_orientation_node (graph, priv->orientation);
- buffer_sink = gegl_node_new_child (graph, "operation", "gegl:buffer-sink", "buffer", &ret_val, NULL);
+ buffer_sink = gegl_node_new_child (graph, "operation", "gegl:buffer-sink", "buffer", &buffer, NULL);
- gegl_node_link_many (load, orientation, buffer_sink, NULL);
+ gegl_node_link (load, buffer_sink);
start = g_get_monotonic_time ();
gegl_node_process (buffer_sink);
+ ret_val = photos_gegl_buffer_apply_orientation (buffer, priv->orientation);
end = g_get_monotonic_time ();
photos_debug (PHOTOS_DEBUG_GEGL, "Buffer Load: From Local: %" G_GINT64_FORMAT, end - start);
diff --git a/src/photos-thumbnailer.c b/src/photos-thumbnailer.c
index e1536e7..57ef958 100644
--- a/src/photos-thumbnailer.c
+++ b/src/photos-thumbnailer.c
@@ -345,8 +345,8 @@ photos_thumbnailer_generate_thumbnail_pixbuf (GObject *source_object, GAsyncResu
GTask *task = G_TASK (user_data);
GdkPixbuf *pixbuf = NULL;
GeglBuffer *buffer = NULL;
+ GeglBuffer *buffer_oriented = NULL;
GeglNode *buffer_source;
- GeglNode *orientation;
GeglNode *pipeline_node;
GeglNode *save_pixbuf;
GeglProcessor *processor = NULL;
@@ -366,16 +366,16 @@ photos_thumbnailer_generate_thumbnail_pixbuf (GObject *source_object, GAsyncResu
g_assert_null (data->pixbuf_thumbnail);
buffer = photos_gegl_buffer_new_from_pixbuf (pixbuf);
+ buffer_oriented = photos_gegl_buffer_apply_orientation (buffer, data->orientation);
- buffer_source = gegl_node_new_child (data->graph, "operation", "gegl:buffer-source", "buffer", buffer,
NULL);
- orientation = photos_gegl_create_orientation_node (data->graph, data->orientation);
+ buffer_source = gegl_node_new_child (data->graph, "operation", "gegl:buffer-source", "buffer",
buffer_oriented, NULL);
pipeline_node = photos_pipeline_get_graph (data->pipeline);
save_pixbuf = gegl_node_new_child (data->graph,
"operation", "gegl:save-pixbuf",
"pixbuf", &data->pixbuf_thumbnail,
NULL);
- gegl_node_link_many (buffer_source, orientation, pipeline_node, save_pixbuf, NULL);
+ gegl_node_link_many (buffer_source, pipeline_node, save_pixbuf, NULL);
processor = gegl_node_new_processor (save_pixbuf, NULL);
photos_gegl_processor_process_async (processor,
@@ -385,6 +385,7 @@ photos_thumbnailer_generate_thumbnail_pixbuf (GObject *source_object, GAsyncResu
out:
g_clear_object (&buffer);
+ g_clear_object (&buffer_oriented);
g_clear_object (&pixbuf);
g_clear_object (&processor);
g_object_unref (task);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]