From 69745597e4a865e3abb02b4191a8e3f5d2275702 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Fri, 5 Oct 2007 14:02:31 +0000 Subject: [PATCH] Use drawing depth from window. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@25518 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 ++++++++- Source/cairo/CairoGState.m | 2 ++ Source/cairo/XGCairoXImageSurface.m | 10 ++++------ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 059b4c2..802cef5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-05 Fred Kiefer + + * Source/cairo/CairoGState.m (-copyWithZone:): Only use cairo 1.4 + functions when cairo version fits. + * Source/cairo/XGCairoXImageSurface.m (-initWithDevice:): Use + depth from window device. + 2007-10-01 Fred Kiefer * Source/x11/XGDragView.m: Add missing include. @@ -50,7 +57,7 @@ * configure.ac, * configure: Move checking for Xrender extension. - * Source/cairo/XGCairoXImageSurface.m: Add includefor config.h. + * Source/cairo/XGCairoXImageSurface.m: Add include for config.h. Patch by Yen-Ju Chen . 2007-09-04 Fred Kiefer diff --git a/Source/cairo/CairoGState.m b/Source/cairo/CairoGState.m index 16034ba..efbeba2 100644 --- a/Source/cairo/CairoGState.m +++ b/Source/cairo/CairoGState.m @@ -148,6 +148,7 @@ cairo_set_line_join(copy->_ct, cairo_get_line_join(_ct)); cairo_set_miter_limit(copy->_ct, cairo_get_miter_limit(_ct)); +#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1, 4, 0) // In cairo 1.4 there is a way get the dash. num_dashes = cairo_get_dash_count(_ct); if (num_dashes != 0) @@ -186,6 +187,7 @@ } cairo_rectangle_list_destroy(clip_rects); } +#endif } return copy; diff --git a/Source/cairo/XGCairoXImageSurface.m b/Source/cairo/XGCairoXImageSurface.m index 261488f..d118e82 100644 --- a/Source/cairo/XGCairoXImageSurface.m +++ b/Source/cairo/XGCairoXImageSurface.m @@ -36,15 +36,13 @@ gsDevice = device; - #ifdef XRENDER - di.drawing_depth = 32; - #else - di.drawing_depth = 24; - #endif + di.drawing_depth = GSWINDEVICE->depth; + // FIXME: The next four lines may be wrong for depth <> 32. + // But then art uses a depth of 24 for 32 bit modes. Strange! di.bytes_per_pixel = 4; di.inline_alpha = YES; di.inline_alpha_ofs = 0; - // This method is somewhat special as it does not return an autoreleased object + // FIXME: This method is somewhat special as it does not return an autoreleased object wi = [XWindowBuffer windowBufferForWindow: GSWINDEVICE depthInfo: &di]; _surface = cairo_image_surface_create_for_data((unsigned char*)wi->data,