gdkcairo: add gdk_cairo_create_in_area_libgtk_only()
Gives theme engines a cairo context clipped only to the window clip rectangles that touch the area being drawn.
This commit is contained in:
parent
6db19d9277
commit
90df8be3fa
3 changed files with 32 additions and 0 deletions
|
|
@ -325,6 +325,7 @@ gdk_fontset_load_for_display
|
|||
#if IN_HEADER(__GDK_CAIRO_H__)
|
||||
#if IN_FILE(__GDK_CAIRO_C__)
|
||||
gdk_cairo_create
|
||||
gdk_cairo_create_in_area_libgtk_only
|
||||
gdk_cairo_reset_clip
|
||||
gdk_cairo_set_source_color
|
||||
gdk_cairo_set_source_pixbuf
|
||||
|
|
|
|||
|
|
@ -98,6 +98,33 @@ _gdk_cairo_create_in_area (GdkDrawable *drawable,
|
|||
return cr;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cairo_create_in_area_libgtk_only:
|
||||
* @drawable: a #GdkDrawable
|
||||
* @area: the area that will be drawn
|
||||
*
|
||||
* Like gdk_cairo_create(), for drawing that stays inside @area: of the
|
||||
* clip of a window only the rectangles meeting @area are given to cairo,
|
||||
* which within @area is the same clip. Theme engines that clip to the
|
||||
* area they are given anyway spare cairo the whole clip of the window,
|
||||
* which during an expose can be many rectangles, for each part they
|
||||
* draw. Private to GTK+ and its modules.
|
||||
*
|
||||
* Return value: A newly created Cairo context. Free with
|
||||
* cairo_destroy() when you are done drawing.
|
||||
**/
|
||||
cairo_t *
|
||||
gdk_cairo_create_in_area_libgtk_only (GdkDrawable *drawable,
|
||||
const GdkRectangle *area)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
|
||||
|
||||
if (!area)
|
||||
return gdk_cairo_create (drawable);
|
||||
|
||||
return _gdk_cairo_create_in_area (drawable, area);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cairo_reset_clip:
|
||||
* @cr: a #cairo_t
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@
|
|||
G_BEGIN_DECLS
|
||||
|
||||
cairo_t *gdk_cairo_create (GdkDrawable *drawable);
|
||||
|
||||
/* private, for the theme engines of GTK+ */
|
||||
cairo_t *gdk_cairo_create_in_area_libgtk_only (GdkDrawable *drawable,
|
||||
const GdkRectangle *area);
|
||||
void gdk_cairo_reset_clip (cairo_t *cr,
|
||||
GdkDrawable *drawable);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue