gimp r27317 - in trunk: . app/actions menus



Author: martinn
Date: Sun Oct 19 07:59:08 2008
New Revision: 27317
URL: http://svn.gnome.org/viewvc/gimp?rev=27317&view=rev

Log:
* menus/image-menu.xml.in
* app/actions/debug-actions.c
* app/actions/debug-commands.h
* app/actions/debug-commands.c: Added a 'Dump Projection
Benchmarking' item to the Debug Menu so that we can test how
different GEGL graph setups affect performance.


Modified:
   trunk/ChangeLog
   trunk/app/actions/debug-actions.c
   trunk/app/actions/debug-commands.c
   trunk/app/actions/debug-commands.h
   trunk/menus/image-menu.xml.in

Modified: trunk/app/actions/debug-actions.c
==============================================================================
--- trunk/app/actions/debug-actions.c	(original)
+++ trunk/app/actions/debug-actions.c	Sun Oct 19 07:59:08 2008
@@ -56,6 +56,11 @@
   { "debug-dump-attached-data", NULL,
     "Dump Attached Data", NULL, NULL,
     G_CALLBACK (debug_dump_attached_data_cmd_callback),
+    NULL },
+
+  { "debug-dump-projection-benchmarking", NULL,
+    "Dump Projection Benchmarking", NULL, NULL,
+    G_CALLBACK (debug_dump_projection_benchmarking_cmd_callback),
     NULL }
 };
 

Modified: trunk/app/actions/debug-commands.c
==============================================================================
--- trunk/app/actions/debug-commands.c	(original)
+++ trunk/app/actions/debug-commands.c	Sun Oct 19 07:59:08 2008
@@ -20,14 +20,20 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
 
 #include "actions-types.h"
 
+#include "base/tile-manager.h"
+#include "base/tile.h"
+
 #include "core/gimp.h"
 #include "core/gimpcontext.h"
+#include "core/gimpimage.h"
+#include "core/gimpprojection.h"
 
 #include "widgets/gimpmenufactory.h"
 #include "widgets/gimpuimanager.h"
@@ -146,6 +152,50 @@
   debug_print_qdata (GIMP_OBJECT (user_context));
 }
 
+void
+debug_dump_projection_benchmarking_cmd_callback (GtkAction *action,
+                                                 gpointer   data)
+{
+  GimpImage      *image      = NULL;
+  GimpProjection *projection = NULL;
+  TileManager    *tiles      = NULL;
+  GTimer         *timer      = NULL;
+  return_if_no_image (image, data);
+
+  projection = gimp_image_get_projection (image);
+  tiles      = gimp_projection_get_tiles (projection);
+  timer      = g_timer_new ();
+
+  if (projection &&tiles && timer)
+    {
+      int x = 0;
+      int y = 0;
+
+      gimp_image_update (image,
+                         0, 0,
+                         gimp_image_get_width  (image),
+                         gimp_image_get_height (image));
+      gimp_projection_flush_now (projection);
+
+      g_timer_start (timer);
+      for (x = 0; x < tile_manager_width (tiles); x += TILE_WIDTH)
+        {
+          for (y = 0; y < tile_manager_height (tiles); y += TILE_HEIGHT)
+            {
+              Tile *tile = tile_manager_get_tile (tiles, x, y, TRUE, FALSE);
+
+              tile_release (tile, FALSE);
+            }
+        }
+      g_timer_stop (timer);
+
+      g_print ("Validation of entire projection took %.0f ms\n",
+               1000 * g_timer_elapsed (timer, NULL));
+
+      g_timer_destroy (timer);
+    }
+}
+
 
 /*  private functions  */
 

Modified: trunk/app/actions/debug-commands.h
==============================================================================
--- trunk/app/actions/debug-commands.h	(original)
+++ trunk/app/actions/debug-commands.h	Sun Oct 19 07:59:08 2008
@@ -27,14 +27,16 @@
 
 #ifdef ENABLE_DEBUG_MENU
 
-void   debug_mem_profile_cmd_callback        (GtkAction *action,
-                                              gpointer   data);
-void   debug_dump_menus_cmd_callback         (GtkAction *action,
-                                              gpointer   data);
-void   debug_dump_managers_cmd_callback      (GtkAction *action,
-                                              gpointer   data);
-void   debug_dump_attached_data_cmd_callback (GtkAction *action,
-                                              gpointer   data);
+void   debug_mem_profile_cmd_callback                  (GtkAction *action,
+                                                        gpointer   data);
+void   debug_dump_menus_cmd_callback                   (GtkAction *action,
+                                                        gpointer   data);
+void   debug_dump_managers_cmd_callback                (GtkAction *action,
+                                                        gpointer   data);
+void   debug_dump_attached_data_cmd_callback           (GtkAction *action,
+                                                        gpointer   data);
+void   debug_dump_projection_benchmarking_cmd_callback (GtkAction *action,
+                                                        gpointer   data);
 
 #endif /* ENABLE_DEBUG_MENU */
 

Modified: trunk/menus/image-menu.xml.in
==============================================================================
--- trunk/menus/image-menu.xml.in	(original)
+++ trunk/menus/image-menu.xml.in	Sun Oct 19 07:59:08 2008
@@ -29,6 +29,7 @@
         <menuitem action="debug-dump-items" />
         <menuitem action="debug-dump-managers" />
         <menuitem action="debug-dump-attached-data" />
+        <menuitem action="debug-dump-projection-benchmarking" />
       </menu>
 
       <separator />



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