[gtk-osx-users] gtk 2.24.6 changes breaks libgnomecanvas pixbufs
- From: Andy Loening <loening stanford edu>
- To: gtk-osx-users-list gnome org
- Subject: [gtk-osx-users] gtk 2.24.6 changes breaks libgnomecanvas pixbufs
- Date: Fri, 11 Nov 2011 11:18:35 -0800
Hi,
The quartz changes in gtk version 2.24.6 break the pixbuf functionality
of libgnomecanvas. This is easily seen running the demos/canvas_demo
program included in the libgnomecanvas package, and seeing that the
toroid image is not displayed (it's still displayed in the antialias mode).
I tracked down the code change that caused this to the changing of the
gdk_quartz_gc_update_cg_context from returning void to a boolean.
Changes are in the files gdk/quartz/gdkdrawable-quartz.c,
gdk/quartz/gdkgc-quartz.c, and gdk/quartz/gdkprivate-quartz.h.
A patch for 2.24.6 that reverts these changes and returns this
functionality is attached. Presumably, this is not the correct way to
fix things, but it works for me...
Andy
diff -burN gtk+-2.24.6_orig/gdk/quartz/gdkdrawable-quartz.c gtk+-2.24.6/gdk/quartz/gdkdrawable-quartz.c
--- gtk+-2.24.6_orig/gdk/quartz/gdkdrawable-quartz.c 2011-08-15 19:30:52.000000000 -0700
+++ gtk+-2.24.6/gdk/quartz/gdkdrawable-quartz.c 2011-11-10 16:25:55.000000000 -0800
@@ -161,16 +161,13 @@
if (!context)
return;
- if(!_gdk_quartz_gc_update_cg_context (gc,
+ _gdk_quartz_gc_update_cg_context (gc,
drawable,
context,
filled ?
GDK_QUARTZ_CONTEXT_FILL :
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ GDK_QUARTZ_CONTEXT_STROKE);
+
if (filled)
{
CGRect rect = CGRectMake (x, y, width, height);
@@ -205,14 +202,11 @@
if (!context)
return;
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
filled ?
GDK_QUARTZ_CONTEXT_FILL :
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ GDK_QUARTZ_CONTEXT_STROKE);
+
start_angle = angle1 * 2.0 * G_PI / 360.0 / 64.0;
end_angle = start_angle + angle2 * 2.0 * G_PI / 360.0 / 64.0;
@@ -277,14 +271,11 @@
if (!context)
return;
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
filled ?
GDK_QUARTZ_CONTEXT_FILL :
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ GDK_QUARTZ_CONTEXT_STROKE);
+
if (filled)
{
CGContextMoveToPoint (context, points[0].x, points[0].y);
@@ -394,12 +385,9 @@
if (!context)
return;
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ GDK_QUARTZ_CONTEXT_STROKE);
+
CGContextClipToRect (context, CGRectMake (xdest, ydest, width, height));
CGContextTranslateCTM (context, xdest - xsrc, ydest - ysrc +
pixmap_impl->height);
@@ -430,13 +418,10 @@
if (!context)
return;
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
GDK_QUARTZ_CONTEXT_STROKE |
- GDK_QUARTZ_CONTEXT_FILL))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ GDK_QUARTZ_CONTEXT_FILL);
+
/* Just draw 1x1 rectangles */
for (i = 0; i < npoints; i++)
{
@@ -489,12 +474,9 @@
private = GDK_GC_QUARTZ (gc);
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ GDK_QUARTZ_CONTEXT_STROKE);
+
for (i = 0; i < nsegs; i++)
{
gint xfix, yfix;
@@ -529,12 +511,9 @@
private = GDK_GC_QUARTZ (gc);
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ GDK_QUARTZ_CONTEXT_STROKE);
+
CGContextMoveToPoint (context, points[0].x + 0.5, points[0].y + 0.5);
for (i = 1; i < npoints - 1; i++)
@@ -599,12 +578,9 @@
CGDataProviderRelease (data_provider);
CGColorSpaceRelease (colorspace);
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ GDK_QUARTZ_CONTEXT_STROKE);
+
CGContextClipToRect (context, CGRectMake (dest_x, dest_y, width, height));
CGContextTranslateCTM (context, dest_x - src_x, dest_y - src_y + pixbuf_height);
CGContextScaleCTM (context, 1, -1);
@@ -648,12 +624,8 @@
CGDataProviderRelease (data_provider);
CGColorSpaceRelease (colorspace);
- if (!_gdk_quartz_gc_update_cg_context (gc, drawable, context,
- GDK_QUARTZ_CONTEXT_STROKE))
- {
- gdk_quartz_drawable_release_context (drawable, context);
- return;
- }
+ _gdk_quartz_gc_update_cg_context (gc, drawable, context,
+ GDK_QUARTZ_CONTEXT_STROKE);
CGContextClipToRect (context, CGRectMake (xdest, ydest, width, height));
CGContextTranslateCTM (context, xdest - xsrc, ydest - ysrc + image->height);
diff -burN gtk+-2.24.6_orig/gdk/quartz/gdkgc-quartz.c gtk+-2.24.6/gdk/quartz/gdkgc-quartz.c
--- gtk+-2.24.6_orig/gdk/quartz/gdkgc-quartz.c 2011-11-10 13:26:55.000000000 -0800
+++ gtk+-2.24.6/gdk/quartz/gdkgc-quartz.c 2011-11-10 16:44:46.000000000 -0800
@@ -436,7 +436,7 @@
CGImageRelease (pattern_image);
}
-gboolean
+void
_gdk_quartz_gc_update_cg_context (GdkGC *gc,
GdkDrawable *drawable,
CGContextRef context,
@@ -446,10 +446,10 @@
guint32 fg_pixel;
guint32 bg_pixel;
- g_return_val_if_fail (gc == NULL || GDK_IS_GC (gc), FALSE);
+ g_return_if_fail (gc == NULL || GDK_IS_GC (gc));
if (!gc)
- return FALSE;
+ return;
private = GDK_GC_QUARTZ (gc);
@@ -463,9 +463,6 @@
gdk_region_get_rectangles (_gdk_gc_get_clip_region (gc),
&rects, &n_rects);
- if (!n_rects)
- return FALSE;
-
if (n_rects == 1)
cg_rects = ▭
else
@@ -718,6 +715,4 @@
private->is_window = TRUE;
else
private->is_window = FALSE;
-
- return TRUE;
}
diff -burN gtk+-2.24.6_orig/gdk/quartz/gdkprivate-quartz.h gtk+-2.24.6/gdk/quartz/gdkprivate-quartz.h
--- gtk+-2.24.6_orig/gdk/quartz/gdkprivate-quartz.h 2011-08-15 19:30:52.000000000 -0700
+++ gtk+-2.24.6/gdk/quartz/gdkprivate-quartz.h 2011-11-10 16:26:06.000000000 -0800
@@ -125,7 +125,7 @@
GdkGC *_gdk_quartz_gc_new (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask values_mask);
-gboolean _gdk_quartz_gc_update_cg_context (GdkGC *gc,
+void _gdk_quartz_gc_update_cg_context (GdkGC *gc,
GdkDrawable *drawable,
CGContextRef context,
GdkQuartzContextValuesMask mask);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]