summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-08-26 13:46:34 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:29 +0200
commit332652f702c3cd31a4bdccc709bef6922028185e (patch)
treeed0858cbe6b46ec909ce053741c4f805c741030f /demos
parentebdf26e1d8b864e2f61b64840f4ee2d445d34009 (diff)
downloadgtk+-332652f702c3cd31a4bdccc709bef6922028185e.tar.gz
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.
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/offscreen_window.c8
-rw-r--r--demos/gtk-demo/offscreen_window2.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c
index 0e0d067206..b1d766e5a0 100644
--- a/demos/gtk-demo/offscreen_window.c
+++ b/demos/gtk-demo/offscreen_window.c
@@ -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);
diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c
index d162a360e7..fcc3214075 100644
--- a/demos/gtk-demo/offscreen_window2.c
+++ b/demos/gtk-demo/offscreen_window2.c
@@ -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);