[gimp/goat-invasion: 195/234] app: add gimp_gegl_buffer_get_tile_manager()



commit 72f1183a2d559b91bfe775bed25751ba6be25bc5
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 21 21:58:40 2012 +0100

    app: add gimp_gegl_buffer_get_tile_manager()
    
    and ust it in some get_memsize() functions instead of having a
    FIXME. So many files changed because they need to inlcude <gegl.h>
    now.

 app/core/gimp-tags.c             |    2 +-
 app/core/gimp-transform-resize.c |    2 +-
 app/core/gimp-utils.c            |   18 +++++++++++++++++-
 app/core/gimp-utils.h            |    2 ++
 app/core/gimpbuffer.c            |    3 ++-
 app/core/gimpcontainer.c         |    2 +-
 app/core/gimpdata.c              |    2 +-
 app/core/gimpdrawablemodundo.c   |    3 ++-
 app/core/gimpidtable.c           |    2 +-
 app/core/gimpmaskundo.c          |    5 +++--
 app/core/gimpobject.c            |    2 +-
 app/core/gimppalette.c           |    2 +-
 app/core/gimpparasitelist.c      |    2 +-
 app/core/gimptagcache.c          |    2 +-
 app/core/gimpviewable.c          |    2 +-
 app/pdb/gimppdb.c                |    2 +-
 app/plug-in/gimpplugindef.c      |    2 +-
 app/plug-in/gimppluginmanager.c  |    2 +-
 app/text/gimptext.c              |    1 +
 app/vectors/gimpstroke.c         |    2 +-
 app/widgets/gimphelp.c           |    1 +
 app/widgets/gimpoverlaychild.c   |    1 +
 app/widgets/gimptagentry.c       |    1 +
 23 files changed, 44 insertions(+), 19 deletions(-)
---
diff --git a/app/core/gimp-tags.c b/app/core/gimp-tags.c
index 1eff86f..e644716 100644
--- a/app/core/gimp-tags.c
+++ b/app/core/gimp-tags.c
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"
diff --git a/app/core/gimp-transform-resize.c b/app/core/gimp-transform-resize.c
index 4ebcc4b..3efe72f 100644
--- a/app/core/gimp-transform-resize.c
+++ b/app/core/gimp-transform-resize.c
@@ -17,7 +17,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 
diff --git a/app/core/gimp-utils.c b/app/core/gimp-utils.c
index 91a5c29..21e690e 100644
--- a/app/core/gimp-utils.c
+++ b/app/core/gimp-utils.c
@@ -27,7 +27,7 @@
 #endif
 
 #include <cairo.h>
-#include <glib-object.h>
+#include <gegl.h>
 #include <gobject/gvaluecollector.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -267,6 +267,22 @@ gimp_g_param_spec_get_memsize (GParamSpec *pspec)
 }
 
 gint64
+gimp_gegl_buffer_get_memsize (GeglBuffer *buffer)
+{
+  if (buffer)
+    {
+      const Babl *format = gegl_buffer_get_format (buffer);
+
+      return (babl_format_get_bytes_per_pixel (format) *
+              gegl_buffer_get_width (buffer) *
+              gegl_buffer_get_height (buffer) +
+              gimp_g_object_get_memsize (G_OBJECT (buffer)));
+    }
+
+  return 0;
+}
+
+gint64
 gimp_string_get_memsize (const gchar *string)
 {
   if (string)
diff --git a/app/core/gimp-utils.h b/app/core/gimp-utils.h
index 5eff64b..c0567d1 100644
--- a/app/core/gimp-utils.h
+++ b/app/core/gimp-utils.h
@@ -52,6 +52,8 @@ gint64       gimp_g_list_get_memsize_foreach       (GList            *slist,
 gint64       gimp_g_value_get_memsize              (GValue          *value);
 gint64       gimp_g_param_spec_get_memsize         (GParamSpec      *pspec);
 
+gint64       gimp_gegl_buffer_get_memsize          (GeglBuffer      *buffer);
+
 gint64       gimp_string_get_memsize               (const gchar     *string);
 gint64       gimp_parasite_get_memsize             (GimpParasite    *parasite,
                                                     gint64          *gui_size);
diff --git a/app/core/gimpbuffer.c b/app/core/gimpbuffer.c
index e3be72d..5466b0c 100644
--- a/app/core/gimpbuffer.c
+++ b/app/core/gimpbuffer.c
@@ -26,6 +26,7 @@
 
 #include "gegl/gimp-gegl-utils.h"
 
+#include "gimp-utils.h"
 #include "gimpbuffer.h"
 #include "gimpimage.h"
 
@@ -108,7 +109,7 @@ gimp_buffer_get_memsize (GimpObject *object,
   GimpBuffer *buffer  = GIMP_BUFFER (object);
   gint64      memsize = 0;
 
-  /* FIXME memsize += tile_manager_get_memsize (buffer->tiles, FALSE); */
+  memsize += gimp_gegl_buffer_get_memsize (buffer->buffer);
 
   return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                   gui_size);
diff --git a/app/core/gimpcontainer.c b/app/core/gimpcontainer.c
index 69928d6..0157e39 100644
--- a/app/core/gimpcontainer.c
+++ b/app/core/gimpcontainer.c
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpconfig/gimpconfig.h"
 
diff --git a/app/core/gimpdata.c b/app/core/gimpdata.c
index e1461d4..c2f978b 100644
--- a/app/core/gimpdata.c
+++ b/app/core/gimpdata.c
@@ -27,7 +27,7 @@
 #include <unistd.h>
 #endif
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <glib/gstdio.h>
 
 #include "libgimpbase/gimpbase.h"
diff --git a/app/core/gimpdrawablemodundo.c b/app/core/gimpdrawablemodundo.c
index 3992e74..7db1cf7 100644
--- a/app/core/gimpdrawablemodundo.c
+++ b/app/core/gimpdrawablemodundo.c
@@ -23,6 +23,7 @@
 
 #include "gegl/gimp-gegl-utils.h"
 
+#include "gimp-utils.h"
 #include "gimpimage.h"
 #include "gimpdrawable.h"
 #include "gimpdrawablemodundo.h"
@@ -169,7 +170,7 @@ gimp_drawable_mod_undo_get_memsize (GimpObject *object,
   GimpDrawableModUndo *drawable_mod_undo = GIMP_DRAWABLE_MOD_UNDO (object);
   gint64               memsize           = 0;
 
-  /* FIXME memsize += gimp_gegl_buffer_get_memsize (drawable_mod_undo->buffer, FALSE); */
+  memsize += gimp_gegl_buffer_get_memsize (drawable_mod_undo->buffer);
 
   return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                   gui_size);
diff --git a/app/core/gimpidtable.c b/app/core/gimpidtable.c
index be5bc5b..73394f9 100644
--- a/app/core/gimpidtable.c
+++ b/app/core/gimpidtable.c
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
diff --git a/app/core/gimpmaskundo.c b/app/core/gimpmaskundo.c
index 22ff6ee..fd80ff9 100644
--- a/app/core/gimpmaskundo.c
+++ b/app/core/gimpmaskundo.c
@@ -23,6 +23,7 @@
 
 #include "gegl/gimp-gegl-utils.h"
 
+#include "gimp-utils.h"
 #include "gimpchannel.h"
 #include "gimpmaskundo.h"
 
@@ -87,7 +88,7 @@ gimp_mask_undo_constructed (GObject *object)
 
       gegl_buffer_copy (gimp_drawable_get_buffer (drawable),
                         GIMP_GEGL_RECT (x1, y1, x2 - x1, y2 - y1),
-                        mask_undo->buffer, 
+                        mask_undo->buffer,
                         GIMP_GEGL_RECT (0, 0, 0, 0));
 
       mask_undo->x = x1;
@@ -102,7 +103,7 @@ gimp_mask_undo_get_memsize (GimpObject *object,
   GimpMaskUndo *mask_undo = GIMP_MASK_UNDO (object);
   gint64        memsize   = 0;
 
-  /* FIXME memsize += tile_manager_get_memsize (mask_undo->tiles, FALSE); */
+  memsize += gimp_gegl_buffer_get_memsize (mask_undo->buffer);
 
   return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                   gui_size);
diff --git a/app/core/gimpobject.c b/app/core/gimpobject.c
index 253bf93..7991015 100644
--- a/app/core/gimpobject.c
+++ b/app/core/gimpobject.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 
diff --git a/app/core/gimppalette.c b/app/core/gimppalette.c
index 8aca125..662342d 100644
--- a/app/core/gimppalette.c
+++ b/app/core/gimppalette.c
@@ -20,7 +20,7 @@
 #include <string.h>
 
 #include <cairo.h>
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
diff --git a/app/core/gimpparasitelist.c b/app/core/gimpparasitelist.c
index 6be3344..b6e5982 100644
--- a/app/core/gimpparasitelist.c
+++ b/app/core/gimpparasitelist.c
@@ -21,7 +21,7 @@
 #include <unistd.h>
 #endif
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #ifdef G_OS_WIN32
 #include <io.h>
diff --git a/app/core/gimptagcache.c b/app/core/gimptagcache.c
index bc470ed..6663e53 100644
--- a/app/core/gimptagcache.c
+++ b/app/core/gimptagcache.c
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"
diff --git a/app/core/gimpviewable.c b/app/core/gimpviewable.c
index 91d8376..712aa34 100644
--- a/app/core/gimpviewable.c
+++ b/app/core/gimpviewable.c
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 #include "libgimpconfig/gimpconfig.h"
diff --git a/app/pdb/gimppdb.c b/app/pdb/gimppdb.c
index db00c22..c236298 100644
--- a/app/pdb/gimppdb.c
+++ b/app/pdb/gimppdb.c
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <sys/types.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <gobject/gvaluecollector.h>
 
 #include "libgimpbase/gimpbase.h"
diff --git a/app/plug-in/gimpplugindef.c b/app/plug-in/gimpplugindef.c
index b56672d..4877702 100644
--- a/app/plug-in/gimpplugindef.c
+++ b/app/plug-in/gimpplugindef.c
@@ -19,7 +19,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "plug-in-types.h"
 
diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c
index 49b79d3..ed07498 100644
--- a/app/plug-in/gimppluginmanager.c
+++ b/app/plug-in/gimppluginmanager.c
@@ -21,7 +21,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpconfig/gimpconfig.h"
diff --git a/app/text/gimptext.c b/app/text/gimptext.c
index 00c640f..fa9cb6a 100644
--- a/app/text/gimptext.c
+++ b/app/text/gimptext.c
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include <cairo.h>
+#include <gegl.h>
 #include <pango/pango.h>
 
 #include "libgimpbase/gimpbase.h"
diff --git a/app/vectors/gimpstroke.c b/app/vectors/gimpstroke.c
index 801e361..d6fea3a 100644
--- a/app/vectors/gimpstroke.c
+++ b/app/vectors/gimpstroke.c
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "vectors-types.h"
 
diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c
index e817ad9..f112a3c 100644
--- a/app/widgets/gimphelp.c
+++ b/app/widgets/gimphelp.c
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
diff --git a/app/widgets/gimpoverlaychild.c b/app/widgets/gimpoverlaychild.c
index a9ff575..d682c5f 100644
--- a/app/widgets/gimpoverlaychild.c
+++ b/app/widgets/gimpoverlaychild.c
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include <libgimpmath/gimpmath.h>
diff --git a/app/widgets/gimptagentry.c b/app/widgets/gimptagentry.c
index e70fb6b..2e9bc5b 100644
--- a/app/widgets/gimptagentry.c
+++ b/app/widgets/gimptagentry.c
@@ -22,6 +22,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 



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