I assume this is for your picdsp project.
What versions and revisions of Gtk and GtkExtra are you using ?
Can you give the hardware specs of the computer your testing this on.
From what I've read, GtkExtra2 uses Gdk for drawing and GtkExtra3 uses Cairo.
For GtkExtra+3.0.1, gtk_plot_canvas_paint() is in gtkplotcanvas.c
Code:
/**
* gtk_plot_canvas_paint:
* @canvas: a #GtkPlotCanvas.
*
*
*/
void
gtk_plot_canvas_paint (GtkPlotCanvas *canvas)
{
GtkWidget *widget;
GList *childs;
widget = GTK_WIDGET(canvas);
if(gtk_widget_get_realized(widget) && !canvas->pixmap) return;
if(canvas->freeze_count > 0) return;
if(!gtk_plot_pc_init(canvas->pc)) return;
gtk_plot_pc_gsave(canvas->pc);
if(!GTK_IS_PLOT_PS(canvas->pc) || !canvas->transparent){
if(canvas->transparent){
GdkColor white;
gdk_color_white(gtk_widget_get_colormap(GTK_WIDGET(canvas)), &white);
gtk_plot_pc_set_color(canvas->pc, &white);
} else
gtk_plot_pc_set_color(canvas->pc, &canvas->background);
gtk_plot_pc_draw_rectangle(canvas->pc,
TRUE,
0,0,canvas->pixmap_width, canvas->pixmap_height);
}
gtk_plot_canvas_draw_grid(canvas);
childs = canvas->childs;
while(childs)
{
GtkPlotCanvasChild *child;
child = GTK_PLOT_CANVAS_CHILD(childs->data);
gtk_plot_canvas_child_draw(canvas, child);
childs = childs->next;
}
gtk_plot_pc_grestore(canvas->pc);
gtk_plot_pc_leave(canvas->pc);
}
gtk_plot_pc_draw_rectangle is in gtkplotpc.c
Code:
void gtk_plot_pc_draw_rectangle (GtkPlotPC *pc,
gint filled,
gdouble x, gdouble y,
gdouble width,
gdouble height)
{
GTK_PLOT_PC_CLASS(GTK_OBJECT_GET_CLASS(GTK_OBJECT(pc)))->draw_rectangle(pc, filled, x, y, width, height);
}
And draw_rectangle is on line 216 of: gtkplotcairo.c
Code:
pc_class->draw_rectangle = gtk_plot_cairo_draw_rectangle;
And finally gtk_plot_cairo_draw_rectangle is in gtkplotcairo.c:
Code:
static void
gtk_plot_cairo_draw_rectangle (GtkPlotPC *pc,
gint filled,
gdouble x, gdouble y,
gdouble width, gdouble height)
{
cairo_t *cairo = GTK_PLOT_CAIRO(pc)->cairo;
if(!cairo)
return;
cairo_move_to(cairo, x, y);
cairo_line_to(cairo, x+width, y);
cairo_line_to(cairo, x+width, y+height);
cairo_line_to(cairo, x, y+height);
cairo_close_path(cairo);
if (filled)
cairo_fill(cairo);
else
cairo_stroke(cairo);
}
So it seams gtk_plot_canvas_paint uses Cairo and it's basic drawing routines like: cairo_move_to and cairo_line_to. So if your not already using it, switching to GtkExtra3 might speed things up a bit. Or cut out the middle man entirely and use Cairo directly like Tadeboro gave here:
http://www.gtkforums.com/viewtopic.php?f=16&t=3301&hilit=humidity