Don't get and release the context for each point, just once, speeds up
2006-08-07 Richard Hult <richard@imendio.com> * gdk/quartz/gdkdrawable-quartz.c (gdk_quartz_draw_points): Don't get and release the context for each point, just once, speeds up drawing many points a lot.
This commit is contained in:
committed by
Richard Hult
parent
5d2863cb85
commit
d2014a6084
@ -1,3 +1,9 @@
|
|||||||
|
2006-08-07 Richard Hult <richard@imendio.com>
|
||||||
|
|
||||||
|
* gdk/quartz/gdkdrawable-quartz.c (gdk_quartz_draw_points): Don't
|
||||||
|
get and release the context for each point, just once, speeds up
|
||||||
|
drawing many points a lot.
|
||||||
|
|
||||||
2006-08-07 Michael Natterer <mitch@imendio.com>
|
2006-08-07 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
* gtk/gtkdnd-quartz.c (gtk_drag_dest_unset): need to disconnect
|
* gtk/gtkdnd-quartz.c (gtk_drag_dest_unset): need to disconnect
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
2006-08-07 Richard Hult <richard@imendio.com>
|
||||||
|
|
||||||
|
* gdk/quartz/gdkdrawable-quartz.c (gdk_quartz_draw_points): Don't
|
||||||
|
get and release the context for each point, just once, speeds up
|
||||||
|
drawing many points a lot.
|
||||||
|
|
||||||
2006-08-07 Michael Natterer <mitch@imendio.com>
|
2006-08-07 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
* gtk/gtkdnd-quartz.c (gtk_drag_dest_unset): need to disconnect
|
* gtk/gtkdnd-quartz.c (gtk_drag_dest_unset): need to disconnect
|
||||||
|
|||||||
@ -326,15 +326,24 @@ gdk_quartz_draw_points (GdkDrawable *drawable,
|
|||||||
GdkPoint *points,
|
GdkPoint *points,
|
||||||
gint npoints)
|
gint npoints)
|
||||||
{
|
{
|
||||||
|
CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!context)
|
||||||
|
return;
|
||||||
|
|
||||||
|
gdk_quartz_update_context_from_gc (context, gc);
|
||||||
|
gdk_quartz_set_context_fill_color_from_pixel (context, gdk_drawable_get_colormap (drawable),
|
||||||
|
_gdk_gc_get_fg_pixel (gc));
|
||||||
|
|
||||||
/* Just draw 1x1 rectangles */
|
/* Just draw 1x1 rectangles */
|
||||||
for (i = 0; i < npoints; i++)
|
for (i = 0; i < npoints; i++)
|
||||||
{
|
{
|
||||||
gdk_draw_rectangle (drawable, gc, TRUE,
|
CGRect rect = CGRectMake (points[i].x + 0.5, points[i].y + 0.5, 1, 1);
|
||||||
points[i].x, points[i].y,
|
CGContextFillRect (context, rect);
|
||||||
1, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gdk_quartz_drawable_release_context (drawable, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user