summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java4
2 files changed, 10 insertions, 3 deletions
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 884bf533e2..d0da503b28 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
@@ -566,13 +566,18 @@ public class OS extends C {
public static final byte[] GTK_STOCK_CLEAR = ascii("gtk-clear");
public static final int GTK_VERSION = VERSION(gtk_major_version(), gtk_minor_version(), gtk_micro_version());
- public static final boolean USE_CAIRO;
+ public static final boolean USE_CAIRO, INIT_CAIRO;
static {
boolean useCairo = false;
- if (!"false".equals(System.getProperty("org.eclipse.swt.internal.gtk.useCairo"))) {
+ if ("true".equals(System.getProperty("org.eclipse.swt.internal.gtk.cairoGraphics"))) {
useCairo = GTK_VERSION >= VERSION(2, 24, 0);
}
USE_CAIRO = useCairo;
+ boolean initCairo = false;
+ if (!"false".equals(System.getProperty("org.eclipse.swt.internal.gtk.useCairo"))) {
+ initCairo = GTK_VERSION >= VERSION(2, 17, 0);
+ }
+ INIT_CAIRO = initCairo;
}
protected static byte [] ascii (String name) {
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 8c3baded82..79b122a50c 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
@@ -2904,6 +2904,8 @@ void init(Drawable drawable, GCData data, int /*long*/ gdkGC) {
int /*long*/ cairo = data.cairo = handle;
Cairo.cairo_set_fill_rule(cairo, Cairo.CAIRO_FILL_RULE_EVEN_ODD);
data.state &= ~(BACKGROUND | FOREGROUND | FONT | LINE_WIDTH | LINE_CAP | LINE_JOIN | LINE_STYLE | DRAW_OFFSET);
+ } else if (OS.INIT_CAIRO) {
+ initCairo();
}
setClipping(data.clipRgn);
if ((data.style & SWT.MIRRORED) != 0) {
@@ -3042,7 +3044,7 @@ boolean isIdentity(double[] matrix) {
*/
public void setAdvanced(boolean advanced) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if ((data.style & SWT.MIRRORED) != 0 || OS.USE_CAIRO) {
+ if ((data.style & SWT.MIRRORED) != 0 || OS.USE_CAIRO || OS.INIT_CAIRO) {
if (!advanced) {
setAlpha(0xFF);
setAntialias(SWT.DEFAULT);