[gtk+/gtk-2-24] quartz: Reset drawable on pattern callback info when gc is updated
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] quartz: Reset drawable on pattern callback info when gc is updated
- Date: Sun, 24 Oct 2010 12:54:19 +0000 (UTC)
commit dfd7e05123042ce087658124f335afb1567d923d
Author: Kristian Rietveld <kris gtk org>
Date: Thu Oct 21 21:15:09 2010 +0200
quartz: Reset drawable on pattern callback info when gc is updated
gdk/quartz/gdkgc-quartz.c | 12 +++++++++++-
gdk/quartz/gdkprivate-quartz.h | 1 +
2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gdk/quartz/gdkgc-quartz.c b/gdk/quartz/gdkgc-quartz.c
index c43db8e..8b60a02 100644
--- a/gdk/quartz/gdkgc-quartz.c
+++ b/gdk/quartz/gdkgc-quartz.c
@@ -613,16 +613,19 @@ _gdk_quartz_gc_update_cg_context (GdkGC *gc,
}
else
{
+ struct PatternCallbackInfo *info;
+
if (!private->ts_pattern)
{
gfloat width, height;
gboolean is_colored = FALSE;
CGPatternCallbacks callbacks = { 0, NULL, NULL };
- struct PatternCallbackInfo *info;
CGPoint phase;
GdkPixmapImplQuartz *pix_impl = NULL;
info = g_new (struct PatternCallbackInfo, 1);
+ private->ts_pattern_info = info;
+
/* Won't ref to avoid circular dependencies */
info->drawable = drawable;
info->private_gc = private;
@@ -667,6 +670,13 @@ _gdk_quartz_gc_update_cg_context (GdkGC *gc,
is_colored,
&callbacks);
}
+ else
+ info = (struct PatternCallbackInfo *)private->ts_pattern_info;
+
+ /* Update drawable in the pattern callback info. Again, we
+ * won't ref to avoid circular dependencies.
+ */
+ info->drawable = drawable;
baseSpace = (fill == GDK_STIPPLED) ? CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB) : NULL;
patternSpace = CGColorSpaceCreatePattern (baseSpace);
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index 56379a9..1a2526e 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -72,6 +72,7 @@ struct _GdkGCQuartz
CGFloat dash_phase;
CGPatternRef ts_pattern;
+ void *ts_pattern_info;
guint is_window : 1;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]