[gimp] app: remove the draw timeout from GimpDrawTool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: remove the draw timeout from GimpDrawTool
- Date: Wed, 22 Sep 2010 13:32:12 +0000 (UTC)
commit 24654e0df301a0122b410d66fd5cd1ab2b7a4370
Author: Michael Natterer <mitch gimp org>
Date: Wed Sep 22 15:31:17 2010 +0200
app: remove the draw timeout from GimpDrawTool
This slows down painting again, but it's in the way of refactoring so
the slowdown is temporary.
app/tools/gimpdrawtool.c | 48 +---------------------------------------------
app/tools/gimpdrawtool.h | 1 -
2 files changed, 1 insertions(+), 48 deletions(-)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index 13bb667..4ddf25c 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -42,10 +42,6 @@
#include "gimpdrawtool.h"
-#define DRAW_TIMEOUT 4
-#define USE_TIMEOUT 1
-
-
static void gimp_draw_tool_dispose (GObject *object);
static gboolean gimp_draw_tool_has_display (GimpTool *tool,
@@ -109,14 +105,6 @@ gimp_draw_tool_init (GimpDrawTool *draw_tool)
static void
gimp_draw_tool_dispose (GObject *object)
{
- GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (object);
-
- if (draw_tool->draw_timeout)
- {
- g_source_remove (draw_tool->draw_timeout);
- draw_tool->draw_timeout = 0;
- }
-
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@@ -177,23 +165,10 @@ gimp_draw_tool_control (GimpTool *tool,
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
}
-#ifdef USE_TIMEOUT
-static gboolean
-gimp_draw_tool_draw_timeout (GimpDrawTool *draw_tool)
-{
- draw_tool->draw_timeout = 0;
-
- gimp_draw_tool_draw (draw_tool);
-
- return FALSE;
-}
-#endif
-
static void
gimp_draw_tool_draw (GimpDrawTool *draw_tool)
{
- if (! draw_tool->draw_timeout &&
- draw_tool->paused_count == 0 &&
+ if (draw_tool->paused_count == 0 &&
draw_tool->display)
{
GIMP_DRAW_TOOL_GET_CLASS (draw_tool)->draw (draw_tool);
@@ -229,12 +204,6 @@ gimp_draw_tool_stop (GimpDrawTool *draw_tool)
gimp_draw_tool_draw (draw_tool);
- if (draw_tool->draw_timeout)
- {
- g_source_remove (draw_tool->draw_timeout);
- draw_tool->draw_timeout = 0;
- }
-
draw_tool->display = NULL;
}
@@ -254,12 +223,6 @@ gimp_draw_tool_pause (GimpDrawTool *draw_tool)
gimp_draw_tool_draw (draw_tool);
draw_tool->paused_count++;
-
- if (draw_tool->draw_timeout)
- {
- g_source_remove (draw_tool->draw_timeout);
- draw_tool->draw_timeout = 0;
- }
}
void
@@ -270,16 +233,7 @@ gimp_draw_tool_resume (GimpDrawTool *draw_tool)
draw_tool->paused_count--;
-#ifdef USE_TIMEOUT
- if (draw_tool->paused_count == 0 && ! draw_tool->draw_timeout)
- draw_tool->draw_timeout =
- gdk_threads_add_timeout_full (G_PRIORITY_HIGH_IDLE,
- DRAW_TIMEOUT,
- (GSourceFunc) gimp_draw_tool_draw_timeout,
- draw_tool, NULL);
-#else
gimp_draw_tool_draw (draw_tool);
-#endif
}
gboolean
diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h
index 2ff4067..2a54489 100644
--- a/app/tools/gimpdrawtool.h
+++ b/app/tools/gimpdrawtool.h
@@ -42,7 +42,6 @@ struct _GimpDrawTool
gint paused_count; /* count to keep track of multiple pauses */
gboolean is_drawn; /* is the stuff we draw currently visible */
- guint draw_timeout; /* draw delay timeout ID */
};
struct _GimpDrawToolClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]