mirror of https://github.com/GNOME/gimp.git
app: undraw the old canvas items only before drawing new ones
or when the draw tool is really stopped. This seems to get rid of any remaining flickering and also reduces expose events. Also get rid of the "is_drawn" state and API because they make no sense any longer.
This commit is contained in:
parent
e8d46f7098
commit
cbaf997ae2
|
@ -105,9 +105,8 @@ static void
|
|||
gimp_draw_tool_init (GimpDrawTool *draw_tool)
|
||||
{
|
||||
draw_tool->display = NULL;
|
||||
|
||||
draw_tool->paused_count = 0;
|
||||
draw_tool->is_drawn = FALSE;
|
||||
draw_tool->items = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -201,29 +200,24 @@ gimp_draw_tool_clear_items (GimpDrawTool *draw_tool)
|
|||
static void
|
||||
gimp_draw_tool_draw (GimpDrawTool *draw_tool)
|
||||
{
|
||||
if (draw_tool->paused_count == 0 &&
|
||||
draw_tool->display)
|
||||
if (draw_tool->display && draw_tool->paused_count == 0)
|
||||
{
|
||||
gimp_draw_tool_invalidate_items (draw_tool);
|
||||
gimp_draw_tool_clear_items (draw_tool);
|
||||
|
||||
GIMP_DRAW_TOOL_GET_CLASS (draw_tool)->draw (draw_tool);
|
||||
|
||||
gimp_draw_tool_invalidate_items (draw_tool);
|
||||
|
||||
draw_tool->is_drawn = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_draw_tool_undraw (GimpDrawTool *draw_tool)
|
||||
{
|
||||
if (draw_tool->paused_count == 0 &&
|
||||
draw_tool->display)
|
||||
if (draw_tool->display)
|
||||
{
|
||||
gimp_draw_tool_invalidate_items (draw_tool);
|
||||
gimp_draw_tool_clear_items (draw_tool);
|
||||
|
||||
draw_tool->is_drawn = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,8 +264,6 @@ gimp_draw_tool_pause (GimpDrawTool *draw_tool)
|
|||
{
|
||||
g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
|
||||
|
||||
gimp_draw_tool_undraw (draw_tool);
|
||||
|
||||
draw_tool->paused_count++;
|
||||
}
|
||||
|
||||
|
@ -286,14 +278,6 @@ gimp_draw_tool_resume (GimpDrawTool *draw_tool)
|
|||
gimp_draw_tool_draw (draw_tool);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_draw_tool_is_drawn (GimpDrawTool *draw_tool)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DRAW_TOOL (draw_tool), FALSE);
|
||||
|
||||
return draw_tool->is_drawn;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_draw_tool_draw_items (GimpDrawTool *draw_tool,
|
||||
cairo_t *cr)
|
||||
|
@ -306,7 +290,7 @@ gimp_draw_tool_draw_items (GimpDrawTool *draw_tool,
|
|||
g_return_if_fail (cr != NULL);
|
||||
|
||||
if (! gimp_draw_tool_is_active (draw_tool) ||
|
||||
! gimp_draw_tool_is_drawn (draw_tool))
|
||||
draw_tool->paused_count > 0)
|
||||
return;
|
||||
|
||||
shell = gimp_display_get_shell (draw_tool->display);
|
||||
|
|
|
@ -41,7 +41,6 @@ struct _GimpDrawTool
|
|||
*/
|
||||
|
||||
gint paused_count; /* count to keep track of multiple pauses */
|
||||
gboolean is_drawn; /* is the stuff we draw currently visible */
|
||||
|
||||
GList *items;
|
||||
};
|
||||
|
@ -67,8 +66,6 @@ gboolean gimp_draw_tool_is_active (GimpDrawTool *draw_tool)
|
|||
void gimp_draw_tool_pause (GimpDrawTool *draw_tool);
|
||||
void gimp_draw_tool_resume (GimpDrawTool *draw_tool);
|
||||
|
||||
gboolean gimp_draw_tool_is_drawn (GimpDrawTool *draw_tool);
|
||||
|
||||
void gimp_draw_tool_draw_items (GimpDrawTool *draw_tool,
|
||||
cairo_t *cr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue