API: Change offscreen windows to use a cairo_surface_t

This requires changes to all the offscreen surface getters that used to
return a GdkPixmap before.
This commit is contained in:
Benjamin Otte
2010-08-26 13:46:34 +02:00
parent ebdf26e1d8
commit 332652f702
13 changed files with 72 additions and 74 deletions

View File

@ -485,13 +485,13 @@ gtk_rotated_bin_expose (GtkWidget *widget,
window = gtk_widget_get_window (widget);
if (event->window == window)
{
GdkPixmap *pixmap;
cairo_surface_t *surface;
GtkAllocation child_area;
cairo_t *cr;
if (bin->child && gtk_widget_get_visible (bin->child))
{
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
surface = gdk_offscreen_window_get_surface (bin->offscreen_window);
gtk_widget_get_allocation (bin->child, &child_area);
cr = gdk_cairo_create (window);
@ -508,11 +508,11 @@ gtk_rotated_bin_expose (GtkWidget *widget,
cairo_translate (cr, -child_area.width / 2, -child_area.height / 2);
/* clip */
gdk_drawable_get_size (pixmap, &width, &height);
gdk_drawable_get_size (bin->offscreen_window, &width, &height);
cairo_rectangle (cr, 0, 0, width, height);
cairo_clip (cr);
/* paint */
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
cairo_destroy (cr);

View File

@ -389,15 +389,15 @@ gtk_mirror_bin_expose (GtkWidget *widget,
window = gtk_widget_get_window (widget);
if (event->window == window)
{
GdkPixmap *pixmap;
cairo_surface_t *surface;
cairo_t *cr;
cairo_matrix_t matrix;
cairo_pattern_t *mask;
if (bin->child && gtk_widget_get_visible (bin->child))
{
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
gdk_drawable_get_size (pixmap, &width, &height);
surface = gdk_offscreen_window_get_surface (bin->offscreen_window);
gdk_drawable_get_size (bin->offscreen_window, &width, &height);
cr = gdk_cairo_create (window);
@ -407,7 +407,7 @@ gtk_mirror_bin_expose (GtkWidget *widget,
cairo_clip (cr);
/* paint the offscreen child */
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
cairo_restore (cr);
@ -420,7 +420,7 @@ gtk_mirror_bin_expose (GtkWidget *widget,
cairo_rectangle (cr, 0, height, width, height);
cairo_clip (cr);
gdk_cairo_set_source_pixmap (cr, pixmap, 0, height);
cairo_set_source_surface (cr, surface, 0, height);
/* create linear gradient as mask-pattern to fade out the source */
mask = cairo_pattern_create_linear (0.0, height, 0.0, 2*height);