Commit 15d6ae40 authored by Attilio Fiandrotti's avatar Attilio Fiandrotti Committed by Attilio Fiandrotti

Applied a patch by Claudio Ciccani which fixes the mixing of gdk and cairo

2007-12-11  Attilio Fiandrotti  <attilio.fiandrotti@gmail.com>

	* gdk/directfb/gdkdrawable-directfb.c: Applied a patch by Claudio
	Ciccani	which fixes the mixing of gdk and cairo rendering.

svn path=/trunk/; revision=19161
parent 13a8c051
2007-12-11 Attilio Fiandrotti <attilio.fiandrotti@gmail.com>
* gdk/directfb/gdkdrawable-directfb.c: Applied a patch by Claudio
Ciccani which fixes the mixing of gdk and cairo rendering.
2007-12-11 Mathias Hasselmann <mathias@openismus.com>
* gtk/gtkdnd.c, gtk/gtkwidget.c: Mention impact of GtkDestDefaults
......
......@@ -1542,27 +1542,39 @@ gdk_directfb_cairo_surface_destroy (void *data)
static cairo_surface_t *
gdk_directfb_ref_cairo_surface (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_DIRECTFB (drawable), NULL);
GdkDrawableImplDirectFB *impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
IDirectFB *dfb = GDK_DISPLAY_DFB(gdk_drawable_get_display(drawable))->directfb;
if (!impl->cairo_surface) {
// IDirectFBSurface *surface;
// if (impl->surface->GetSubSurface (impl->surface, NULL, &surface) == DFB_OK) {
//impl->cairo_surface = cairo_directfb_surface_create (dfb, surface);
g_assert( impl->surface != NULL);
impl->cairo_surface = cairo_directfb_surface_create (dfb,impl->surface);
g_assert( impl->cairo_surface != NULL);
GdkDrawableImplDirectFB *impl;
IDirectFB *dfb;
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_DIRECTFB (drawable), NULL);
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
dfb = GDK_DISPLAY_DFB(gdk_drawable_get_display(drawable))->directfb;
if (!impl->cairo_surface) {
IDirectFBSurface *surface;
g_assert (impl->surface != NULL);
#if defined(CAIRO_VERSION_CODE) && CAIRO_VERSION_CODE >= CAIRO_VERSION_ENCODE(1,5,5)
impl->surface->GetSubSurface (impl->surface, NULL, &surface);
#else
surface = impl->surface;
#endif
if (surface) {
impl->cairo_surface = cairo_directfb_surface_create (dfb, surface);
if (impl->cairo_surface) {
cairo_surface_set_user_data (impl->cairo_surface,
&gdk_directfb_cairo_key, drawable,
gdk_directfb_cairo_surface_destroy);
// surface->Release (surface);
//}
} else {
cairo_surface_reference (impl->cairo_surface);
}
#if defined(CAIRO_VERSION_CODE) && CAIRO_VERSION_CODE >= CAIRO_VERSION_ENCODE(1,5,5)
surface->Release (surface);
#endif
}
g_assert( impl->cairo_surface != NULL);
} else {
cairo_surface_reference (impl->cairo_surface);
}
g_assert (impl->cairo_surface != NULL);
return impl->cairo_surface;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment