mirror of https://github.com/GNOME/gimp.git
menus/image-menu.xml.in app/actions/debug-actions.c
* 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. svn path=/trunk/; revision=27317
This commit is contained in:
parent
099bc23234
commit
9d91e6b343
|
@ -1,3 +1,12 @@
|
|||
2008-10-19 Martin Nordholts <martinn@svn.gnome.org>
|
||||
|
||||
* 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.
|
||||
|
||||
2008-10-19 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* configure.in: add -Wmissing-format-attribute to CFLAGS.
|
||||
|
|
|
@ -56,6 +56,11 @@ static const GimpActionEntry debug_actions[] =
|
|||
{ "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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -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_dump_attached_data_cmd_callback (GtkAction *action,
|
|||
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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 />
|
||||
|
|
Loading…
Reference in New Issue