summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-08-28 22:26:48 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:32 +0200
commit2fc80e6102ff73474cc5f993df072d7cbbe3c9b9 (patch)
treed299123841ac274a413bf2df26fcabbceaa5ec51 /gdk
parentc64946c52d170b49c0a8ddb7500a8eb2dd3feb41 (diff)
downloadgtk+-2fc80e6102ff73474cc5f993df072d7cbbe3c9b9.tar.gz
gdk: Create paint surfaces of the same content as the window
Previously, we failed to create RGBA double buffers for RGBA windows.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkwindow.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 22f56e6c16..863c943df3 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2647,6 +2647,20 @@ gdk_window_get_state (GdkWindow *window)
return private->state;
}
+static cairo_content_t
+gdk_window_get_content (GdkWindow *window)
+{
+ cairo_surface_t *surface;
+ cairo_content_t content;
+
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+
+ surface = _gdk_drawable_ref_cairo_surface (window);
+ content = cairo_surface_get_content (surface);
+ cairo_surface_destroy (surface);
+
+ return content;
+}
/* This creates an empty "implicit" paint region for the impl window.
* By itself this does nothing, but real paints to this window
@@ -2693,7 +2707,7 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
paint->uses_implicit = FALSE;
paint->flushed = FALSE;
paint->surface = gdk_window_create_similar_surface (window,
- CAIRO_CONTENT_COLOR,
+ gdk_window_get_content (window),
MAX (rect->width, 1),
MAX (rect->height, 1));
cairo_surface_set_device_offset (paint->surface, -rect->x, -rect->y);
@@ -2917,7 +2931,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
{
paint->uses_implicit = FALSE;
paint->surface = gdk_window_create_similar_surface (window,
- CAIRO_CONTENT_COLOR,
+ gdk_window_get_content (window),
MAX (clip_box.width, 1),
MAX (clip_box.height, 1));
}