[gimp] app: remove gimp_display_shell_render_{init,exit}



commit 260c8560e40626dd5964219b9c3ddbf774743a7f
Author: Sven Neumann <sven gimp org>
Date:   Tue Sep 28 22:26:05 2010 +0200

    app: remove gimp_display_shell_render_{init,exit}
    
    The functions had become mostly obsolete and we can just use a
    static scratch buffer for rendering.

 app/display/gimpdisplayshell-render.c |   42 ++++++++-------------------------
 app/display/gimpdisplayshell-render.h |   15 ++++-------
 app/gui/gui.c                         |    3 --
 3 files changed, 16 insertions(+), 44 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index ae8b2b2..b84ffcc 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -95,38 +95,16 @@ struct _RenderInfo
   gint64            dy;
 };
 
+
+static guchar tile_buf[GIMP_DISPLAY_RENDER_BUF_WIDTH * MAX_CHANNELS];
+
+
 static void  gimp_display_shell_render_info_scale (RenderInfo       *info,
                                                    GimpDisplayShell *shell,
                                                    TileManager      *tiles,
                                                    gint              level,
                                                    gboolean          is_premult);
 
-static guchar *tile_buf = NULL;
-
-
-void
-gimp_display_shell_render_init (Gimp *gimp)
-{
-  g_return_if_fail (GIMP_IS_GIMP (gimp));
-  g_return_if_fail (tile_buf == NULL);
-
-  /*  allocate a buffer for arranging information from a row of tiles  */
-  tile_buf = g_new (guchar, GIMP_DISPLAY_RENDER_BUF_WIDTH * MAX_CHANNELS);
-}
-
-void
-gimp_display_shell_render_exit (Gimp *gimp)
-{
-  g_return_if_fail (GIMP_IS_GIMP (gimp));
-
-  if (tile_buf)
-    {
-      g_free (tile_buf);
-      tile_buf = NULL;
-    }
-}
-
-
 /*  Render Image functions  */
 
 static void           render_image_rgb_a      (RenderInfo       *info);
@@ -147,12 +125,12 @@ static void  gimp_display_shell_render_mask   (GimpDisplayShell *shell,
 /*****************************************************************/
 
 void
-gimp_display_shell_render (GimpDisplayShell   *shell,
-                           cairo_t            *cr,
-                           gint                x,
-                           gint                y,
-                           gint                w,
-                           gint                h)
+gimp_display_shell_render (GimpDisplayShell *shell,
+                           cairo_t          *cr,
+                           gint              x,
+                           gint              y,
+                           gint              w,
+                           gint              h)
 {
   GimpProjection *projection;
   GimpImage      *image;
diff --git a/app/display/gimpdisplayshell-render.h b/app/display/gimpdisplayshell-render.h
index 48a5ccf..82964aa 100644
--- a/app/display/gimpdisplayshell-render.h
+++ b/app/display/gimpdisplayshell-render.h
@@ -23,15 +23,12 @@
 #define GIMP_DISPLAY_RENDER_BUF_HEIGHT 256
 
 
-void   gimp_display_shell_render_init (Gimp             *gimp);
-void   gimp_display_shell_render_exit (Gimp             *gimp);
-
-void   gimp_display_shell_render      (GimpDisplayShell *shell,
-                                       cairo_t          *cr,
-                                       gint              x,
-                                       gint              y,
-                                       gint              w,
-                                       gint              h);
+void  gimp_display_shell_render   (GimpDisplayShell *shell,
+                                   cairo_t          *cr,
+                                   gint              x,
+                                   gint              y,
+                                   gint              w,
+                                   gint              h);
 
 
 #endif  /*  __GIMP_DISPLAY_SHELL_RENDER_H__  */
diff --git a/app/gui/gui.c b/app/gui/gui.c
index 3896285..73b59f5 100644
--- a/app/gui/gui.c
+++ b/app/gui/gui.c
@@ -42,7 +42,6 @@
 #include "display/gimpdisplay.h"
 #include "display/gimpdisplay-foreach.h"
 #include "display/gimpdisplayshell.h"
-#include "display/gimpdisplayshell-render.h"
 #include "display/gimpstatusbar.h"
 
 #include "tools/gimp-tools.h"
@@ -406,7 +405,6 @@ gui_restore_callback (Gimp               *gimp,
   actions_init (gimp);
   menus_init (gimp, global_action_factory);
   gimp_render_init (gimp);
-  gimp_display_shell_render_init (gimp);
 
   dialogs_init (gimp, global_menu_factory);
 
@@ -630,7 +628,6 @@ gui_exit_after_callback (Gimp     *gimp,
   session_exit (gimp);
   menus_exit (gimp);
   actions_exit (gimp);
-  gimp_display_shell_render_exit (gimp);
   gimp_render_exit (gimp);
 
   gimp_controllers_exit (gimp);



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