[gnome-photos/wip/rishi/double-buffering: 1/7] Add a format parameter to photos_utils_create_buffer_from_node



commit 7a44a892fe09be7ceff1a953a96f2d0bb49021de
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Jan 17 06:14:37 2017 +0100

    Add a format parameter to photos_utils_create_buffer_from_node

 src/photos-base-item.c |    8 ++++----
 src/photos-utils.c     |    3 ++-
 src/photos-utils.h     |    3 ++-
 3 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index cf1e9d6..2cc63b9 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1,7 +1,7 @@
 /*
  * Photos - access, organize and share your photos on GNOME
  * Copyright © 2014 – 2015 Pranav Kant
- * Copyright © 2012 – 2016 Red Hat, Inc.
+ * Copyright © 2012 – 2017 Red Hat, Inc.
  * Copyright © 2016 Umang Jain
  *
  * This program is free software; you can redistribute it and/or
@@ -1116,7 +1116,7 @@ photos_base_item_guess_save_sizes_load (GObject *source_object, GAsyncResult *re
       goto out;
     }
 
-  buffer = photos_utils_create_buffer_from_node (graph);
+  buffer = photos_utils_create_buffer_from_node (graph, NULL);
   data = photos_base_item_save_data_new (NULL, buffer, priv->mime_type, 0.0);
   g_task_set_task_data (task, data, (GDestroyNotify) photos_base_item_save_data_free);
 
@@ -2064,7 +2064,7 @@ photos_base_item_save_to_stream_load (GObject *source_object, GAsyncResult *res,
       goto out;
     }
 
-  buffer = photos_utils_create_buffer_from_node (graph);
+  buffer = photos_utils_create_buffer_from_node (graph, NULL);
   photos_utils_buffer_zoom_async (buffer,
                                   data->zoom,
                                   cancellable,
@@ -3668,7 +3668,7 @@ photos_base_item_save_load (GObject *source_object, GAsyncResult *res, gpointer
       goto out;
     }
 
-  buffer = photos_utils_create_buffer_from_node (graph);
+  buffer = photos_utils_create_buffer_from_node (graph, NULL);
   photos_utils_buffer_zoom_async (buffer,
                                   data->zoom,
                                   cancellable,
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 0b0a0a6..91cfea4 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -286,7 +286,7 @@ photos_utils_convert_path_to_uri (const gchar *path)
 
 
 GeglBuffer *
-photos_utils_create_buffer_from_node (GeglNode *node)
+photos_utils_create_buffer_from_node (GeglNode *node, const Babl *format)
 {
   GeglBuffer *buffer = NULL;
   GeglNode *buffer_sink;
@@ -296,6 +296,7 @@ photos_utils_create_buffer_from_node (GeglNode *node)
   buffer_sink = gegl_node_new_child (graph,
                                      "operation", "gegl:buffer-sink",
                                      "buffer", &buffer,
+                                     "format", format,
                                      NULL);
   gegl_node_link (node, buffer_sink);
   gegl_node_process (buffer_sink);
diff --git a/src/photos-utils.h b/src/photos-utils.h
index 8a85055..f31af2f 100644
--- a/src/photos-utils.h
+++ b/src/photos-utils.h
@@ -28,6 +28,7 @@
 #ifndef PHOTOS_UTILS_H
 #define PHOTOS_UTILS_H
 
+#include <babl/babl.h>
 #include <cairo.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gegl.h>
@@ -81,7 +82,7 @@ GdkPixbuf       *photos_utils_center_pixbuf               (GdkPixbuf *pixbuf, gi
 
 gchar           *photos_utils_convert_path_to_uri         (const gchar *path);
 
-GeglBuffer      *photos_utils_create_buffer_from_node     (GeglNode *node);
+GeglBuffer      *photos_utils_create_buffer_from_node     (GeglNode *node, const Babl *format);
 
 GIcon           *photos_utils_create_collection_icon      (gint base_size, GList *pixbufs);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]