Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2021-02-20 18:16:13 +0000
committerNikita Nemkin2021-03-22 09:13:38 +0000
commitb50f25cf21afe45c8699f4c4ed1878792d69bb8f (patch)
tree1ddece76b997b07904978fc942355f89504277d6 /bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa
parent512c15cccc3155e79536c4267ce0ef8452c5671d (diff)
downloadeclipse.platform.swt-b50f25cf21afe45c8699f4c4ed1878792d69bb8f.tar.gz
eclipse.platform.swt-b50f25cf21afe45c8699f4c4ed1878792d69bb8f.tar.xz
eclipse.platform.swt-b50f25cf21afe45c8699f4c4ed1878792d69bb8f.zip
Bug 571401 - Make Transform lightweight and platform-independent
Transform class represents a 3x2 affine transformation matrix. It's small enough and simple enough that there's no need to use native implementations. Instead, implement it in pure Java and convert to native matrix form at the point of use (GC.setTransform and GC.getTransform). Since native GTK and Cocoa matrices use double precision, shared Java implementation also uses double internally. This change fixes a bug in GTK and Cocoa implmentation of Transform.shear (swapped X and Y shear direction). Change-Id: I4c09c4e83a7f5d359904067bad144999c8876e8d Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java1
4 files changed, 4 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
index 5579aeeb55..5bafd8bbe0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF8"?>
<signatures swt_gen="mixed">
<class name="NSAffineTransform" swt_gen="mixed">
- <method selector="initWithTransform:" swt_gen="true">
- <arg swt_gen="true"></arg>
+ <method selector="init" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
<method selector="invert" swt_gen="true">
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java
index bfbdcc2be8..cefe713fbd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -35,8 +35,8 @@ public void set() {
OS.objc_msgSend(this.id, OS.sel_set);
}
-public NSAffineTransform initWithTransform(NSAffineTransform transform) {
- long result = OS.objc_msgSend(this.id, OS.sel_initWithTransform_, transform != null ? transform.id : 0);
+public NSAffineTransform init() {
+ long result = OS.objc_msgSend(this.id, OS.sel_init);
return result == this.id ? this : (result != 0 ? new NSAffineTransform(result) : null);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 35163d0c9e..bc31345e7d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -1280,7 +1280,6 @@ public static final long sel_initWithString_ = Selector.sel_initWithString_.valu
public static final long sel_initWithString_attributes_ = Selector.sel_initWithString_attributes_.value;
public static final long sel_initWithTitle_ = Selector.sel_initWithTitle_.value;
public static final long sel_initWithTitle_action_keyEquivalent_ = Selector.sel_initWithTitle_action_keyEquivalent_.value;
-public static final long sel_initWithTransform_ = Selector.sel_initWithTransform_.value;
public static final long sel_initWithType_location_ = Selector.sel_initWithType_location_.value;
public static final long sel_insertColor_key_atIndex_ = Selector.sel_insertColor_key_atIndex_.value;
public static final long sel_insertItem_atIndex_ = Selector.sel_insertItem_atIndex_.value;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
index 6fe20a0fd6..50560e9f63 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
@@ -553,7 +553,6 @@ public enum Selector {
, sel_initWithString_attributes_("initWithString:attributes:")
, sel_initWithTitle_("initWithTitle:")
, sel_initWithTitle_action_keyEquivalent_("initWithTitle:action:keyEquivalent:")
- , sel_initWithTransform_("initWithTransform:")
, sel_initWithType_location_("initWithType:location:")
, sel_insertColor_key_atIndex_("insertColor:key:atIndex:")
, sel_insertItem_atIndex_("insertItem:atIndex:")

Back to the top