[gnome-mag/cairo-port] Remove cursor backing pixels
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mag/cairo-port] Remove cursor backing pixels
- Date: Fri, 13 Aug 2010 02:44:50 +0000 (UTC)
commit e58dc8c2dc2b82738d1481088f8565731ccf1b44
Author: Benjamin Otte <otte redhat com>
Date: Fri Aug 13 04:32:18 2010 +0200
Remove cursor backing pixels
The code does not use them for anything, it just spends a whole lot of
work creating them.
magnifier/zoom-region-private.h | 1 -
magnifier/zoom-region.c | 31 -------------------------------
2 files changed, 0 insertions(+), 32 deletions(-)
---
diff --git a/magnifier/zoom-region-private.h b/magnifier/zoom-region-private.h
index 8402a6f..a91a1c3 100644
--- a/magnifier/zoom-region-private.h
+++ b/magnifier/zoom-region-private.h
@@ -40,7 +40,6 @@ struct _ZoomRegionPrivate {
GdkPixbuf *source_pixbuf_cache;
GdkPixbuf *scaled_pixbuf;
GdkPixmap *pixmap;
- GdkPixmap *cursor_backing_pixels;
GdkRectangle cursor_backing_rect;
GdkPoint last_cursor_pos;
GdkPoint last_drawn_crosswire_pos;
diff --git a/magnifier/zoom-region.c b/magnifier/zoom-region.c
index 3faece0..49401eb 100644
--- a/magnifier/zoom-region.c
+++ b/magnifier/zoom-region.c
@@ -929,41 +929,12 @@ zoom_region_paint_cursor (ZoomRegion *zoom_region,
if (gdk_rectangle_intersect (clip_rect, &rect, &intersct))
{
cairo_pattern_t *cursor;
- int width = 0, height = 0;
cursor= magnifier_get_cursor (magnifier);
if (!cursor)
return;
zoom_region->priv->cursor_backing_rect = rect;
- if (zoom_region->priv->cursor_backing_pixels) {
- gdk_drawable_get_size (zoom_region->priv->cursor_backing_pixels,
- &width, &height);
- }
- if (rect.width != width || rect.height != height)
- {
- if (zoom_region->priv->cursor_backing_pixels) {
- g_object_unref (zoom_region->priv->cursor_backing_pixels);
- }
- zoom_region->priv->cursor_backing_pixels =
- gdk_pixmap_new (gtk_widget_get_window (GTK_WIDGET (zoom_region)),
- rect.width,
- rect.height,
- -1);
- }
- if (gtk_widget_get_window (GTK_WIDGET (zoom_region)) != NULL)
- {
- if (zoom_region->priv->default_gc == NULL)
- zoom_region->priv->default_gc = gdk_gc_new(gtk_widget_get_window (GTK_WIDGET (zoom_region)));
- gdk_draw_drawable (zoom_region->priv->cursor_backing_pixels,
- zoom_region->priv->default_gc,
- gtk_widget_get_window (GTK_WIDGET (zoom_region)),
- rect.x,
- rect.y,
- 0, 0,
- rect.width,
- rect.height);
- }
DEBUG_RECT ("painting", rect);
if (GDK_IS_DRAWABLE (gtk_widget_get_window (GTK_WIDGET (zoom_region))))
{
@@ -2990,8 +2961,6 @@ zoom_region_finalize (GObject *region)
g_object_unref (zoom_region->priv->pixmap);
zoom_region->priv->pixmap = NULL;
zoom_region->priv->parent = NULL;
- if (zoom_region->priv->cursor_backing_pixels)
- g_object_unref (zoom_region->priv->cursor_backing_pixels);
g_free (zoom_region->priv);
zoom_region->priv = NULL;
#ifdef ZOOM_REGION_DEBUG
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]