~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gdk/gdkcairo.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-09-23 06:36:41 UTC
  • mfrom: (1.3.2 upstream)
  • mto: (72.2.8 sid) (1.6.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: james.westby@ubuntu.com-20090923063641-69c7g7h68iy4u5o3
Import upstream version 2.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
  surface = _gdk_drawable_ref_cairo_surface (drawable);
52
52
  cr = cairo_create (surface);
 
53
 
 
54
  if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
 
55
    GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
 
56
    
53
57
  cairo_surface_destroy (surface);
54
58
 
55
59
  return cr;
56
60
}
57
61
 
58
62
/**
 
63
 * gdk_cairo_reset_clip:
 
64
 * @cr: a #cairo_t
 
65
 * @drawable: a #GdkDrawable
 
66
 *
 
67
 * Resets the clip region for a Cairo context created by gdk_cairo_create().
 
68
 *
 
69
 * This resets the clip region to the "empty" state for the given drawable.
 
70
 * This is required for non-native windows since a direct call to
 
71
 * cairo_reset_clip() would unset the clip region inherited from the
 
72
 * drawable (i.e. the window clip region), and thus let you e.g.
 
73
 * draw outside your window.
 
74
 *
 
75
 * This is rarely needed though, since most code just create a new cairo_t
 
76
 * using gdk_cairo_create() each time they want to draw something.
 
77
 *
 
78
 * Since: 2.18
 
79
 **/
 
80
void
 
81
gdk_cairo_reset_clip (cairo_t            *cr,
 
82
                      GdkDrawable        *drawable)
 
83
{
 
84
  cairo_reset_clip (cr);
 
85
 
 
86
  if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
 
87
    GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
 
88
}
 
89
 
 
90
/**
59
91
 * gdk_cairo_set_source_color:
60
92
 * @cr: a #cairo_t
61
93
 * @color: a #GdkColor