-
Notifications
You must be signed in to change notification settings - Fork 0
/
openjfx.patch
150 lines (130 loc) · 6.52 KB
/
openjfx.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
diff --git a/modules/controls/src/main/java/javafx/scene/control/Dialog.java b/modules/controls/src/main/java/javafx/scene/control/Dialog.java
--- a/modules/controls/src/main/java/javafx/scene/control/Dialog.java
+++ b/modules/controls/src/main/java/javafx/scene/control/Dialog.java
@@ -244,7 +244,7 @@
*
**************************************************************************/
- final FXDialog dialog;
+ final FXDialog dialog = new HeavyweightDialog(this);
private boolean isClosing;
@@ -260,7 +260,6 @@
* Creates a dialog without a specified owner.
*/
public Dialog() {
- this.dialog = new HeavyweightDialog(this);
setDialogPane(new DialogPane());
initModality(Modality.APPLICATION_MODAL);
}
diff --git a/modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java b/modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java
@@ -228,6 +228,10 @@
fxUserThread = t;
}
+
+ protected static void clearFxUserThread() {
+ fxUserThread = null;
+ }
public void checkFxUserThread() {
// Throw exception if not on FX user thread
diff --git a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PaintCollector.java b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PaintCollector.java
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PaintCollector.java
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PaintCollector.java
@@ -59,14 +59,14 @@
* Assertions have been added to each method to verify whether the calling
* thread is the expected thread.
*/
-final class PaintCollector implements CompletionListener {
+class PaintCollector implements CompletionListener {
/*
Generally we would prefer to remove this static state and pass the
collector where it needs to go rather than having code reach into this
static method to get the instance. IoC (inversion of control) makes
the code more readable and testable, in general.
*/
- private static volatile PaintCollector collector;
+ protected static volatile PaintCollector collector;
static PaintCollector createInstance(QuantumToolkit toolkit) {
return collector = new PaintCollector(toolkit);
@@ -142,7 +142,7 @@
*
* @param qt The QuantumToolkit instance.
*/
- private PaintCollector(QuantumToolkit qt) {
+ protected PaintCollector(QuantumToolkit qt) {
toolkit = qt;
}
@@ -174,7 +174,7 @@
*
* @return Whether there are any dirty scenes that need to be rendered.
*/
- final boolean hasDirty() {
+ boolean hasDirty() {
return hasDirty;
}
@@ -334,7 +334,7 @@
* Called by QuantumToolkit during a pulse to render whatever dirty scenes
* we have. This method is only called on the FX thread.
*/
- final void renderAll() {
+ void renderAll() {
// Ensure we're called only from the FX thread
assert Thread.currentThread() == QuantumToolkit.getFxUserThread();
diff --git a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumRenderer.java b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumRenderer.java
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumRenderer.java
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumRenderer.java
@@ -54,19 +54,19 @@
/*
* Quantum Renderer
*/
-final class QuantumRenderer extends ThreadPoolExecutor {
+class QuantumRenderer extends ThreadPoolExecutor {
private static boolean usePurgatory = // TODO - deprecate
AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("decora.purgatory"));
- private static final AtomicReference<QuantumRenderer> instanceReference =
+ protected static final AtomicReference<QuantumRenderer> instanceReference =
new AtomicReference<>(null);
private Thread _renderer;
private Throwable _initThrowable = null;
private CountDownLatch initLatch = new CountDownLatch(1);
- private QuantumRenderer() {
+ protected QuantumRenderer() {
super(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
setThreadFactory(new QuantumThreadFactory());
}
diff --git a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java
@@ -132,7 +132,7 @@
import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGING_ENABLED;
import com.sun.prism.impl.ManagedResource;
-public final class QuantumToolkit extends Toolkit {
+public class QuantumToolkit extends Toolkit {
public static final boolean verbose =
AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("quantum.verbose"));
diff --git a/modules/graphics/src/main/java/com/sun/prism/es2/ES2Pipeline.java b/modules/graphics/src/main/java/com/sun/prism/es2/ES2Pipeline.java
--- a/modules/graphics/src/main/java/com/sun/prism/es2/ES2Pipeline.java
+++ b/modules/graphics/src/main/java/com/sun/prism/es2/ES2Pipeline.java
@@ -47,6 +47,7 @@
private static boolean isEglfb = false;
static {
+ /* don't load the native lib for OpenGL, we'll handle that with LWJGL
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
String libName = "prism_es2";
@@ -71,6 +72,7 @@
}
return null;
});
+ */
// Initialize the prism-es2 pipe and a handler of it
glFactory = GLFactory.getFactory();
diff --git a/modules/graphics/src/main/java/com/sun/prism/es2/GLFactory.java b/modules/graphics/src/main/java/com/sun/prism/es2/GLFactory.java
--- a/modules/graphics/src/main/java/com/sun/prism/es2/GLFactory.java
+++ b/modules/graphics/src/main/java/com/sun/prism/es2/GLFactory.java
@@ -39,7 +39,7 @@
private static native String nGetGLRenderer(long nativeCtxInfo);
private static native String nGetGLVersion(long nativeCtxInfo);
- private static final GLFactory platformFactory;
+ protected static GLFactory platformFactory;
/* Note: We are only storing the string information of a driver in this
* object. We are assuming a system with a single or homogeneous GPUs.