}
if (m_gdkwindow)
- gdk_draw_lines( m_gdkwindow, m_penGC, gpts, n);
+ gdk_draw_lines( m_gdkwindow, m_penGC, (GdkPoint*) gpts, n);
delete[] gpts_alloc;
}
bool originChanged;
DrawingSetup(gc, originChanged);
- gdk_draw_polygon(m_gdkwindow, gc, true, gdkpoints, n);
+ gdk_draw_polygon(m_gdkwindow, gc, true, (GdkPoint*) gdkpoints, n);
if (originChanged)
gdk_gc_set_ts_origin(gc, 0, 0);
gdkpoints[(i+1)%n].y);
}
*/
- gdk_draw_polygon( m_gdkwindow, m_penGC, FALSE, gdkpoints, n );
+ gdk_draw_polygon( m_gdkwindow, m_penGC, FALSE, (GdkPoint*) gdkpoints, n );
}
}
if (m)
mask = *m;
}
+
+ GdkPixmap* mask_new = NULL;
if (mask)
{
- GdkPixmap* mask_new = NULL;
if (isScaled)
{
mask = ScaleMask(mask, 0, 0, w, h, ww, hh, m_scaleX, m_scaleY);
}
gdk_gc_set_clip_mask(use_gc, mask);
gdk_gc_set_clip_origin(use_gc, xx, yy);
- if (mask_new)
- g_object_unref(mask_new);
}
// determine whether to use pixmap or pixbuf
if (pixmap_new)
g_object_unref(pixmap_new);
if (mask)
+ {
gdk_gc_set_clip_region(use_gc, clipRegion);
+
+ // Notice that we can only release the mask now, we can't do it before
+ // the calls to gdk_draw_xxx() above as they crash with X error with
+ // GTK+ up to 2.20.1 (i.e. it works with 2.20 but is known to not work
+ // with 2.16.1 and below).
+ if (mask_new)
+ g_object_unref(mask_new);
+ }
}
bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,