Bug 507346 - Remove Device.checkCairo
This code is trying to load old compat so file which is no longer
shipped with SWT since 2013. Effectively this is just a waste of time
without any real effect.
Change-Id: Id99392da7aad0e703cb3f47855b907044367311c
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java
index 81fe58f..73cb013 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java
@@ -80,7 +80,6 @@
*/
public Path (Device device) {
super(device);
- this.device.checkCairo();
long /*int*/ surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, 1, 1);
if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES);
handle = Cairo.cairo_create(surface);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java
index 82ee23b..d509edf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -83,7 +83,6 @@
super(device);
if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- this.device.checkCairo();
image.createSurface();
handle = Cairo.cairo_pattern_create_for_surface(image.surface);
if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);
@@ -179,7 +178,6 @@
if (color1.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (color2 == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (color2.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- this.device.checkCairo();
handle = Cairo.cairo_pattern_create_linear(x1, y1, x2, y2);
if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);
GC.setCairoPatternColor(handle, 0, color1, alpha1);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Transform.java b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Transform.java
index 5c29a8d..fae822f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Transform.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Transform.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -142,7 +142,6 @@
*/
public Transform (Device device, float m11, float m12, float m21, float m22, float dx, float dy) {
super(device);
- this.device.checkCairo();
handle = new double[6];
if (handle == null) SWT.error(SWT.ERROR_NO_HANDLES);
Cairo.cairo_matrix_init(handle, m11, m12, m21, m22, DPIUtil.autoScaleUp(dx), DPIUtil.autoScaleUp(dy));
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
index 2339922..080ae11 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
@@ -106,7 +106,6 @@
long /*int*/ emptyTab;
boolean useXRender;
- static boolean CAIRO_LOADED;
/*
* TEMPORARY CODE. When a graphics object is
@@ -180,37 +179,6 @@
}
}
-void checkCairo() {
- if (CAIRO_LOADED) return;
- try {
- /* Check if cairo is available on the system */
- byte[] buffer ;
- int flags = OS.RTLD_LAZY;
- if (OS.IsAIX) {
- buffer = Converter.wcsToMbcs("libcairo.a(libcairo.so.2)", true);
- flags |= OS.RTLD_MEMBER;
- } else if (OS.IsHPUX) {
- buffer = Converter.wcsToMbcs("libcairo.so", true);
- } else {
- buffer = Converter.wcsToMbcs("libcairo.so.2", true);
- }
- long /*int*/ libcairo = OS.dlopen(buffer, flags);
- if (libcairo != 0) {
- OS.dlclose(libcairo);
- } else {
- try {
- System.loadLibrary("cairo-swt");
- } catch (UnsatisfiedLinkError e) {
- /* Ignore problems loading the fallback library */
- }
- }
- Class.forName("org.eclipse.swt.internal.cairo.Cairo");
- CAIRO_LOADED = true;
- } catch (Throwable t) {
- SWT.error(SWT.ERROR_NO_GRAPHICS_LIBRARY, t, " [Cairo is required]");
- }
-}
-
/**
* Throws an <code>SWTException</code> if the receiver can not
* be accessed by the caller. This may include both checks on
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 49846d0..74fd21a 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
@@ -3067,7 +3067,6 @@
}
void initCairo() {
- data.device.checkCairo();
long /*int*/ cairo = data.cairo;
if (cairo != 0) return;
data.cairo = cairo = OS.gdk_cairo_create(data.drawable);