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> 2007-12-11 Mathias Hasselmann <mathias@openismus.com>
* gtk/gtkdnd.c, gtk/gtkwidget.c: Mention impact of GtkDestDefaults * gtk/gtkdnd.c, gtk/gtkwidget.c: Mention impact of GtkDestDefaults
......
...@@ -1542,27 +1542,39 @@ gdk_directfb_cairo_surface_destroy (void *data) ...@@ -1542,27 +1542,39 @@ gdk_directfb_cairo_surface_destroy (void *data)
static cairo_surface_t * static cairo_surface_t *
gdk_directfb_ref_cairo_surface (GdkDrawable *drawable) gdk_directfb_ref_cairo_surface (GdkDrawable *drawable)
{ {
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL); GdkDrawableImplDirectFB *impl;
g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_DIRECTFB (drawable), NULL); IDirectFB *dfb;
GdkDrawableImplDirectFB *impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable); g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
IDirectFB *dfb = GDK_DISPLAY_DFB(gdk_drawable_get_display(drawable))->directfb; g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_DIRECTFB (drawable), NULL);
if (!impl->cairo_surface) {
// IDirectFBSurface *surface; impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
// if (impl->surface->GetSubSurface (impl->surface, NULL, &surface) == DFB_OK) { dfb = GDK_DISPLAY_DFB(gdk_drawable_get_display(drawable))->directfb;
//impl->cairo_surface = cairo_directfb_surface_create (dfb, surface);
g_assert( impl->surface != NULL); if (!impl->cairo_surface) {
impl->cairo_surface = cairo_directfb_surface_create (dfb,impl->surface); IDirectFBSurface *surface;
g_assert( impl->cairo_surface != NULL); 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, cairo_surface_set_user_data (impl->cairo_surface,
&gdk_directfb_cairo_key, drawable, &gdk_directfb_cairo_key, drawable,
gdk_directfb_cairo_surface_destroy); gdk_directfb_cairo_surface_destroy);
// surface->Release (surface); }
//} #if defined(CAIRO_VERSION_CODE) && CAIRO_VERSION_CODE >= CAIRO_VERSION_ENCODE(1,5,5)
} else { surface->Release (surface);
cairo_surface_reference (impl->cairo_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; 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