diff options
author | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2011-08-05 15:25:01 -0400 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2011-08-05 15:25:01 -0400 |
commit | 9c4bff2323bd0415c8033ce7de629d361e3ac9e3 (patch) | |
tree | 58cdb4d5aef2f90efa9d90845912a00a27112413 /bundles | |
parent | ea9da011382c7ec93bcd569f034b6dd753cfdd96 (diff) | |
download | eclipse.platform.swt-9c4bff2323bd0415c8033ce7de629d361e3ac9e3.tar.gz eclipse.platform.swt-9c4bff2323bd0415c8033ce7de629d361e3ac9e3.tar.xz eclipse.platform.swt-9c4bff2323bd0415c8033ce7de629d361e3ac9e3.zip |
349354 - Need to call gdk_cairo_reset_clip when resetting clipping
Diffstat (limited to 'bundles')
5 files changed, 37 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index 91c8c7dc9a..445c429c0e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -4962,6 +4962,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1cairo_1region) } #endif +#ifndef NO__1gdk_1cairo_1reset_1clip +JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1cairo_1reset_1clip) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) +{ + OS_NATIVE_ENTER(env, that, _1gdk_1cairo_1reset_1clip_FUNC); +/* + gdk_cairo_reset_clip(arg0, arg1); +*/ + { + LOAD_FUNCTION(fp, gdk_cairo_reset_clip) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, jintLong))fp)(arg0, arg1); + } + } + OS_NATIVE_EXIT(env, that, _1gdk_1cairo_1reset_1clip_FUNC); +} +#endif + #ifndef NO__1gdk_1cairo_1set_1source_1color JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1cairo_1set_1source_1color) (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index 76e817f5f9..2fc886a3a3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -18,8 +18,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1395; -int OS_nativeFunctionCallCount[1395]; +int OS_nativeFunctionCount = 1396; +int OS_nativeFunctionCallCount[1396]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -427,6 +427,7 @@ char * OS_nativeFunctionNames[] = { "_1gdk_1bitmap_1create_1from_1data", "_1gdk_1cairo_1create", "_1gdk_1cairo_1region", + "_1gdk_1cairo_1reset_1clip", "_1gdk_1cairo_1set_1source_1color", "_1gdk_1color_1white", "_1gdk_1colormap_1alloc_1color", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index a609cc308a..420c64d982 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -435,6 +435,7 @@ typedef enum { _1gdk_1bitmap_1create_1from_1data_FUNC, _1gdk_1cairo_1create_FUNC, _1gdk_1cairo_1region_FUNC, + _1gdk_1cairo_1reset_1clip_FUNC, _1gdk_1cairo_1set_1source_1color_FUNC, _1gdk_1color_1white_FUNC, _1gdk_1colormap_1alloc_1color_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 72443217c3..6d631ef093 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -3607,6 +3607,16 @@ public static final void gdk_cairo_region(int /*long*/ cairo, int /*long*/ regio } } /** @method flags=dynamic */ +public static final native void _gdk_cairo_reset_clip(int /*long*/ cairo, int /*long*/ drawable); +public static final void gdk_cairo_reset_clip(int /*long*/ cairo, int /*long*/ drawable) { + lock.lock(); + try { + _gdk_cairo_reset_clip(cairo, drawable); + } finally { + lock.unlock(); + } +} +/** @method flags=dynamic */ public static final native void _gdk_cairo_set_source_color(int /*long*/ cairo, GdkColor color); public static final void gdk_cairo_set_source_color(int /*long*/ cairo, GdkColor color) { lock.lock(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java index 4cb4b66876..cd51b3b4fd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java @@ -3163,7 +3163,11 @@ static void setCairoPatternColor(int /*long*/ pattern, int offset, Color c, int void setCairoClip(int /*long*/ damageRgn, int /*long*/ clipRgn) { int /*long*/ cairo = data.cairo; - Cairo.cairo_reset_clip(cairo); + if (OS.GTK_VERSION < OS.VERSION(2,18,0)) { + Cairo.cairo_reset_clip(cairo); + } else { + OS.gdk_cairo_reset_clip(cairo, data.drawable); + } if (damageRgn != 0) { double[] matrix = new double[6]; Cairo.cairo_get_matrix(cairo, matrix); |