summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe@ca.ibm.com>2011-08-05 15:55:19 -0400
committerBogdan Gheorghe <gheorghe@ca.ibm.com>2011-08-05 15:57:26 -0400
commit308ff19c3a24980a5dfb35610b82d48e8d05c85d (patch)
tree0397ac8f9f1049f5ffc4fc0fab5013e178d42b8e
parent55e21b5834d0a77df713dc23e0e05f3a67eaa1a8 (diff)
downloadeclipse.platform.swt-308ff19c3a24980a5dfb35610b82d48e8d05c85d.tar.gz
eclipse.platform.swt-308ff19c3a24980a5dfb35610b82d48e8d05c85d.tar.xz
eclipse.platform.swt-308ff19c3a24980a5dfb35610b82d48e8d05c85d.zip
349354 - Need to call gdk_cairo_reset_clip when resetting clipping
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java6
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 b852989f0b..ea5071522d 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
@@ -4938,6 +4938,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 a83516935d..f83f5e5e9f 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 = 1393;
-int OS_nativeFunctionCallCount[1393];
+int OS_nativeFunctionCount = 1394;
+int OS_nativeFunctionCallCount[1394];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -425,6 +425,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 4f42ff416b..23c141a095 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
@@ -433,6 +433,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 9c3db9fa94..ea0429a663 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
@@ -3589,6 +3589,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);