gimp r27343 - in trunk: . app/actions menus
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27343 - in trunk: . app/actions menus
- Date: Mon, 20 Oct 2008 17:21:22 +0000 (UTC)
Author: martinn
Date: Mon Oct 20 17:21:21 2008
New Revision: 27343
URL: http://svn.gnome.org/viewvc/gimp?rev=27343&view=rev
Log:
* menus/image-menu.xml.in
* app/actions/debug-actions.c
* app/actions/debug-commands.c: Create dump and non-dump
groups. Also added a tooltip to the Benchmark Projection action
and removed report of number of layers.
Modified:
trunk/ChangeLog
trunk/app/actions/debug-actions.c
trunk/app/actions/debug-commands.c
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 Mon Oct 20 17:21:21 2008
@@ -43,6 +43,13 @@
G_CALLBACK (debug_mem_profile_cmd_callback),
NULL },
+ { "debug-benchmark-projection", NULL,
+ "Benchmark Projection", NULL,
+ "Invalidates the entire projection, measures the time it takes to "
+ "validate (render) it again, and print the result to stdout.",
+ G_CALLBACK (debug_benchmark_projection_cmd_callback),
+ NULL },
+
{ "debug-dump-items", NULL,
"_Dump Items", NULL, NULL,
G_CALLBACK (debug_dump_menus_cmd_callback),
@@ -56,11 +63,6 @@
{ "debug-dump-attached-data", NULL,
"Dump Attached Data", NULL, NULL,
G_CALLBACK (debug_dump_attached_data_cmd_callback),
- NULL },
-
- { "debug-benchmark-projection", NULL,
- "Dump Projection Benchmarking", NULL, NULL,
- G_CALLBACK (debug_benchmark_projection_cmd_callback),
NULL }
};
Modified: trunk/app/actions/debug-commands.c
==============================================================================
--- trunk/app/actions/debug-commands.c (original)
+++ trunk/app/actions/debug-commands.c Mon Oct 20 17:21:21 2008
@@ -31,7 +31,6 @@
#include "base/tile.h"
#include "core/gimp.h"
-#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpprojection.h"
@@ -76,6 +75,50 @@
}
void
+debug_benchmark_projection_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 the entire projection took %.0f ms\n",
+ 1000 * g_timer_elapsed (timer, NULL));
+
+ g_timer_destroy (timer);
+ }
+}
+
+void
debug_dump_menus_cmd_callback (GtkAction *action,
gpointer data)
{
@@ -153,51 +196,6 @@
debug_print_qdata (GIMP_OBJECT (user_context));
}
-void
-debug_benchmark_projection_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 the entire %d-layered projection took %.0f ms\n",
- gimp_container_num_children (gimp_image_get_layers (image)),
- 1000 * g_timer_elapsed (timer, NULL));
-
- g_timer_destroy (timer);
- }
-}
-
/* private functions */
Modified: trunk/menus/image-menu.xml.in
==============================================================================
--- trunk/menus/image-menu.xml.in (original)
+++ trunk/menus/image-menu.xml.in Mon Oct 20 17:21:21 2008
@@ -26,10 +26,11 @@
<!-- The debug-menu is automatically excluded for stable releases -->
<menu action="debug-menu" name="Debug">
<menuitem action="debug-mem-profile" />
+ <menuitem action="debug-benchmark-projection" />
+ <separator />
<menuitem action="debug-dump-items" />
<menuitem action="debug-dump-managers" />
<menuitem action="debug-dump-attached-data" />
- <menuitem action="debug-benchmark-projection" />
</menu>
<separator />
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]