Compare commits

..

304 Commits

Author SHA1 Message Date
Maxim Kartashev
f4850d9e95 JBR-4848 Cannot invoke "javax.swing.JTextField.getCaret()" because the return value of "java.lang.ref.WeakReference.get()" is null 2022-09-26 12:17:06 +03:00
Maxim Kartashev
1ec391b98e JBR-4626 MacOS aarch64: SIGSEGV at RenderCache.get / ScaledBlit.getFromCache
Avoid C2-compiled loop crashes by replacing the handcrafted MRU cache
with a more modern LinkedHashMap-based one.
2022-09-22 13:51:28 +07:00
Maxim Kartashev
e73fb34bcb JBR-4544 Enable OpenGL pipeline by default for Wayland sessions
The OpenGL pipeline is enabled only if all of the following is true:
- WAYLAND is detected,
- VMWare virtualization is detected,
- rendering pipeline is not a software one (llvmpipe).
As a side effect, a system property 'jbr.virtualization.information'
is set to the value of detected virtualization type. The value is the
same as provided by JFR.
2022-09-22 13:51:14 +07:00
Alexey Ushakov
be213a702a JBR-4680 idea window flickers while changing the screen brightness
Update insets in separate notification
2022-09-22 13:50:43 +07:00
Alexey Ushakov
634024c88a JBR-4790 [bkp] 8291266: RenderPerfTest: missing content while rendering some primitives
Reviewed-by: aghaisas, prr
(cherry picked from commit 871b7dab14)
2022-09-22 13:50:19 +07:00
Ajit Ghaisas
1083908208 JBR-4789 [bkp] 8288948: Few J2DBench tests indicate lower primitive drawing performance with metal rendering pipeline
Reviewed-by: avu, prr

(cherry picked from commit bc7a1ea249)
2022-09-22 13:50:00 +07:00
Alexey Ushakov
b6d53a51bb JBR-4784 Extra allocations of MTLRenderPipelineDescriptor affects performance in metal pipeline
Remove extra allocations
2022-09-22 13:49:43 +07:00
Alexey Ushakov
0834905769 JBR-4696 macOS: NPE in -[AWTView viewDidChangeBackingProperties]
Added null pointer checks
2022-09-22 13:49:23 +07:00
Alexey Ushakov
47f3b96189 8262751: RenderPipelineState assertion error in J2DDemo
Reviewed-by: jdv
(cherry picked from commit 49b2789a49)
2022-09-22 13:48:15 +07:00
Alexey Ushakov
1f6f56236a JBR-4774 macOS: SIGILL at [libsystem_kernel] __kill in NPE / VolatileSurfaceManager.displayChanged / __displaycb_handle_block_invoke
Guarded against multiple displayChanged() notifications to avoid NPE
2022-09-13 16:10:40 +07:00
Alexey Ushakov
a5ef76dd2b JBR-4363 Changes in fonts rendering between JBR11 and JBR17
Do not use hinting for generating outlines
2022-09-13 16:10:16 +07:00
Alexey Ushakov
1cdc498224 JBR-3100 Exception in NSApplicationAWT: java.lang.NullPointerException at java.desktop/sun.lwawt.LWComponentPeer.windowToLocal
Added null check
2022-09-13 16:09:31 +07:00
Alexey Ushakov
197d5535dd JBR-3102 Exception in NSApplicationAWT: Invalid parameter not satisfying: !isnan(newOrigin.y)
Handled NAN values with some defaults
2022-09-13 16:08:48 +07:00
Alexey Ushakov
87aa05a5f1 JBR-4718 SIGSEGV: [libobjc.A.dylib+0x641d] objc_msgSend / Java_sun_java2d_metal_MTLRenderQueue_flushBuffer
Align lifetime of MTLLayer and AWTView objc objects with MTLSDOps data attached to MTLSurfaceData
Added some more checks to commitCommandBuffer (in MTLContext)
2022-09-13 16:07:40 +07:00
Vitaly Provodin
c64af6d279 JBR-4810 add VERSION_PATCH into version number string 2022-09-13 07:20:04 +07:00
Dmitry Batrak
650ebe9783 Revert "JBR-4782 Synergy keyboard/mouse input: window disabled after bringing IntelliJ into focus"
This reverts commit 5e07ac8c37.
2022-09-09 15:44:46 +03:00
Dmitry Batrak
5e07ac8c37 JBR-4782 Synergy keyboard/mouse input: window disabled after bringing IntelliJ into focus
(cherry picked from commit f863a14b19)
2022-09-08 14:36:16 +03:00
Severin Gehwolf
24d1955187 8292260: [BACKOUT] JDK-8279219: [REDO] C2 crash when allocating array of size too large
Reviewed-by: clanger
Backport-of: 967a28c3d8
(cherry picked from commit 02fa4be6c4)
2022-09-08 18:29:20 +07:00
Severin Gehwolf
0328a23a47 8292258: Bump update version for OpenJDK: jdk-17.0.4.1
Reviewed-by: stuefe
(cherry picked from commit 27057f84af)
2022-09-08 18:29:17 +07:00
Denis Fokin
deebf4b9ba JBR-4792 [backport to 222] "Activate window by mouse hover" Windows option isn't supported by JBR 17
backport JBR-1991 (Focus problems in Windows with X-Mouse style focus) from JBR 11

(cherry picked from commit c8ad353f45)
(cherry picked from commit a52ed88377)
2022-09-06 10:20:40 +03:00
Vitaly Provodin
9603108db9 exclude java/awt/Graphics2D/ScaledTransform/ScaledTransform.java on linux due to 8277240 2022-08-30 05:21:10 +07:00
Nikita Provotorov
c39f2c2663 JBR-4765 Cannot invoke context menu by two fingers tapping on MacBook with M2 chip
Ensure the pressed mouse buttons are also reflected by the appropriate modifiers.
2022-08-29 17:30:03 +03:00
Maxim Kartashev
7aa25a24b6 JBR-4504 8283849: AsyncGetCallTrace may crash JVM on guarantee
Reviewed-by: mdoerr
Backport-of: 93c88690a1
(cherry picked from commit 9fd49f2c75)
2022-08-29 14:31:21 +03:00
Maxim Kartashev
d1babaa2bb JBR-4562 Generate hs_err file on SIGABRT
Changed the option from a -XX one to -Djbr.catch.SIGABRT=true to make it
more compatible with other JDKs.

(cherry picked from commit 4e8864552d)
2022-08-18 10:07:36 +03:00
Maxim Kartashev
874d55a8fe JBR-4562 Generate hs_err file on SIGABRT
The generation can be switched off with the env var JVM_NO_SIGABRT.

(cherry picked from commit 62f8abdea8)
2022-08-18 10:07:06 +03:00
Maxim Kartashev
87c70dd55a JBR-3101 Exception in NSApplicationAWT: java.lang.NullPointerException at java.desktop/sun.lwawt.macosx.CPlatformComponent.setBounds
After CPlatformComponent.setBounds() was changed to allow for platformWindow.getPeer() == null, a few exceptions appeared that suggest platformWindow can also be null. This commit safeguards against this situation as well.

It seems that this can only be the case if the instance is created from outside of JDK, so Objects.requireNonNull() may help to catch the perpetrator.

(cherry picked from commit b3e080a26b)
2022-08-18 10:04:36 +03:00
Nikita Gubarkov
ed0f24b77b JBR-4466 fix mouse event coordinates for non-client events with custom window decorations 2022-08-17 14:22:02 +03:00
Alexey Ushakov
8c02c35b02 JBR-4573 Start/stop displaysync affects performance in metal rendering pipeline
Reverted extra change
2022-08-12 18:48:43 +07:00
Alexey Ushakov
cbafe41848 JBR-4573 Start/stop displaysync affects performance in metal rendering pipeline
Reuse displaysync thread for subsequent updates
2022-08-12 18:48:39 +07:00
Alexey Ushakov
9f56ca7702 JBR-4636 Some JWindow tests failed due to wrong scaling
Take into account custom scale via sun.java2d.uiScale
2022-08-12 15:44:35 +07:00
Alexey Ushakov
ded1ee114b JBR-4619 Window content scale wrong after disconnecting external display / waking OS from sleep
Use viewDidChangeBackingProperties notification to adjust a window layer scale
2022-08-12 15:44:26 +07:00
Sergey Bylokhov serb
e72a7455d3 8284370: Improve zlib usage
Reviewed-by: andrew
Backport-of: 46f42c72a92ffb035e84eb8e73bd6329ef006251
2022-08-12 05:06:23 +07:00
Andrew John Hughes
208cdad077 8272243: Improve DER parsing
Backport-of: ec91d4bce10cd965e8a0099f35aed8c9150f6a44
2022-08-12 05:06:23 +07:00
Martin Balao
c5796bd7f3 8281866: Enhance MethodHandle invocations
Reviewed-by: mbaesken
Backport-of: d974d9da365f787f67971d88c79371c8b0769f75
2022-08-12 05:06:23 +07:00
Aleksei Voitylov
b2882e01f5 8285407: Improve Xalan supports
Reviewed-by: mbalao
Backport-of: fd6385d8c20379c1139f64f5c90d331ad9631097
2022-08-12 05:06:22 +07:00
Aleksei Voitylov
7f3bf50921 8283190: Improve MIDI processing
Reviewed-by: mbalao, mbaesken
Backport-of: e0329eb343661edd5066deb6ae5d99a742135831
2022-08-12 05:06:22 +07:00
Martin Balao
d2b1927313 8281859: Improve class compilation
Reviewed-by: mbaesken
Backport-of: 3ac62a66efd05d0842076dd4cfbea0e53b12630f
2022-08-12 05:06:22 +07:00
Yuri Nesterenko
cbcd531db7 8272249: Better properties of loaded Properties
Reviewed-by: mbalao, mbaesken
Backport-of: f9f7e5eaf51cd4793805e50f8ba3549689d939e9
2022-08-12 05:06:21 +07:00
Aleksei Voitylov
527c0bed4e 8277608: Address IP Addressing
Reviewed-by: mbalao
Backport-of: f2136e833d5bbeb9eb4e61e73774c36ff7d27cfb
2022-08-12 05:06:21 +07:00
Christoph Langer
2686fa90d6 8286855: javac error on invalid jar should only print filename
Backport-of: 1606d5545b
2022-08-12 05:06:21 +07:00
Christoph Langer
f99107d49f 8287162: (zipfs) Performance regression related to support for POSIX file permissions
Backport-of: a10c5597d9
2022-08-12 05:06:21 +07:00
Christoph Langer
3fd2eda178 8286594: (zipfs) Mention paths with dot elements in ZipException and cleanups
Backport-of: 80cf9f3464
2022-08-12 05:06:20 +07:00
Christoph Langer
7d83890c26 8286444: javac errors after JDK-8251329 are not helpful enough to find root cause
Backport-of: 29c4b8e80d
2022-08-12 05:06:20 +07:00
Christoph Langer
b431745af8 8287378: GHA: Update cygwin to fix issues in langtools tests on Windows
Backport-of: f086d945c3
2022-08-12 05:06:20 +07:00
Andrew John Hughes
d0eaa9a4a8 8284094: Memory leak in invoker_completeInvokeRequest()
Backport-of: 1dfa1eaea0
2022-08-12 05:06:19 +07:00
Ichiroh Takiguchi
c6dd06f6bd 8287362: FieldAccessWatch testcase failed on AIX platform
Backport-of: 66340372d5
2022-08-12 05:06:19 +07:00
Ichiroh Takiguchi
d6bc3568e0 8282422: JTable.print() failed with UnsupportedCharsetException on AIX ko_KR locale
Backport-of: 6ea996c205
2022-08-12 05:06:19 +07:00
Christoph Langer
95ad47f4aa 8287336: GHA: Workflows break on patch versions
Reviewed-by: andrew
Backport-of: e44465d4d6
2022-08-12 05:06:18 +07:00
Alexander Scherbatiy
24ecdb69dc 8285397: JNI exception pending in CUPSfuncs.c:250
Backport-of: a03438cb1b
2022-08-12 05:06:18 +07:00
Adam Farley
2ef7a63f4e 8286601: Mac Aarch: Excessive warnings to be ignored for build jdk
Reviewed-by: andrew
Backport-of: 40f43c6b1f
2022-08-12 05:06:18 +07:00
Alexander Scherbatiy
2da35198c8 8181571: printing to CUPS fails on mac sandbox app
Backport-of: 3d4be14eba
2022-08-12 05:06:17 +07:00
Matthias Baesken
cc55bfd8a2 8287119: Add Distrust.java to ProblemList
Backport-of: da8fd4547f
2022-08-12 05:06:17 +07:00
Ichiroh Takiguchi
4ffb4bd53b 8139173: [macosx] JInternalFrame shadow is not properly drawn
Backport-of: f7814c120b
2022-08-12 05:06:16 +07:00
Sergey Bylokhov
2fc8a843c3 8285523: Improve test java/io/FileOutputStream/OpenNUL.java
Backport-of: f42631e354
2022-08-12 05:06:16 +07:00
Goetz Lindenmaier
76e05d2659 8209776: Refactor jdk/security/JavaDotSecurity/ifdefs.sh to plain java test
Backport-of: 9711033780
2022-08-12 05:06:16 +07:00
Ichiroh Takiguchi
9f9682fad1 8240756: [macos] SwingSet2:TableDemo:Printed Japanese characters were garbled
Backport-of: 27fe3d7f8d
2022-08-12 05:06:15 +07:00
Zhengyu Gu
0e4074b530 8283469: Don't use memset to initialize members in FileMapInfo and fix memory leak
Reviewed-by: mdoerr
Backport-of: d6fa8b004b
2022-08-12 05:06:15 +07:00
Goetz Lindenmaier
cacccf9aaf 8286293: Tests ShortResponseBody and ShortResponseBodyWithRetry should use less resources
Backport-of: f143386109
2022-08-12 05:06:14 +07:00
Goetz Lindenmaier
55c2b1fc4e 8236136: tests which use CompilationMode shouldn't be run w/ TieredStopAtLevel
Backport-of: a86cab8d42
2022-08-12 05:06:14 +07:00
Goetz Lindenmaier
a6ade2cb39 8285686: Update FreeType to 2.12.0
Backport-of: 67dd8a8d6a
2022-08-12 05:06:13 +07:00
Matthias Baesken
7bc0973dc1 8285728: Alpine Linux build fails with busybox tar
Backport-of: 36bf6fbe08
2022-08-12 05:06:13 +07:00
Matthias Baesken
8ea6ee234f 8284758: [linux] improve print_container_info
Backport-of: 6c6d5223df
2022-08-12 05:06:12 +07:00
Matthias Baesken
5d94d04dbc 8284754: print more interesting env variables in hs_err and VM.info
Backport-of: 8ee2944cc4
2022-08-12 05:06:12 +07:00
Martin Doerr
a66d622a63 8283323: libharfbuzz optimization level results in extreme build times
Backport-of: 2c43ecb43f
2022-08-12 05:06:12 +07:00
Thomas Stuefe
b341d8a51d 8286198: [linux] Fix process-memory information
Backport-of: 9e320d9ab1
2022-08-12 05:06:12 +07:00
Tyler Steele
e2320ede13 8285956: (fs) Excessive default poll interval in PollingWatchService
Backport-of: 1bb4de2e28
2022-08-12 05:06:11 +07:00
Richard Reingruber
60431cb033 8280593: [PPC64, S390] redundant allocation of MacroAssembler in StubGenerator ctor
Backport-of: c936e7059b
2022-08-12 05:06:11 +07:00
Richard Reingruber
9cd8227a97 8274687: JDWP deadlocks if some Java thread reaches wait in blockOnDebuggerSuspend
Backport-of: ca2efb73f5
2022-08-12 05:06:11 +07:00
Basil Crow
3b835e5645 8268773: Improvements related to: Failed to start thread - pthread_create failed (EAGAIN)
Backport-of: e35005d5ce
2022-08-12 05:06:10 +07:00
Aleksey Shipilev
a13c21c73a 8284848: C2: Compiler blackhole arguments should be treated as globally escaping
Reviewed-by: kvn
Backport-of: 5629c7555f
2022-08-12 05:06:10 +07:00
Matthias Baesken
2cb492b05d 8285921: serviceability/dcmd/jvmti/AttachFailed/AttachReturnError.java fails on Alpine
Backport-of: 0f62cb6fcc
2022-08-12 05:06:09 +07:00
Goetz Lindenmaier
3747f82fda 8206187: javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java fails with Port already in use
Backport-of: cd36be42c2
2022-08-12 05:06:09 +07:00
Jie Fu
d70faac6c5 8286013: Incorrect test configurations for compiler/stable/TestStableShort.java
Backport-of: 3420a1aa70
2022-08-12 05:06:09 +07:00
Jie Fu
1ca780867b 8284992: Fix misleading Vector API doc for LSHR operator
Backport-of: e54f26aa3d
2022-08-12 05:06:08 +07:00
Jie Fu
15a2c269f6 8285828: runtime/execstack/TestCheckJDK.java fails with zipped debug symbols
Backport-of: c4f7a850c6
2022-08-12 05:06:08 +07:00
Christoph Langer
aaca19bb8e 8285727: [11u, 17u] Unify fix for JDK-8284920 with version from head
Reviewed-by: mdoerr, akozlov
2022-08-12 05:06:08 +07:00
Christoph Langer
6c58ebdf87 8285726: [11u, 17u] Unify fix for JDK-8284548 with version from head
Reviewed-by: mdoerr
2022-08-12 05:06:07 +07:00
Martin Doerr
f7b9ecd643 8282929: Localized monetary symbols are not reflected in toLocalizedPattern return value
Backport-of: c96085eaab
2022-08-12 05:06:07 +07:00
Tyler Steele
aad01122cf 8286029: Add classpath exemption to globals_vectorApiSupport_***.S.inc
Backport-of: 6a1b145a0a
2022-08-12 05:06:06 +07:00
Zhengyu Gu
534e7641ac 8284023: java.sun.awt.X11GraphicsDevice.getDoubleBufferVisuals() leaks XdbeScreenVisualInfo
Backport-of: ec205f68a8
2022-08-12 05:04:53 +07:00
Zhengyu Gu
1cf7d8a023 8284532: Memory leak in BitSet::BitMapFragmentTable in JFR leak profiler
Backport-of: b55c32f5fe
2022-08-12 05:04:23 +07:00
Aleksey Shipilev
d59ec46092 8282170: JVMTI SetBreakpoint metaspace allocation test
Backport-of: 7b91bbba82
2022-08-12 05:04:22 +07:00
Aleksey Shipilev
1a492433b9 8285394: Compiler blackholes can be eliminated due to stale ciMethod::intrinsic_id()
Reviewed-by: kvn
Backport-of: ce8db2c403
2022-08-12 05:04:22 +07:00
Zhengyu Gu
841ee759df 8284549: JFR: FieldTable leaks FieldInfoTable member
Backport-of: 92f5e42696
2022-08-12 05:04:21 +07:00
Zhengyu Gu
646fd15a43 8284620: CodeBuffer may leak _overflow_arena
Reviewed-by: mdoerr, kvn
Backport-of: 4d45c3ebc4
2022-08-12 05:04:21 +07:00
Sergey Bylokhov
11e83ea8ce 8274735: javax.imageio.IIOException: Unsupported Image Type while processing a valid JPEG image
Backport-of: f8a164915f
2022-08-12 05:04:20 +07:00
Goetz Lindenmaier
ed10962c11 8279529: ProblemList java/nio/channels/DatagramChannel/ManySourcesAndTargets.java on macosx-aarch64
8279532: ProblemList sun/security/ssl/SSLSessionImpl/NoInvalidateSocketException.java

Backport-of: 564c8c6390
2022-08-12 05:04:20 +07:00
Martin Doerr
1df7a0abc3 8282293: Domain value for system property jdk.https.negotiate.cbt should be case-insensitive
Backport-of: 86015e15a5
2022-08-12 05:04:20 +07:00
Martin Doerr
9f6d4b02f0 8279842: HTTPS Channel Binding support for Java GSS/Kerberos
Reviewed-by: goetz
Backport-of: de3113b998
2022-08-12 05:04:19 +07:00
Jaroslav Bachorik
7d3f3aa12f 8280684: JfrRecorderService failes with guarantee(num_written > 0) when no space left on device.
Backport-of: 9471f24ca1
2022-08-12 05:04:18 +07:00
Matthias Baesken
de2549bffc 8285445: cannot open file "NUL:"
Backport-of: 03cbb48e6a
2022-08-12 05:04:18 +07:00
Zhengyu Gu
66ec18a5f0 8284458: CodeHeapState::aggregate() leaks blob_name
Reviewed-by: mdoerr
Backport-of: d4a4884385
2022-08-12 05:04:18 +07:00
Martin Doerr
82478b3251 8284866: Add test to JDK-8273056
Backport-of: 3ffec3a50b
2022-08-12 05:04:17 +07:00
Martin Doerr
5233011504 8278519: serviceability/jvmti/FieldAccessWatch/FieldAccessWatch.java failed "assert(handle != __null) failed: JNI handle should not be null"
Backport-of: 63e43030ed
2022-08-12 05:04:17 +07:00
Martin Doerr
3fb690c31f 8277396: [TESTBUG] In DefaultButtonModelCrashTest.java, frame is accessed from main thread
Backport-of: b310f301ef
2022-08-12 05:04:16 +07:00
Martin Doerr
89e00ff868 8273095: vmTestbase/vm/mlvm/anonloader/stress/oome/heap/Test.java fails with "wrong OOME"
Backport-of: f62b81c3b5
2022-08-12 05:04:16 +07:00
Martin Doerr
edf8a7a800 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1
Backport-of: c459f8f406
2022-08-12 05:04:16 +07:00
Jie Fu
55e0fe0dbc 8285342: Zero build failure with clang due to values not handled in switch
Backport-of: d84b9c5489
2022-08-12 05:04:15 +07:00
Christoph Langer
f1f9b15234 8284622: Update versions of some Github Actions used in JDK workflow
Backport-of: 5851631de2
2022-08-12 05:04:15 +07:00
Sergey Bylokhov
dd10c6646e 8283422: Create a new test for JDK-8254790
Backport-of: ad83ec7e28
2022-08-12 05:04:14 +07:00
Martin Doerr
3ec8a7a9a9 8279597: [TESTBUG] ReturnBlobToWrongHeapTest.java fails with -XX:TieredStopAtLevel=1 on machines with many cores
Backport-of: 45f20633f6
2022-08-12 05:04:14 +07:00
Martin Doerr
19700aeac3 8284884: Replace polling with waiting in javax/swing/text/html/parser/Parser/8078268/bug8078268.java
Backport-of: 53580b336a
2022-08-12 05:04:14 +07:00
Thomas Stuefe
322d1544de 8283725: Launching java with "-Xlog:gc*=trace,safepoint*=trace,class*=trace" crashes the JVM
Backport-of: 1ca0ede60d
2022-08-12 05:04:13 +07:00
Martin Doerr
9d6e9e568f 8279520: SPNEGO has not passed channel binding info into the underlying mechanism
Backport-of: 8d0f385fd0
2022-08-12 05:04:13 +07:00
Christoph Langer
8f82619b9f 8284507: GHA: Only check test results if testing was not skipped
Backport-of: 8eac3427b1
2022-08-12 05:04:13 +07:00
Christoph Langer
29167f0922 8284603: [17u] Update Boot JDK used in GHA to 17.0.2
Reviewed-by: sgehwolf
2022-08-12 05:04:12 +07:00
Christoph Langer
46244e7636 8284389: Improve stability of GHA Pre-submit testing by caching cygwin installer
Backport-of: 61fcf2f67f
2022-08-12 05:04:12 +07:00
Goetz Lindenmaier
e3fa2d51cd 8276863: Remove test/jdk/sun/security/ec/ECDSAJavaVerify.java
Backport-of: c27afb313b
2022-08-12 05:04:12 +07:00
Zhengyu Gu
0ec7e6675e 8283217: Leak FcObjectSet in getFontConfigLocations() in fontpath.c
Backport-of: 909986c7e1
2022-08-12 05:04:11 +07:00
Martin Doerr
63c3b2ed4f 8279822: CI: Constant pool entries in error state are not supported
Reviewed-by: goetz
Backport-of: c5c8c0644d
2022-08-12 05:04:11 +07:00
Martin Doerr
2f18ef43d3 8276880: Remove java/lang/RuntimeTests/exec/ExecWithDir as unnecessary
Reviewed-by: goetz
Backport-of: d7012fbd60
2022-08-12 05:04:10 +07:00
Martin Doerr
2e72aa4b27 8284369: TestFailedAllocationBadGraph fails with -XX:TieredStopAtLevel < 4
Backport-of: 955d61df30
2022-08-12 05:04:10 +07:00
Severin Gehwolf
077e1ead3d 8283279: [Testbug] Improve TestGetSwapSpaceSize
Backport-of: a77160065b
2022-08-12 05:04:10 +07:00
Matthias Baesken
f9f11992e0 8283347: [macos] Bad JNI lookup accessibilityHitTest is shown when Screen magnifier is enabled
Reviewed-by: mdoerr
2022-08-12 05:04:09 +07:00
Martin Doerr
0f048a6684 8283187: C2: loop candidate for superword not always unrolled fully if superword fails
Backport-of: 14c20bc0e0
2022-08-12 05:04:09 +07:00
Martin Doerr
ae05c0dc0d 8281822: Test failures on non-DTrace builds due to incomplete DTrace* flags handling
Backport-of: a81c911176
2022-08-12 05:04:08 +07:00
Thomas Stuefe
6173ee93f1 8280940: gtest os.release_multi_mappings_vm is racy
Reviewed-by: mdoerr
Backport-of: f07b816523
2022-08-12 05:04:08 +07:00
Thomas Stuefe
34eeb2ce04 8281522: Rename ADLC classes which have the same name as hotspot variants
Reviewed-by: mdoerr
Backport-of: eee6a5622d
2022-08-12 05:04:07 +07:00
Thomas Stuefe
3ca52fa81a 8282382: Report glibc malloc tunables in error reports
Backport-of: bc42e7cbbf
2022-08-12 05:04:07 +07:00
Zhengyu Gu
8c940e4146 8282887: Potential memory leak in sun.util.locale.provider.HostLocaleProviderAdapterImpl.getNumberPattern() on Windows
Backport-of: 2cddf3f539
2022-08-12 05:04:06 +07:00
Zhengyu Gu
fa027785b0 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()
Backport-of: 5df2a05770
2022-08-12 05:04:06 +07:00
Thomas Stuefe
5ab077365d 8283497: [windows] print TMP and TEMP in hs_err and VM.info
Backport-of: b035fda459
2022-08-12 05:04:06 +07:00
Thomas Stuefe
75bd0c709a 8283249: CompressedClassPointers.java fails on ppc with 'Narrow klass shift: 0' missing
Backport-of: 58487ddc17
2022-08-12 05:04:05 +07:00
Thomas Stuefe
2be36fd147 8281450: Remove unnecessary operator new and delete from ObjectMonitor
Backport-of: 83d67452da
2022-08-12 05:04:05 +07:00
Thomas Stuefe
b391f081b5 8280941: os::print_memory_mappings() prints segment preceeding the inclusion range
Backport-of: d1cc5fda8f
2022-08-12 05:04:04 +07:00
Thomas Stuefe
138bd0ca88 8280004: DCmdArgument<jlong>::parse_value() should handle NULL input
Backport-of: 55f180fb7d
2022-08-12 05:04:04 +07:00
Martin Doerr
80ea32f1d2 8273142: Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/sun/net/www/protocol/http/ tests
Backport-of: 2f955d6f5b
2022-08-12 05:04:03 +07:00
Martin Doerr
a6aabec7ae 8256368: Avoid repeated upcalls into Java to re-resolve MH/VH linkers/invokers
Backport-of: 534e557874
2022-08-12 05:04:03 +07:00
Martin Doerr
391603512d 8282590: C2: assert(addp->is_AddP() && addp->outcnt() > 0) failed: Don't process dead nodes
Backport-of: d29c7e740d
2022-08-12 05:04:03 +07:00
Martin Doerr
4d7398e903 8283641: Large value for CompileThresholdScaling causes assert
Backport-of: c1048021fe
2022-08-12 05:04:02 +07:00
Martin Doerr
676a2d68e0 8283451: C2: assert(_base == Long) failed: Not a Long
Backport-of: fabde3b7b8
2022-08-12 05:04:02 +07:00
Martin Doerr
f9be3102c9 8283834: Unmappable character for US-ASCII encoding in TestPredicateInputBelowLoopPredicate
Backport-of: 2367228835
2022-08-12 05:04:01 +07:00
Martin Doerr
39a6339bf0 8282592: C2: assert(false) failed: graph should be schedulable
Backport-of: 85628a871d
2022-08-12 05:04:01 +07:00
Martin Doerr
8fb526b66c 8282312: Minor corrections to evbroadcasti32x4 intrinsic on x86
Backport-of: 8b45dbdae6
2022-08-12 05:04:01 +07:00
Sergey Bylokhov
16eaf17e35 8279586: [macos] custom JCheckBox and JRadioBox with custom icon set: focus is still displayed after unchecking
Backport-of: 18a7dc8c08
2022-08-12 05:04:00 +07:00
Martin Doerr
13f8f8b5a8 8271008: appcds/*/MethodHandlesAsCollectorTest.java tests time out because of excessive GC (CodeCache GC Threshold) in loom
Backport-of: 022d80707c
2022-08-12 05:04:00 +07:00
Martin Doerr
340116e9a9 8282874: Bad performance on gather/scatter API caused by different IntSpecies of indexMap
Backport-of: 5c408c1410
2022-08-12 05:03:59 +07:00
Martin Doerr
eb557d0dfd 8280901: MethodHandle::linkToNative stub is missing w/ -Xint
Backport-of: f86f38a8af
2022-08-12 05:03:59 +07:00
Martin Doerr
e68e0d75ae 8282045: When loop strip mining fails, safepoints are removed from loop anyway
Backport-of: 2c5d266f9f
2022-08-12 05:03:58 +07:00
Martin Doerr
6fdb24eaa6 8282231: x86-32: runtime call to SharedRuntime::ldiv corrupts registers
Backport-of: ecd85e6f0f
2022-08-12 05:03:58 +07:00
Martin Doerr
87702f4859 8272908: Missing coverage for certain classes in com.sun.org.apache.xml.internal.security
Backport-of: a16f2d0a3c
2022-08-12 05:03:58 +07:00
Martin Doerr
9a4878d6df 8272964: java/nio/file/Files/InterruptCopy.java fails with java.lang.RuntimeException: Copy was not interrupted
Backport-of: dfeb4132e4
2022-08-12 05:03:57 +07:00
Martin Doerr
4f0f874852 8272493: Suboptimal code generation around Preconditions.checkIndex intrinsic with AVX2
Backport-of: 88f0938c94
2022-08-12 05:03:57 +07:00
Martin Doerr
9592d7f707 8283408: Fix a C2 crash when filling arrays with unsafe
Backport-of: a6740c010b
2022-08-12 05:03:57 +07:00
Martin Doerr
a84d41c80f 8282172: CompileBroker::log_metaspace_failure is called from non-Java/compiler threads
Backport-of: 4e7fb41daf
2022-08-12 05:03:56 +07:00
Martin Doerr
c3052f0f70 8280867: Cpuid1Ecx feature parsing is incorrect for AMD CPUs
Backport-of: a18beb4797
2022-08-12 05:03:56 +07:00
Martin Doerr
23ecac95b1 8280600: C2: assert(!had_error) failed: bad dominance
Backport-of: de826ba18a
2022-08-12 05:03:55 +07:00
Martin Doerr
9c87eeeadf 8271055: Crash during deoptimization with "assert(bb->is_reachable()) failed: getting result from unreachable basicblock" with -XX:+VerifyStack
Backport-of: e44dc638b8
2022-08-12 05:03:55 +07:00
Martin Doerr
d931711d7c 8280964: [Linux aarch64] : drawImage dithers TYPE_BYTE_INDEXED images incorrectly
Backport-of: 6f882deddc
2022-08-12 05:03:54 +07:00
Martin Doerr
8881306dcd 8272358: Some tests may fail when executed with other locales than the US
Backport-of: 29e552c03a
2022-08-12 05:03:54 +07:00
Martin Doerr
04d270e97b 8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics
Backport-of: b1f935c1d0
2022-08-12 05:03:53 +07:00
Martin Doerr
0521ea9a42 8264605: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java failed with "agent_tools.cpp, 471: (foundThread = (jthread) jni_env->NewGlobalRef(foundThread)) != NULL"
Backport-of: 96fe1d0d4d
2022-08-12 05:03:53 +07:00
Martin Doerr
edc1f6acf8 8279219: [REDO] C2 crash when allocating array of size too large
Backport-of: d32f99ee65
2022-08-12 05:03:52 +07:00
Martin Doerr
11510177c5 8281544: assert(VM_Version::supports_avx512bw()) failed for Tests jdk/incubator/vector/
Backport-of: 4e0b81c596
2022-08-12 05:03:52 +07:00
Martin Doerr
e05942028c 8283350: (tz) Update Timezone Data to 2022a
Backport-of: 1ab6f9395f
2022-08-12 05:03:51 +07:00
Martin Doerr
0f2c29dc44 8275337: C1: assert(false) failed: live_in set of first block must be empty
Backport-of: 4191b2b9b9
2022-08-12 05:03:51 +07:00
Martin Doerr
ceee1fd4df 8273169: java/util/regex/NegativeArraySize.java failed after JDK-8271302
Backport-of: 683e30db79
2022-08-12 05:03:51 +07:00
Martin Doerr
db4e8a3add 8271302: Regex Test Refresh
Backport-of: fecefb8541
2022-08-12 05:03:50 +07:00
Severin Gehwolf
3995567d62 8282551: Properly initialize L32X64MixRandom state
Backport-of: ce18ff8527
2022-08-12 05:03:50 +07:00
Martin Doerr
0db94e3118 8278794: Infinite loop in DeflaterOutputStream.finish()
Backport-of: ff0b0927a2
2022-08-12 05:03:49 +07:00
Martin Doerr
2884ed4e55 8281771: Crash in java_lang_invoke_MethodType::print_signature
Backport-of: a24498b777
2022-08-12 05:03:49 +07:00
Martin Doerr
068be19a2f 8270797: ShortECDSA.java test is not complete
Backport-of: 221e4b9c61
2022-08-12 05:03:48 +07:00
Matthias Baesken
85f4e537d1 8278549: UNIX sun/font coding misses SUSE distro detection on recent distro SUSE 15
Reviewed-by: mdoerr
Backport-of: 84976b4531
2022-08-12 05:03:48 +07:00
Roman Kennke
45210435cf 8278065: Refactor subclassAudits to use ClassValue
Backport-of: 8fed8ab29c
2022-08-12 05:03:48 +07:00
Roman Kennke
c480a2dbf1 8280041: Retry loop issues in java.io.ClassCache
Backport-of: cebaad1c94
2022-08-12 05:03:47 +07:00
Roman Kennke
ded13e196e 8277072: ObjectStreamClass caches keep ClassLoaders alive
Backport-of: 8eb453baeb
2022-08-12 05:03:47 +07:00
Goetz Lindenmaier
571b532e4a 8255266: Update Public Suffix List to 3c213aa
Backport-of: 7ce75afbbc
2022-08-12 05:03:46 +07:00
Chris Hegarty
ed86c36661 8282444: Module finder incorrectly assumes default file system path-separator character
Backport-of: 369291b265
2022-08-12 05:03:46 +07:00
Foivos Zakkak
7bed060528 8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly
Backport-of: 0cbc4b85bf
2022-08-12 05:03:45 +07:00
Matthias Baesken
e8919f69bf 8282345: handle latest VS2022 in abstract_vm_version
Backport-of: 735e86b0f7
2022-08-12 05:03:45 +07:00
Matthias Baesken
97b6989f7e 8281274: deal with ActiveProcessorCount in os::Linux::print_container_info
Backport-of: bb2e10ccea
2022-08-12 05:03:44 +07:00
Thomas Stuefe
b4e914c598 8280543: Update the "java" and "jcmd" tool specification for CDS
Reviewed-by: mdoerr
Backport-of: 39165613aa
2022-08-12 05:03:44 +07:00
Jonathan Dowland
69901ee2ae 8193682: Infinite loop in ZipOutputStream.close()
Backport-of: 1e9ed54d36
2022-08-12 05:03:44 +07:00
Goetz Lindenmaier
e80095cbbb 8282583: Update BCEL md to include the copyright notice
Backport-of: 8478173d83
2022-08-12 05:03:43 +07:00
Goetz Lindenmaier
2f6484fc04 8277922: Unable to click JCheckBox in JTable through Java Access Bridge
Backport-of: 1668c02ee8
2022-08-12 05:03:43 +07:00
Goetz Lindenmaier
3a0ff5f8e7 8249592: Robot.mouseMove moves cursor to incorrect location when display scale varies and Java runs in DPI Unaware mode
Backport-of: 8aba4de984
2022-08-12 05:03:42 +07:00
Goetz Lindenmaier
524e6fca1c 8282295: SymbolPropertyEntry::set_method_type fails with assert
Backport-of: 3e4dfc63e7
2022-08-12 05:03:42 +07:00
Goetz Lindenmaier
d7a5f009b4 8281275: Upgrading from 8 to 11 no longer accepts '/' as filepath separator in gc paths
Backport-of: 84868e39be
2022-08-12 05:03:42 +07:00
Goetz Lindenmaier
1a4c711bee 8281262: Windows builds in different directories are not fully reproducible
Backport-of: d442328bc2
2022-08-12 05:03:41 +07:00
Goetz Lindenmaier
127aac5048 8278472: Invalid value set to CANDIDATEFORM structure
Backport-of: 2426d58e59
2022-08-12 05:03:41 +07:00
Goetz Lindenmaier
5784f0fc93 8280956: Re-examine copyright headers on files in src/java.desktop/macosx/native/libawt_lwawt/awt/a11y
Backport-of: fe547eacd7
2022-08-12 05:03:40 +07:00
Zhengyu Gu
e32f73e792 8265261: java/nio/file/Files/InterruptCopy.java fails with java.lang.RuntimeException: Copy was not interrupted
Backport-of: aaedac635a
2022-08-12 05:03:40 +07:00
Goetz Lindenmaier
ee44a598de 8280401: [sspi] gss_accept_sec_context leaves output_token uninitialized
Backport-of: 6352c020c2
2022-08-12 05:03:40 +07:00
Goetz Lindenmaier
3993897d0c 8279227: Access Bridge: Wrong frame position and hit test result on HiDPI display
Backport-of: 20ef954158
2022-08-12 05:03:39 +07:00
Goetz Lindenmaier
93184aeda8 8277087: ZipException: zip END header not found at ZipFile#Source.findEND
Backport-of: e3243ee963
2022-08-12 05:03:38 +07:00
Goetz Lindenmaier
b865c002ba 8278851: Correct signer logic for jars signed with multiple digestalgs
Reviewed-by: mbaesken
Backport-of: 61b8944327
2022-08-12 05:03:38 +07:00
Goetz Lindenmaier
a4ee35adb4 8276796: gc/TestSystemGC.java large pages subtest fails with ZGC
Backport-of: 91bb0d658b
2022-08-12 05:03:38 +07:00
Goetz Lindenmaier
4d171c961d 8214733: runtime/8176717/TestInheritFD.java timed out
Backport-of: 4501ddda7f
2022-08-12 05:03:37 +07:00
Goetz Lindenmaier
e71964b3cd 8279437: [JVMCI] exception in HotSpotJVMCIRuntime.translate can exit the VM
Backport-of: e14fb4f4aa
2022-08-12 05:03:37 +07:00
Goetz Lindenmaier
0385996b9d 8278186: org.jcp.xml.dsig.internal.dom.Utils.parseIdFromSameDocumentURI throws StringIndexOutOfBoundsException when calling substring method
Backport-of: 1f1db838ab
2022-08-12 05:03:36 +07:00
Goetz Lindenmaier
32147193a6 8277422: tools/jar/JarEntryTime.java fails with modified time mismatch
Backport-of: ad1ff27b73
2022-08-12 05:03:36 +07:00
Goetz Lindenmaier
6d9c78df76 8277165: jdeps --multi-release --print-module-deps fails if module-info.class in different versioned directories
8277166: Data race in jdeps VersionHelper
8277123: jdeps does not report some exceptions correctly

Backport-of: 7e54d065a1
2022-08-12 05:03:35 +07:00
Goetz Lindenmaier
9526d4ad67 8275037: Test vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java crashes with memory exhaustion on Windows
Backport-of: 9f2f46ee45
2022-08-12 05:03:35 +07:00
Sergey Bylokhov
08d5e3c0ec 8274751: Drag And Drop hangs on Windows
Backport-of: 7a0a6c95a5
2022-08-12 05:03:34 +07:00
Aleksey Shipilev
f44f5ca2ef 8281638: jfr/event/allocation tests fail with release VMs after JDK-8281318 due to lack of -XX:+UnlockDiagnosticVMOptions
Backport-of: d254cf28c5
2022-08-12 05:03:34 +07:00
Aleksey Shipilev
43f3e70495 8281318: Improve jfr/event/allocation tests reliability
Backport-of: 65831eb294
2022-08-12 05:03:33 +07:00
Aleksey Shipilev
6f6fde9676 8277893: Arraycopy stress tests
Backport-of: 29bd73638a
2022-08-12 05:03:33 +07:00
Zhengyu Gu
0326271feb 8281615: Deadlock caused by jdwp agent
Backport-of: e1060bee2a
2022-08-12 05:03:32 +07:00
Martin Doerr
b24ab129a9 8273139: C2: assert(f <= 1 && f >= 0) failed: Incorrect frequency
Backport-of: 68b40ec286
2022-08-12 05:03:32 +07:00
Aleksey Shipilev
66b637e2a0 8283017: GHA: Workflows break with update release versions
Reviewed-by: clanger
Backport-of: 01570ca92d
2022-08-12 05:03:31 +07:00
Goetz Lindenmaier
dbf3faaf78 8270435: UT: MonitorUsedDeflationThresholdTest failed: did not find too_many string in output
Backport-of: 21e302a0f4
2022-08-12 05:03:31 +07:00
Goetz Lindenmaier
a4083f2d97 8274172: Convert JavadocTester to use NIO
Backport-of: 5b0c9ccc49
2022-08-12 05:03:31 +07:00
Goetz Lindenmaier
57d88f1ae3 8272168: some hotspot runtime/logging tests don't check exit code
Backport-of: 3b899ef7ff
2022-08-12 05:03:30 +07:00
Goetz Lindenmaier
f5d1b42145 8269077: TestSystemGC uses "require vm.gc.G1" for large pages subtest
Backport-of: 1a818154cf
2022-08-12 05:03:30 +07:00
Goetz Lindenmaier
26002e711c 8267163: Rename anonymous loader tests to hidden loader tests
Reviewed-by: mdoerr
Backport-of: 5c21c00441
2022-08-12 05:03:29 +07:00
Aleksey Shipilev
46ca7f91f9 8281168: Micro-optimize VarForm.getMemberName for interpreter
Backport-of: fc77217814
2022-08-12 05:03:29 +07:00
Aleksey Shipilev
a8c6a42789 8279668: x86: AVX2 versions of vpxor should be asserted
Backport-of: 2bbeae3f05
2022-08-12 05:03:28 +07:00
Aleksey Shipilev
55316fcd42 8279958: Provide configure hints for Alpine/apk package managers
Backport-of: a30aa52b77
2022-08-12 05:03:28 +07:00
Goetz Lindenmaier
8f5df0c2e0 8276657: XSLT compiler tries to define a class with empty name
Backport-of: a093cdddaf
2022-08-12 05:03:28 +07:00
Goetz Lindenmaier
b8a848a0a1 8276825: hotspot/runtime/SelectionResolution test errors
Backport-of: 55b36c6f3b
2022-08-12 05:03:27 +07:00
Goetz Lindenmaier
3dc983f494 8276260: (se) Remove java/nio/channels/Selector/Wakeup.java from ProblemList (win)
Backport-of: fa4ce824a3
2022-08-12 05:03:27 +07:00
Goetz Lindenmaier
d38084d1b7 8251904: vmTestbase/nsk/sysdict/vm/stress/btree/btree010/btree010.java fails with ClassNotFoundException: nsk.sysdict.share.BTree0LLRLRLRRLR
Backport-of: 7ca053de21
2022-08-12 05:03:27 +07:00
Goetz Lindenmaier
a3180b1137 8268595: java/io/Serializable/serialFilter/GlobalFilterTest.java#id1 failed in timeout
Backport-of: f143d2a88e
2022-08-12 05:03:26 +07:00
Goetz Lindenmaier
632636e8e4 8274244: ReportOnImportedModuleAnnotation.java fails on rerun
Backport-of: c391e59ea6
2022-08-12 05:03:26 +07:00
Goetz Lindenmaier
3d204f8be6 8274561: sun/net/ftp/TestFtpTimeValue.java timed out on slow machines
Backport-of: b7b78ff1f3
2022-08-12 05:03:26 +07:00
Goetz Lindenmaier
d693bf5605 8274233: Minor cleanup for ToolBox
Backport-of: e741a18062
2022-08-12 05:03:25 +07:00
Goetz Lindenmaier
a58c0b57c0 8269373: some tests in jdk/tools/launcher/ fails on localized Windows platform
Backport-of: cb112affd6
2022-08-12 05:03:25 +07:00
Martin Doerr
7252596a68 8282509: [exploded image] ResolvedClassTest fails with similar output
Backport-of: 7c8ea9f05b
2022-08-12 05:03:25 +07:00
Aleksey Shipilev
2e55e09e3f 8282225: GHA: Allow one concurrent run per PR only
Backport-of: aaab2cb416
2022-08-12 05:03:24 +07:00
Goetz Lindenmaier
f3e44e4982 8268558: [TESTBUG] Case 2 in TestP11KeyFactoryGetRSAKeySpec is skipped
Backport-of: 041ae20b10
2022-08-12 05:03:24 +07:00
Goetz Lindenmaier
bb61917806 8272146: Disable Fibonacci test on memory constrained systems
Backport-of: adba09b91d
2022-08-12 05:03:23 +07:00
Martin Doerr
0e609d0340 8279515: C1: No inlining through invokedynamic and invokestatic call sites when resolved class is not linked
Backport-of: ad34f03b54
2022-08-12 05:03:23 +07:00
Goetz Lindenmaier
afc221ac87 8272169: runtime/logging/LoaderConstraintsTest.java doesn't build test.Empty
Backport-of: eb6f3fe59d
2022-08-12 05:03:23 +07:00
Goetz Lindenmaier
395f1db843 8271224: runtime/EnclosingMethodAttr/EnclMethodAttr.java doesn't check exit code
Backport-of: 68dd828088
2022-08-12 05:03:22 +07:00
Goetz Lindenmaier
b31cfa2f65 8269753: Misplaced caret in PatternSyntaxException's detail message
Backport-of: bb508e1303
2022-08-12 05:03:22 +07:00
Goetz Lindenmaier
d6f8c7a0f6 8270336: [TESTBUG] Fix initialization in NonbranchyTree
Backport-of: 3cadc36060
2022-08-12 05:03:21 +07:00
Goetz Lindenmaier
28681e649a 8269933: test/jdk/javax/net/ssl/compatibility/JdkInfo incorrect verification of protocol and cipher support
Backport-of: 6346793c64
2022-08-12 05:03:21 +07:00
Goetz Lindenmaier
87f63d5c42 8270837: fix typos in test TestSigParse.java
Backport-of: 67dc1c5bf3
2022-08-12 05:03:21 +07:00
Goetz Lindenmaier
e93ec19534 8270021: Incorrect log decorators in gc/g1/plab/TestPLABEvacuationFailure.java
Backport-of: 4a45d95719
2022-08-12 05:03:20 +07:00
Goetz Lindenmaier
e02a79321e 8263538: SharedArchiveConsistency.java should test -Xshare:auto as well
Backport-of: e8206dbb17
2022-08-12 05:03:20 +07:00
Goetz Lindenmaier
9866a26809 8269135: TestDifferentProtectionDomains runs into timeout in client VM
Reviewed-by: clanger
Backport-of: 53ad903a82
2022-08-12 05:03:20 +07:00
Goetz Lindenmaier
d4cd137bcb 8268906: gc/g1/mixedgc/TestOldGenCollectionUsage.java assumes that GCs take 1ms minimum
Backport-of: a0f32cb140
2022-08-12 05:03:19 +07:00
Martin Doerr
40197b975b 8270468: TestRangeCheckEliminated fails because methods are not compiled
Backport-of: bb82005a81
2022-08-12 05:03:19 +07:00
Martin Doerr
e198e9e42d 8269129: Multiple tier1 tests in hotspot/jtreg/compiler are failing for client VMs
Backport-of: 561a3a5077
2022-08-12 05:03:19 +07:00
Martin Doerr
058560a46b 8278948: compiler/vectorapi/reshape/TestVectorCastAVX1.java crashes in assembler
Backport-of: f8f9148016
2022-08-12 05:03:18 +07:00
Martin Doerr
2f0e6bb6e5 8265317: [vector] assert(payload->is_object()) failed: expected 'object' value for scalar-replaced boxed vector but got: NULL
Backport-of: 58b5fb3233
2022-08-12 05:03:18 +07:00
Martin Doerr
4c83332a4d 8278966: two microbenchmarks tests fail "assert(!jvms->method()->has_exception_handlers()) failed: no exception handler expected" after JDK-8275638
Backport-of: e7244c19f4
2022-08-12 05:03:17 +07:00
Martin Doerr
bf641b1d96 8275638: GraphKit::combine_exception_states fails with "matching stack sizes" assert
Backport-of: b9a477bf19
2022-08-12 05:03:17 +07:00
Jim Laskey
15c2822499 8273056: java.util.random does not correctly sample exponential or Gaussian distributions
Backport-of: 3d98ec1b7b
2022-08-12 05:03:17 +07:00
Roman Kennke
b61e554077 8276990: Memory leak in invoker.c fillInvokeRequest() during JDI operations
Backport-of: 5ab22e88da
2022-08-12 05:03:16 +07:00
Martin Doerr
42d1ea7152 8274855: vectorapi tests failing with assert(!vbox->is_Phi()) failed
Backport-of: 5021a12cea
2022-08-12 05:03:16 +07:00
Martin Doerr
84489b10d0 8278796: Incorrect behavior of FloatVector.withLane on X86
Backport-of: 8494fec665
2022-08-12 05:03:15 +07:00
Martin Doerr
272578cedc 8278014: [vectorapi] Remove test run script
Backport-of: 9b3e672059
2022-08-12 05:03:15 +07:00
Martin Doerr
7b55c53f9c 8275830: C2: Receiver downcast is missing when inlining through method handle linkers
Backport-of: 95a3010acf
2022-08-12 05:03:14 +07:00
Martin Doerr
40b1874eaa 8280123: C2: Infinite loop in CMoveINode::Ideal during IGVN
Backport-of: 3f747368b9
2022-08-12 05:03:14 +07:00
Martin Doerr
233b897c32 8273804: Platform.isTieredSupported should handle the no-compiler case
Backport-of: 46af82e5b0
2022-08-12 05:03:14 +07:00
Dmitry Chuyko
d7d8826d20 8279560: AArch64: generate_compare_long_string_same_encoding and LARGE_LOOP_PREFETCH alignment
Backport-of: 126328cb62
2022-08-12 05:03:13 +07:00
Martin Doerr
b2c70ac401 8279356: Method linking fails with guarantee(mh->adapter() != NULL) failed: Adapter blob must already exist!
Backport-of: 6d7db4b0b3
2022-08-12 05:03:13 +07:00
Martin Doerr
79fe35402f 8279837: C2: assert(is_Loop()) failed: invalid node class: Region
Backport-of: 65eb066b63
2022-08-12 05:03:12 +07:00
Martin Doerr
27be767641 8258814: Compilation logging crashes for thread suspension / debugging tests
Backport-of: 35ee0f38c6
2022-08-12 05:03:12 +07:00
Dmitry Chuyko
555eb2c11d 8268231: Aarch64: Use Ldp in intrinsics for String.compareTo
Backport-of: 6d1d4d5292
2022-08-12 05:03:12 +07:00
Martin Doerr
8bfcb91055 8275854: C2: assert(stride_con != 0) failed: missed some peephole opt
Backport-of: aea096770e
2022-08-12 05:03:11 +07:00
Martin Doerr
6b3085bcfc 8277906: Incorrect type for IV phi of long counted loops after CCP
Backport-of: 3889af3f7d
2022-08-12 05:03:11 +07:00
Martin Doerr
de44a84fe6 8274983: C1 optimizes the invocation of private interface methods
Reviewed-by: xliu
Backport-of: 21d9ca6cd9
2022-08-12 05:03:10 +07:00
Martin Doerr
fa6000cf15 8281043: Intrinsify recursive ObjectMonitor locking for PPC64
Backport-of: 46c6c6f308
2022-08-12 05:03:10 +07:00
Goetz Lindenmaier
dc2b2d9c2e 8282499: Bump update version for OpenJDK: jdk-17.0.4
Reviewed-by: mdoerr
2022-08-12 05:03:09 +07:00
bell-sw
9c742187e9 Revert "JBR-4141 Access Bridge: Wrong frame position and hit test result on HiDPI display"
This reverts commit ba8cdbab2b.
2022-08-12 05:03:09 +07:00
Alexey Ushakov
ebb238ba17 JBR-4692 Metal: sync content of the destination drawing surface before changing it to another one
Conditionally sync surfaces using JVM option sun.java2d.metal.syncSurfaces
The default value is false
2022-08-02 18:35:03 +02:00
Maxim Kartashev
bff39eae86 JBR-3770 IDE crash at Java2D Disposer
The list of deferredRecords could be modified by Disposer.pollRemove()
on one thread, while being traversed by Disposer.clearDeferredRecords()
on another thread at the same time.
Such use of a non-thread-safe collection sometimes lead to a null
record retrieved from deferredRecords (which does not contain nulls),
resulting in a caught and ignored NPE. Another result was an abort()
caused by calling free() as detected by libc's built-in heap health
checks, likely triggered by free'ing the same block more than once.
2022-08-01 14:01:27 +03:00
Vitaly Provodin
fa9a4b9742 exclude javax/swing/SwingUtilities/7146377/bug7146377.java on windows due to JBR-4679 2022-07-29 19:32:05 +07:00
Vitaly Provodin
36f40cde58 exclude javax/swing/SwingUtilities/4917669/bug4917669.java on windows due to JBR-4677 2022-07-29 19:32:04 +07:00
Vitaly Provodin
a6733ca842 exclude jb/hotspot/AbortHandler.java on macosx-all due to JBR-4669 2022-07-29 19:32:04 +07:00
Nikita Gubarkov
a57350d46e JBR-4524 JBR-4558 Null check TT_OS2 2022-07-29 10:58:15 +07:00
Nikita Gubarkov
83ef7a38a1 JBR-4553 Add logging to setUpTransparentTitleBar and resetTitleBar 2022-07-29 10:57:49 +07:00
Artem Semenov
5b12ba3f8e JBR-4633 [macos] Voice over reads the boolean value as null in the JTable 2022-07-29 10:56:10 +07:00
Nikita Gubarkov
8e86767f1f JBR-2917 Move dingbats and symbol fonts to fallback sequence on Windows
That gives emoji font higher priority which fixes ZWJ sequences in composite fonts.
2022-07-29 10:53:30 +07:00
Nikita Gubarkov
e60a9a08c1 JBR-4373 Add mapping for .NewYork-* and .SFArabic-* system fonts 2022-07-29 10:52:14 +07:00
Nikita Gubarkov
fedaa584bb JBR-2917 Add Segoe UI Emoji to font fallback on Windows 2022-07-29 10:52:05 +07:00
Alexey Ushakov
8a39aaff64 JBR-4591 macOS: SIGILL at [libsystem_kernel] __kill in -[__NSMallocBlock__ removeFromSuperview]: unrecognized selector sent to instance
Verified if windowDragView is present
2022-07-29 10:49:55 +07:00
Maxim Kartashev
da28b4dbdd JBR-3101 Exception in NSApplicationAWT: java.lang.NullPointerException at java.desktop/sun.lwawt.macosx.CPlatformComponent.setBounds
CWarningWindow doesn't have a peer, so accomodated for that in
CPlatformComponent.setBounds().
2022-07-29 10:49:04 +07:00
Alexey Ushakov
e16b31fd8b JBR-4588 macOS: SIGILL at [libsystem_kernel] __kill in CCE: class sun.java2d.opengl.CGLGraphicsConfig cannot be cast to class sun.java2d.metal.MTLGraphicsConfig
Prevent fall back to OpenGL if Metal has been used before
2022-07-27 15:57:43 +07:00
Vitaly Provodin
e1ca682a0f exclude jb/hotspot/AbortHandler.java on macosx-11.6.7 due to JBR-4669 2022-07-27 15:55:40 +07:00
Dmitry Batrak
b73fa25c44 Re-apply JBR-4642 fix - to be released with .1 update 2022-07-27 09:02:14 +03:00
Dmitry Batrak
f7a9dbc918 Revert "JBR-4281 Window losing focus isn't detected in some cases on macOS"
This reverts commit 11ad455c7a.
2022-07-19 11:05:11 +03:00
Dmitry Batrak
bfebc79dcc Revert "JBR-4640 [backport to 222] Regression: Unable to enter emoji in editor via Emoji & Symbols on macOS"
This reverts commit 95457fb756.
2022-07-19 11:04:21 +03:00
Dmitry Batrak
ff0de5f0d5 Revert JBR-4642 fix temporarily - to be released with .1 update 2022-07-19 11:04:21 +03:00
Dmitry Batrak
7dc6410dd1 JBR-4642 regression: "focus follows mouse" broken for modals, I need to click into them
a better solution, fixing also the case when mouse hovers over a window, which is not the modal dialog's ancestor

(cherry picked from commit ec748f84fb)
2022-07-18 17:10:15 +03:00
Dmitry Batrak
05a5147f88 JBR-4642 regression: "focus follows mouse" broken for modals, I need to click into them
(cherry picked from commit c55bf03680)
2022-07-18 17:10:15 +03:00
Dmitry Batrak
95457fb756 JBR-4640 [backport to 222] Regression: Unable to enter emoji in editor via Emoji & Symbols on macOS
(cherry picked from commit 8b9a00915d)
2022-07-13 10:25:26 +03:00
Vladimir Kempik
ec58262184 8289697: buffer overflow in MTLVertexCache.m: MTLVertexCache_AddGlyphQuad
Cherry-pick of https://github.com/openjdk/jdk/pull/9368
2022-07-08 17:24:51 +07:00
Maxim Kartashev
f13c59e009 JBR-4602 Unexpected NoSuchFileException running Rider test
This reverts commits for JBR-3680, JBR-4118, and JBR-4485.

(cherry picked from commit acb42be927)
2022-06-29 14:58:30 +03:00
Vladimir Kempik
33b61760e7 8256844: Make NMT late-initializable
Cherry pick of PR https://github.com/openjdk/jdk17u-dev/pull/496

Reviewed-by: stuefe
2022-06-29 16:09:12 +07:00
Jaroslav Bachorik
b244b0bf8c exclude vmTestbase/vm/jit/LongTransitions due to 8271615 on macOS 2022-06-28 06:50:05 +07:00
Brian Burkhalter
aa19772a73 8272759: (fc) java/nio/channels/FileChannel/Transfer2GPlus.java failed in timeout
Reviewed-by: alanb
(cherry picked from commit 81d416477f)
2022-06-27 07:05:03 +07:00
Nikita Provotorov
b52aba91ca fixup! JBR-4394, IDEA-246833: refactoring and blocking the fix of JBR-1573 to recreate IMs and ICs during preediting. 2022-06-24 17:45:38 +07:00
Nikita Provotorov
64f83ea65b JBR-4394, IDEA-246833: refactoring and blocking the fix of JBR-1573 to recreate IMs and ICs during preediting.
(cherry picked from commit 7a36587db8d3d5a63c5691243cd5bf56733c06e6)
2022-06-24 17:45:34 +07:00
Nikita Provotorov
a40ae34312 JBR-4394, IDEA-246833: fixup of JBR-2444.
(cherry picked from commit ef262dc8bb)
2022-06-24 17:45:29 +07:00
Vitaly Provodin
de262a3469 JBR-4566 release file does not contain IMPLEMENTOR and other properties 2022-06-24 16:40:08 +07:00
Maxim Kartashev
3733e2ae15 fixup! JBR-4485 Windows: EXCEPTION_ACCESS_VIOLATION at sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.readNextEntry
(cherry picked from commit 57cd74977e)
2022-06-21 09:34:19 +03:00
Maxim Kartashev
2d62f273a3 JBR-4485 Windows: EXCEPTION_ACCESS_VIOLATION at sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.readNextEntry
As a precaution, range-check the offset returned by WinAPI before
using it to read raw memory with Unsafe.

(cherry picked from commit 04544a5f96)
2022-06-21 09:33:03 +03:00
Vitaly Provodin
2b77d4d847 JBR-4570 improve synchronization and increase waiting time 2022-06-14 11:00:32 +07:00
Vitaly Provodin
5ad02c5a85 JBR-3770 exclude java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java from regular runs on macosx-all 2022-06-11 04:41:51 +07:00
Vitaly Provodin
8b6b552e71 JBR-4451 fix the case when asterik cannot be found in string with perf score
After adding the set -e option, which instructs bash to immediately exit if any command has a non-zero exit status, perfcmp.sh unexpectedly exited because grep could not find an asterik. But it is expected case which means that the score is applicable
2022-06-11 04:41:44 +07:00
Rajan Halade
b4f2a14d82 8287109: Distrust.java failed with CertificateExpiredException
Reviewed-by: mullan

(cherry picked from commit 5b7d066ca5)
2022-06-11 04:41:38 +07:00
Vitaly Provodin
e4a0d7edb0 exclude sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java due to 8252812 on linux-all 2022-06-11 04:41:35 +07:00
Vitaly Provodin
e943e5ea2c exclude java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_4.java due to 8204200 2022-06-11 04:41:32 +07:00
Nikita Gubarkov
dde287c9c8 JBR-4031 add null-check for tagsArray returned from CTFontCopyAvailableTables 2022-06-10 04:50:54 +07:00
Dmitry Batrak
8285ae0f1a JBR-4539 [backport to 222] Popup windows disappear on mouse hover when 'Focus strictly under mouse' policy is used in KDE
use override-redirect flag for popup menus on KDE - popup menus aren't affected by JBR-4535,
as they use an active mouse pointer grab, and marking them as override-redirect will allow to display
them over the system task bar, as https://bugs.openjdk.org/browse/JDK-6580930 requires
2022-06-09 21:07:41 +03:00
Dmitry Batrak
52ece6559f JBR-4550 [backport to 222] Focus is not returned back to IDE after closing "Open" dialog 2022-06-09 21:07:40 +03:00
Dmitry Batrak
75a3b6af6e JBR-4545 [backport to 222] NPE: IdeEventQueue.lambda$getNextEvent$0 2022-06-09 21:07:17 +03:00
Dmitry Batrak
f995dd1309 JBR-4540 [backport to 222] Popup windows shown for a background window cause app icon to blink in taskbar on KDE 2022-06-09 21:06:52 +03:00
Dmitry Batrak
c9444823b4 JBR-4539 [backport to 222] Popup windows disappear on mouse hover when 'Focus strictly under mouse' policy is used in KDE 2022-06-09 21:06:14 +03:00
Vitaly Provodin
a52c519313 JBR-4272 fix misprint in linux-aarch64 2022-05-30 04:51:42 +07:00
Vitaly Provodin
08e31f8822 JBR-4520 set file permissions after signing 2022-05-29 14:26:11 +07:00
122 changed files with 620 additions and 3713 deletions

View File

@@ -11,9 +11,7 @@ can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntim
| IDE Version | Latest JBR | Date Released |
| --- | --- | --- |
| 2022.3 | [17.0.4.1-b597.1](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.4.1b597.1)| 12-Sep-2022 |
| 2022.2 | [17.0.4-b469.53](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.4b469.53)| 31-Aug-2022 |
| 2022.2 | [17.0.3-b463.3](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17.0.3b463.3) | 24-May-2022 |
## Contents
- [Welcome to JetBrains Runtime](#jetbrains-runtime)

View File

@@ -114,8 +114,8 @@ cd "$SCRIPT_DIR/.." ; OPENJDK_DIR=`pwd`
IDEA_MAKE="$OPENJDK_DIR/make/ide/idea/jdk"
IDEA_TEMPLATE="$IDEA_MAKE/template"
cp -r "$TOPLEVEL_DIR/jb/project/idea-project-files"/* "$IDEA_OUTPUT"
cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
cp -rn "$TOPLEVEL_DIR/jb/project/idea-project-files"/* "$IDEA_OUTPUT"
cp -rn "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
#override template
if [ -d "$TEMPLATES_OVERRIDE" ] ; then
@@ -321,4 +321,4 @@ if [ "$VERBOSE" = true ] ; then
echo "
Now you can open \"$IDEA_PROJECT_DIR\" as IDEA project
You can also run 'bash \"$IDEA_OUTPUT/jdk-clion/update-project.sh\"' to generate Clion project"
fi
fi

View File

@@ -100,18 +100,11 @@ REPRODUCIBLE_BUILD_OPTS="--enable-reproducible-build
function zip_native_debug_symbols() {
image_bundle_path=$(echo $1 | cut -d"/" -f-4)
jdk_name=$(echo $1 | cut -d"/" -f5)
jbr_diz_name=$2
[ -d "dizfiles" ] && rm -rf dizfiles
mkdir dizfiles
(cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} ../../../../dizfiles \; )
rsync_target="../../../../dizfiles"
[ -z "$jdk_name" ] && rsync_target=$rsync_target"/"$jbr_diz_name
(cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} $rsync_target \;)
[ ! -z "$jdk_name" ] && mv dizfiles/$jdk_name dizfiles/$jbr_diz_name
(cd dizfiles && find $jbr_diz_name -print0 | COPYFILE_DISABLE=1 \
(cd dizfiles && find . -print0 | COPYFILE_DISABLE=1 \
tar --no-recursion --null -T - -czf ../"$jbr_diz_name".tar.gz) || do_exit $?
}
@@ -146,7 +139,7 @@ function update_jsdk_mods() {
# re-create java.base.jmod with updated hashes
tmp=.java.base.$$.tmp
mkdir "$tmp" || exit $?
hash_modules=$("$__jsdk"/bin/jmod describe "$__orig_jsdk_mods"/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
hash_modules=$("$JSDK"/bin/jmod describe "$__orig_jsdk_mods"/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
"$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.base.jmod || exit $?
rm "$__updated_jsdk_mods"/java.base.jmod || exit $? # temp exclude from path
"$__jsdk"/bin/jmod \

View File

@@ -63,7 +63,7 @@ function create_image_bundle {
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix:-}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${libc_type_suffix}aarch64-${fastdebug_infix:-}b${build_number%%.*}
echo Running jlink....

View File

@@ -63,7 +63,7 @@ function create_image_bundle {
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix:-}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${libc_type_suffix}x64-${fastdebug_infix:-}b${build_number%%.*}
echo Running jlink....
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
@@ -93,7 +93,7 @@ function create_image_bundle {
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
gzip "$JBR".tar || do_exit $?
#rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
}
WITH_DEBUG_LEVEL="--with-debug-level=release"

View File

@@ -52,7 +52,7 @@ function create_image_bundle {
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix:-}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${libc_type_suffix}x86-${fastdebug_infix:-}b${build_number%%.*}
echo Running jlink....
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"

View File

@@ -29,14 +29,6 @@ BOOT_JDK=${BOOT_JDK:=$(/usr/libexec/java_home -v 16)}
function do_configure {
if [[ "${architecture}" == *aarch64* ]]; then
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
WITH_EXTRA_CFLAGS="--with-extra-cflags="-F$(pwd)/$JCEF_PATH/Frameworks"
--with-extra-cxxflags="-F$(pwd)/$JCEF_PATH/Frameworks"
--with-extra-ldflags="-F$(pwd)/$JCEF_PATH/Frameworks" "
else
WITH_EXTRA_CFLAGS=""
fi
sh configure \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
@@ -51,7 +43,9 @@ function do_configure {
--with-macosx-version-max="${MACOSX_VERSION_MAX:="11.00.00"}" \
--disable-hotspot-gtest --disable-javac-server --disable-full-docs --disable-manpages \
--enable-cds=no \
$WITH_EXTRA_CFLAGS \
--with-extra-cflags="-F$(pwd)/Frameworks" \
--with-extra-cxxflags="-F$(pwd)/Frameworks" \
--with-extra-ldflags="-F$(pwd)/Frameworks" \
$STATIC_CONF_ARGS \
$REPRODUCIBLE_BUILD_OPTS \
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
@@ -90,7 +84,7 @@ function create_image_bundle {
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${architecture}-${fastdebug_infix:-}b${build_number%%.*}
JRE_CONTENTS=$tmp/$__root_dir/Contents
mkdir -p "$JRE_CONTENTS" || do_exit $?

View File

@@ -2,27 +2,20 @@
set -euo pipefail
TC_PRINT=0
# Always print TeamCity service messages if running under TeamCity
[[ -n "${TEAMCITY_VERSION:-}" ]] && TC_PRINT=1
while getopts ":t" o; do
case "${o}" in
t) TC_PRINT=1 ;;
*);;
t)
t="With Teamcity tests info"
TC_PRINT=1
;;
esac
done
shift $((OPTIND-1))
NEWFILEPATH="$1"
CONFIGID="$2"
BUILDID="$3"
TOKEN="$4"
if [ ! -f "$NEWFILEPATH" ]; then
echo "File not found: $NEWFILEPATH"
exit 1
fi
NEWFILEPATH=$1
CONFIGID=$2
BUILDID=$3
TOKEN=$4
#
# Get the size of new artifact
#
@@ -36,7 +29,11 @@ case "${unameOut}" in
NEWFILESIZE=$(stat -f%z "$NEWFILEPATH")
;;
CYGWIN*)
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
NEWFILESIZE=$(stat -c%s$4
#
# Get the size of new artifact
#
"$NEWFILEPATH")
;;
MINGW*)
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
@@ -45,13 +42,13 @@ case "${unameOut}" in
echo "Unknown machine: ${unameOut}"
exit 1
esac
FILENAME=$(basename "${NEWFILEPATH}")
FILENAME=$(basename ${NEWFILEPATH})
#
# Get pattern of artifact name
# Base filename pattern: <BUNDLE_TYPE>-<JDK_VERSION>-<OS>-<ARCH>-b<BUILD>.tar.gz: jbr_dcevm-17.0.2-osx-x64-b1234.tar.gz
# BUNDLE_TYPE: jbr, jbrsdk, jbr_dcevm, jbrsdk_jcef etc.
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, linux-musl-x64, windows-x64 etc.
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, windows-x64 etc.
BUNDLE_TYPE=jbrsdk
OS_ARCH_PATTERN=""
@@ -62,37 +59,33 @@ if [[ $FILENAME =~ $re ]]; then
BUNDLE_TYPE=${BASH_REMATCH[1]}
OS_ARCH_PATTERN=${BASH_REMATCH[2]}
FILE_EXTENSION=${BASH_REMATCH[3]}
else
echo "File name $FILENAME does not match regex $re"
exit 1
fi
function test_started_msg() {
if [ $TC_PRINT -eq 1 ]; then
echo "##teamcity[testStarted name='$1']"
fi
}
if [ $TC_PRINT -eq 1 ]; then
testname_file_ext=`echo $FILE_EXTENSION | sed 's/\./_/g'`
testname=$BUNDLE_TYPE"_"$OS_ARCH_PATTERN$testname_file_ext
echo \#\#teamcity[testStarted name=\'$testname\']
fi
echo "BUNDLE_TYPE: " $BUNDLE_TYPE
echo "OS_ARCH_PATTERN: " $OS_ARCH_PATTERN
echo "FILE_EXTENSION: " $FILE_EXTENSION
echo "New size of $FILENAME = $NEWFILESIZE bytes."
function test_failed_msg() {
if [ $TC_PRINT -eq 1 ]; then
echo "##teamcity[testFailed name='$1' message='$2']"
if [ $3 -eq 1 ]; then
echo \#\#teamcity[testFailed name=\'$1\' message=\'$2\']
fi
}
function test_finished_msg() {
if [ $TC_PRINT -eq 1 ]; then
echo "##teamcity[testFinished name='$1']"
if [ $2 -eq 1 ]; then
echo \#\#teamcity[testFinished name=\'$1\']
fi
}
test_name="${BUNDLE_TYPE}_${OS_ARCH_PATTERN//\-/_}${FILE_EXTENSION//\./_}"
test_started_msg "$test_name"
echo "BUNDLE_TYPE: $BUNDLE_TYPE"
echo "OS_ARCH_PATTERN: $OS_ARCH_PATTERN"
echo "FILE_EXTENSION: $FILE_EXTENSION"
echo "Size of $FILENAME is $NEWFILESIZE bytes"
#
# Get previous successful build ID
# Example:
@@ -102,21 +95,20 @@ echo "Size of $FILENAME is $NEWFILESIZE bytes"
# expected return value
# id="123".number="567"
#
CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
re='id=\"([0-9]+)\".+number=\"([0-9\.]+)\"'
# ID: Previous successful build id
ID=0
if [[ $CURL_RESPONSE =~ $re ]]; then
ID=${BASH_REMATCH[1]}
echo "Previous build ID: $ID"
echo "Previous build number: ${BASH_REMATCH[2]}"
echo "BUILD Number: ${BASH_REMATCH[2]}"
else
msg="ERROR: cannot find previous build"
echo "$msg"
echo "$CURL_RESPONSE"
test_failed_msg "$test_name" "$msg"
test_finished_msg "$test_name"
msg="ERROR: can't find previous build"
echo $msg
echo $CURL_RESPONSE
test_failed_msg $testname $msg $TC_PRINT
test_finished_msg $testname $TC_PRINT
exit 1
fi
@@ -126,37 +118,36 @@ fi
# expected return value
# name="jbrsdk_jcef*.tar.gz size="123'
#
CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
echo "Artifacts of the previous build:"
echo "$CURL_RESPONSE"
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
echo "Atrifacts of previous build of $CONFIGID :"
echo $CURL_RESPONSE
# Find binary size (in response) with reg exp
re="name=\"(${BUNDLE_TYPE}[^\"]+${OS_ARCH_PATTERN}[^\"]+${FILE_EXTENSION})\" size=\"([0-9]+)\""
re='name=\"('$BUNDLE_TYPE'[^\"]+'${OS_ARCH_PATTERN}'[^\"]+'${FILE_EXTENSION}')\" size=\"([0-9]+)\"'
if [[ $CURL_RESPONSE =~ $re ]]; then
prevFileName=${BASH_REMATCH[1]}
echo "Previous artifact name: $prevFileName"
prevFileSize=${BASH_REMATCH[2]}
echo "Previous artifact size: $prevFileSize"
OLDFILENAME=${BASH_REMATCH[1]}
echo "Prev artifact name: $OLDFILENAME"
OLDFILESIZE=${BASH_REMATCH[2]}
echo "Prev artifact size = $OLDFILESIZE"
((allowedSize=prevFileSize+prevFileSize/20)) # use 5% threshold
echo "Allowed size: $allowedSize"
let allowedSize=OLDFILESIZE+OLDFILESIZE/20 # use 5% threshold
echo "Allowed size = $allowedSize"
if [[ "$NEWFILESIZE" -gt "$allowedSize" ]]; then
msg="ERROR: new size is significantly greater than previous size (need to investigate)"
echo "$msg"
test_failed_msg "$test_name" "$msg"
test_finished_msg "$test_name"
msg="ERROR: new size is significally greater than prev size (need to investigate)"
echo $msg
test_failed_msg $testname $msg $TC_PRINT
test_finished_msg $testname $TC_PRINT
exit 1
else
echo "PASSED"
test_finished_msg "$test_name"
test_finished_msg $testname $TC_PRINT
fi
else
msg="ERROR: cannot find string with size in xml response:"
echo "Regex: $re"
echo "$msg"
echo "$CURL_RESPONSE"
test_failed_msg "$test_name" "$msg"
test_finished_msg "$test_name"
msg="ERROR: can't find string with size in xml response:"
echo $msg
echo $CURL_RESPONSE
test_failed_msg $testname $msg $TC_PRINT
test_finished_msg $testname $TC_PRINT
exit 1
fi

View File

@@ -60,13 +60,7 @@ else
testContent=`paste -d '\t' $refFile <(echo "$curValues") | tail -n +1`
fi
testContent=`echo "$testContent" | tr "," "." | awk -F'\t' '{
if ($3>$2+$2*0.1) {
print "* "$1"\t"$2"\t"$3"\t"(($2>0)?$3/$2:"-")
} else {
print " "$1"\t"$2"\t"$3"\t"(($2>0)?$3/$2:"-")
}
}'`
testContent=`echo "$testContent" | awk -F'\t' '{ if ($3>$2+$2*0.1) {print "* "$1"\t"$2"\t"$3"\t"(($2==0)?"-":$3/$2)} else {print " "$1"\t"$2"\t"$3"\t"(($2==0)?"-":$3/$2)} }'`
if [ -z $noHeaders ]; then
echo "$header" > $resFile
fi
@@ -77,12 +71,12 @@ if [ -z $tc ]; then
exit 0
fi
failed=0
failed=1
echo "$testContent" 2>&1 | (
while read -r s; do
testname=`echo "$s" | cut -f 1 | tr -d "[:space:]" | tr -d "*"`
duration=`echo "$s" | cut -f 3`
echo "$s" | cut -c1 | grep -c "*" && failed=1
echo "$s" | cut -c1 | grep -c "*" && failed=0
echo \#\#teamcity[testStarted name=\'$testNamePrefix$testname\']
echo "===>$s"
echo \#\#teamcity[buildStatisticValue key=\'$testNamePrefix$testname\' value=\'$duration\']

View File

@@ -1,142 +0,0 @@
#!/bin/bash
set -euo pipefail
set -x
# The following parameters must be specified:
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to be built;possible values:
# <empty> or nomod - the release bundles without any additional modules (jcef)
# jcef - the release bundles with jcef
# fd - the fastdebug bundles which also include the jcef module
#
# This script makes test-image along with JDK images when bundle_type is set to "jcef".
# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
#
# Environment variables:
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
# to configure
# By default JDK_BUILD_NUMBER is set zero
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_win_aarch64
if [ -z "$BUILD_JDK" ]; then
echo "BUILD_JDK environment variable must be specified and point to a JDK built from the current sources" \
" and is able to run on the build system. See OpenJDK documentation for --with-build-jdk for more info."
exit 1
fi
source jb/project/tools/common/scripts/common.sh
WORK_DIR=$(pwd)
JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_aarch64}
function do_configure {
sh ./configure \
--enable-option-checking=fatal \
--openjdk-target=aarch64-unknown-cygwin \
$WITH_DEBUG_LEVEL \
--with-vendor-name="$VENDOR_NAME" \
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
--with-jvm-features=shenandoahgc \
--with-version-pre= \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-opt=b${build_number} \
--with-toolchain-version=$TOOLCHAIN_VERSION \
--with-boot-jdk=$BOOT_JDK \
--with-build-jdk=$BUILD_JDK \
--disable-ccache \
--enable-cds=yes \
$STATIC_CONF_ARGS \
$REPRODUCIBLE_BUILD_OPTS \
|| do_exit $?
}
function create_image_bundle {
__bundle_name=$1
__arch_name=$2
__modules_path=$3
__modules=$4
fastdebug_infix=''
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
echo Running jlink ...
${BUILD_JDK}/bin/jlink \
--module-path $__modules_path --no-man-pages --compress=2 \
--add-modules $__modules --output $__root_dir || do_exit $?
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
mv release $__root_dir/release
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
rsync -a --exclude demo --exclude sample $dir $__root_dir
done
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
fi
}
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=windows-aarch64-server-release
case "$bundle_type" in
"jcef")
do_reset_changes=0
do_maketest=1
;;
"nomod" | "")
bundle_type=""
;;
"fd")
do_reset_changes=0
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=windows-aarch64-server-fastdebug
;;
esac
if [ -z "${INC_BUILD:-}" ]; then
do_configure || do_exit $?
if [ $do_maketest -eq 1 ]; then
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
else
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
fi
else
if [ $do_maketest -eq 1 ]; then
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
else
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
fi
fi
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk
JSDK_MODS_DIR=$IMAGES_DIR/jmods
JBRSDK_BUNDLE=jbrsdk
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
update_jsdk_mods "$BUILD_JDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
jbr_name_postfix="_${bundle_type}"
else
jbr_name_postfix=""
fi
# create runtime image bundle
modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
modules+=",jdk.crypto.mscapi"
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
# create sdk image bundle
modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g) || do_exit $?
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
fi
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
do_exit 0

View File

@@ -52,7 +52,7 @@ function create_image_bundle {
fastdebug_infix=''
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x64-${fastdebug_infix:-}b${build_number%%.*}
echo Running jlink ...
${JSDK}/bin/jlink \

View File

@@ -47,7 +47,7 @@ function create_image_bundle {
fastdebug_infix=''
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x86-${fastdebug_infix:-}b${build_number%%.*}
echo Running jlink ...
${JSDK}/bin/jlink \

View File

@@ -1,56 +0,0 @@
#!/bin/bash
set -euo pipefail
set -x
# The following parameters must be specified:
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to be built;possible values:
# <empty> or nomod - the release bundles without any additional modules (jcef)
# jcef - the release bundles with jcef
# fd - the fastdebug bundles which also include the jcef module
#
# This script packs test-image along with JDK images when bundle_type is set to "jcef".
# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
#
source jb/project/tools/common/scripts/common.sh
[ "$bundle_type" == "jcef" ] && do_maketest=1
function pack_jbr {
__bundle_name=$1
__arch_name=$2
fastdebug_infix=''
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
echo Creating $JBR.tar.gz ...
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
}
[ "$bundle_type" == "nomod" ] && bundle_type=""
JBRSDK_BUNDLE=jbrsdk
RELEASE_NAME=windows-aarch64-server-release
IMAGES_DIR=build/$RELEASE_NAME/images
BASE_DIR=.
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
jbr_name_postfix="_${bundle_type}"
else
jbr_name_postfix=""
fi
pack_jbr jbr${jbr_name_postfix} jbr
pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
if [ $do_maketest -eq 1 ]; then
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-aarch64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
fi

View File

@@ -26,7 +26,7 @@ function pack_jbr {
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x64-${fastdebug_infix:-}b${build_number%%.*}
echo Creating $JBR.tar.gz ...
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir

View File

@@ -22,7 +22,7 @@ function pack_jbr {
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x86-${fastdebug_infix:-}b${build_number%%.*}
echo Creating $JBR.tar.gz ...
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir

View File

@@ -229,19 +229,15 @@ else
endif
ifeq ($(ENABLE_REPRODUCIBLE_BUILD), true)
# If boot JDK's jar supported --date, jrt-fs.jar would've been built with
# that option already.
ifneq ($(BOOT_JDK_JAR_SUPPORTS_DATE), true)
ifeq ($(MODULE), java.base)
JAR_FILE_TO_FIX := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar
$(eval $(call SetupExecute, fixup_jrtfs_jar, \
WARN := Fixing timestamps in modules_libs/java.base/jrt-fs.jar, \
DEPS := $(JAR_FILE_TO_FIX) $(JDK_OUTPUTDIR)/bin/jar, \
OUTPUT_DIR := $(JMODS_SUPPORT_DIR), \
COMMAND := $(BUILD_JAR) --date $(SOURCE_DATE_ISO_8601) --update --file $(JAR_FILE_TO_FIX) @$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/_the.jrt-fs.jar_contents, \
))
DEPS += $(fixup_jrtfs_jar_TARGET)
endif
ifeq ($(MODULE), java.base)
JAR_FILE_TO_FIX := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar
$(eval $(call SetupExecute, fixup_jrtfs_jar, \
WARN := Fixing timestamps in modules_libs/java.base/jrt-fs.jar, \
DEPS := $(JAR_FILE_TO_FIX) $(JDK_OUTPUTDIR)/bin/jar, \
OUTPUT_DIR := $(JMODS_SUPPORT_DIR), \
COMMAND := $(FIXPATH) $(JDK_OUTPUTDIR)/bin/jar --date $(SOURCE_DATE_ISO_8601) --update --file $(JAR_FILE_TO_FIX) @$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/_the.jrt-fs.jar_contents, \
))
DEPS += $(fixup_jrtfs_jar_TARGET)
endif
endif

View File

@@ -116,18 +116,6 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
CFLAGS_DEBUG_SYMBOLS="-g"
ASFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
# Check if compiler supports -fdebug-prefix-map. If so, use that to make
# the debug symbol paths resolve to paths relative to the workspace root.
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
DEBUG_PREFIX_CFLAGS="-fdebug-prefix-map=${workspace_root_trailing_slash}="
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_PREFIX_CFLAGS}],
IF_FALSE: [
DEBUG_PREFIX_CFLAGS=
]
)
fi
CFLAGS_DEBUG_SYMBOLS="-g"
ASFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then

View File

@@ -359,9 +359,9 @@ define SetupCompileNativeFileBody
$1_FLAGS := $(BASIC_ASFLAGS) $$($1_BASE_ASFLAGS)
$1_COMPILER := $(AS)
# gcc or clang assembly files must contain an appropriate relative .file
# gcc assembly files must contain an appropriate relative .file
# path for reproducible builds.
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
ifeq ($(TOOLCHAIN_TYPE), gcc)
# If no absolute paths allowed, work out relative source file path
# for assembly .file substitution, otherwise use full file path
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT), false)
@@ -403,9 +403,8 @@ define SetupCompileNativeFileBody
$1_OBJ_DEPS := $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
$$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE)
$1_COMPILE_OPTIONS := $$($1_FLAGS) $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)
# For reproducible builds with gcc and clang ensure random symbol generation is
# seeded deterministically
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
# For reproducible builds with gcc ensure random symbol generation is seeded deterministically
ifeq ($(TOOLCHAIN_TYPE), gcc)
ifeq ($$(ENABLE_REPRODUCIBLE_BUILD), true)
$1_COMPILE_OPTIONS += -frandom-seed="$$($1_FILENAME)"
endif

View File

@@ -198,58 +198,58 @@ dialoginput.bolditalic.korean=Malgun Gothic
# Search Sequences
sequence.allfonts=alphabetic/default,dingbats,symbol,symbols
sequence.allfonts=alphabetic/default
sequence.serif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
sequence.sansserif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,chinese-ms936-extb,symbols
sequence.dialog.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
sequence.dialoginput.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
sequence.serif.GBK=alphabetic,chinese-ms936,chinese-ms936-extb
sequence.sansserif.GBK=alphabetic,chinese-ms936,chinese-ms936-extb
sequence.monospaced.GBK=chinese-ms936,alphabetic,chinese-ms936-extb
sequence.dialog.GBK=alphabetic,chinese-ms936,chinese-ms936-extb
sequence.dialoginput.GBK=alphabetic,chinese-ms936,chinese-ms936-extb
sequence.serif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
sequence.sansserif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
sequence.monospaced.GB18030=chinese-gb18030,alphabetic,dingbats,symbol,chinese-gb18030-extb,symbols
sequence.dialog.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
sequence.dialoginput.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
sequence.serif.GB18030=alphabetic,chinese-gb18030,chinese-gb18030-extb
sequence.sansserif.GB18030=alphabetic,chinese-gb18030,chinese-gb18030-extb
sequence.monospaced.GB18030=chinese-gb18030,alphabetic,chinese-gb18030-extb
sequence.dialog.GB18030=alphabetic,chinese-gb18030,chinese-gb18030-extb
sequence.dialoginput.GB18030=alphabetic,chinese-gb18030,chinese-gb18030-extb
sequence.serif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
sequence.sansserif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
sequence.monospaced.x-windows-950=chinese-ms950,alphabetic,dingbats,symbol,chinese-ms950-extb,symbols
sequence.dialog.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
sequence.dialoginput.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
sequence.serif.x-windows-950=alphabetic,chinese-ms950,chinese-ms950-extb
sequence.sansserif.x-windows-950=alphabetic,chinese-ms950,chinese-ms950-extb
sequence.monospaced.x-windows-950=chinese-ms950,alphabetic,chinese-ms950-extb
sequence.dialog.x-windows-950=alphabetic,chinese-ms950,chinese-ms950-extb
sequence.dialoginput.x-windows-950=alphabetic,chinese-ms950,chinese-ms950-extb
sequence.serif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.sansserif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.monospaced.x-MS950-HKSCS=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.dialog.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.dialoginput.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.serif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.sansserif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.monospaced.x-MS950-HKSCS=chinese-ms950,alphabetic,chinese-hkscs,chinese-ms950-extb
sequence.dialog.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.dialoginput.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.serif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.sansserif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.monospaced.x-MS950-HKSCS-XP=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
sequence.serif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.sansserif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.monospaced.x-MS950-HKSCS-XP=chinese-ms950,alphabetic,chinese-hkscs,chinese-ms950-extb
sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,chinese-ms950-extb
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,dingbats,symbol,symbols
sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari,dingbats,symbol,symbols
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari
sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari
sequence.allfonts.windows-1255=hebrew,alphabetic/1252,dingbats,symbol,symbols
sequence.allfonts.windows-1255=hebrew,alphabetic/1252
sequence.serif.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
sequence.sansserif.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
sequence.monospaced.windows-31j=japanese,alphabetic,dingbats,symbol,symbols
sequence.dialog.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
sequence.dialoginput.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
sequence.serif.windows-31j=alphabetic,japanese
sequence.sansserif.windows-31j=alphabetic,japanese
sequence.monospaced.windows-31j=japanese,alphabetic
sequence.dialog.windows-31j=alphabetic,japanese
sequence.dialoginput.windows-31j=alphabetic,japanese
sequence.serif.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
sequence.sansserif.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
sequence.monospaced.x-windows-949=korean,alphabetic,dingbats,symbol,symbols
sequence.dialog.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
sequence.dialoginput.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
sequence.serif.x-windows-949=alphabetic,korean
sequence.sansserif.x-windows-949=alphabetic,korean
sequence.monospaced.x-windows-949=korean,alphabetic
sequence.dialog.x-windows-949=alphabetic,korean
sequence.dialoginput.x-windows-949=alphabetic,korean
sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol,symbols
sequence.allfonts.x-windows-874=alphabetic,thai
sequence.fallback=emoji,\
sequence.fallback=emoji,symbols,dingbats,symbol,\
chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,\
georgian,devanagari,bengali,gujarati,gurmukhi,kannada,\
@@ -261,25 +261,6 @@ sequence.fallback=emoji,\
exclusion.alphabetic=0700-1cff,1d80-1e9f,1f00-2017,2020-20ab,20ad-20b8,20bb-20bc,20be-24ff,2501-2501,2503-250b,250d-250f,2511-2513,2515-2517,2519-251b,251d-2523,2525-252b,252d-2533,2535-253b,253d-254f,256d-f8ff
exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be
exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac
exclusion.symbols=000d-0022,0024-0029,002b-002f,003a-00a8,00aa-00ad,00af-02dc,2002-2003,\
2005-2005,200d-200d,2013-2014,2018-201a,201c-201e,2020-2022,2026-2026,\
2030-2030,2039-203a,2044-2044,20ac-20ac,20e3-20e3,2126-2126,2190-2193,\
219a-21a8,21ab-21ff,2206-2206,220f-220f,2211-2212,2219-221a,221e-221e,\
222b-222b,2248-2248,2260-2260,231a-231b,23e9-23ec,23f0-23f0,23f3-23f3,\
24b6-24c1,24c3-24cf,25a0-25a9,25ac-25b5,25b7-25bf,25c1-25fa,25fd-25ff,\
260f-2610,2612-2612,2614-2615,263b-263b,263f-263f,2641-2641,2643-2653,\
2672-267a,267c-267d,267f-267f,2693-2693,26a1-26a6,26a8-26ab,26bd-26be,\
26c4-26c5,26c7-26c7,26ce-26ce,26d4-26d4,26dd-26dd,26e3-26e3,26ea-26ea,\
26f2-26f3,26f5-26f5,26fa-26fa,26fd-26fd,2701-2701,2703-2705,270a-270b,\
270e-270e,2710-2710,2713-2713,2715-2715,2717-2718,2728-2728,2731-2732,\
2735-2743,2745-2746,2748-274c,274e-274e,2753-2755,2757-2757,2795-2797,\
27b0-27b0,27bf-27bf,2936-2937,2b12-2b1c,2b50-2b52,2b55-2b55,3244-3247,\
01f000-01f02b,01f0cf-01f0cf,01f172-01f17d,01f180-01f1ff,01f201-01f201,\
01f210-01f236,01f238-01f23a,01f250-01f320,01f32d-01f335,01f337-01f37c,\
01f37e-01f393,01f3a0-01f3ca,01f3cf-01f3d3,01f3e0-01f3f0,01f3f4-01f3f4,\
01f3f8-01f43e,01f440-01f440,01f442-01f4fc,01f4ff-01f53d,01f54b-01f567,\
01f57a-01f57a,01f595-01f596,01f5a4-01f5a4,01f5fb-01f64f,01f680-01f6c5,\
01f6cc-01f6cc,01f6d0-01f6d2,01f6eb-01f6ec,01f6f4-01f6f6,01f910-01f93a,01f93c-01f9c0
# Monospaced to Proportional width variant mapping
# (Experimental private syntax)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -29,16 +29,10 @@ include LibCommon.gmk
ifeq ($(call isTargetOs, windows), true)
CFLAGS_LIBDT_SHMEM := $(CFLAGS_JDKLIB)
ifneq ($(HOTSPOT_BUILD_TIME), )
CFLAGS_LIBDT_SHMEM += -DSHMEM_BUILD_TIME='"$(HOTSPOT_BUILD_TIME)"'
endif
$(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
NAME := dt_shmem, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_LIBDT_SHMEM), \
CFLAGS := $(CFLAGS_JDKLIB), \
EXTRA_HEADER_DIRS := \
jdk.jdwp.agent:include \
jdk.jdwp.agent:libjdwp/export, \

View File

@@ -147,13 +147,14 @@ function import_path() {
if [[ "$path" != "" ]]; then
# Store current unix path
unixpath="$path"
# If $unixpath does not exist, add .exe (needed on WSL)
if [[ ! -e "$unixpath" ]]; then
unixpath="$unixpath.exe"
fi
# Now turn it into a windows path
winpath="$($PATHTOOL -w "$unixpath" 2>/dev/null)"
if [[ $? -eq 0 && -e "$unixpath" ]]; then
winpath="$($PATHTOOL -w "$path" 2>/dev/null)"
# If it fails, try again with an added .exe (needed on WSL)
if [[ $? -ne 0 ]]; then
unixpath="$unixpath.exe"
winpath="$($PATHTOOL -w "$unixpath" 2>/dev/null)"
fi
if [[ $? -eq 0 ]]; then
if [[ ! "$winpath" =~ ^"$ENVROOT"\\.*$ ]] ; then
# If it is not in envroot, it's a generic windows path
if [[ ! $winpath =~ ^[-_.:\\a-zA-Z0-9]*$ ]] ; then

View File

@@ -129,17 +129,8 @@ static inline uint32_t uimm(uint32_t val, int hi, int lo)
uint64_t replicate(uint64_t bits, int nbits, int count)
{
assert(count > 0, "must be");
assert(nbits > 0, "must be");
assert(count * nbits <= 64, "must be");
// Special case nbits == 64 since the shift below with that nbits value
// would result in undefined behavior.
if (nbits == 64) {
return bits;
}
uint64_t result = 0;
// nbits may be 64 in which case we want mask to be -1
uint64_t mask = ones(nbits);
for (int i = 0; i < count ; i++) {
result <<= nbits;

View File

@@ -26,7 +26,7 @@ import java.lang.invoke.MethodHandles;
public class JBRApiModule {
static {
JBRApi.registerModule(MethodHandles.lookup(), JBRApiModule.class.getModule()::addExports)
.service("com.jetbrains.JBR$ServiceApi")
.withStatic("getService", "getService", "com.jetbrains.internal.JBRApi");
.service("com.jetbrains.JBR$ServiceApi", null)
.withStatic("getService", "com.jetbrains.internal.JBRApi");
}
}

View File

@@ -16,7 +16,6 @@
package com.jetbrains.internal;
import java.io.Serial;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.util.*;
@@ -88,7 +87,6 @@ import static java.lang.invoke.MethodHandles.Lookup;
* user to directly create proxy object.
*/
public class JBRApi {
static final boolean VERBOSE = Boolean.getBoolean("jetbrains.api.verbose");
private static final Map<String, RegisteredProxyInfo> registeredProxyInfoByInterfaceName = new HashMap<>();
private static final Map<String, RegisteredProxyInfo> registeredProxyInfoByTargetName = new HashMap<>();
@@ -117,9 +115,6 @@ public class JBRApi {
knownServices = Set.of();
knownProxies = Set.of();
}
if (VERBOSE) {
System.out.println("JBR API init\nKNOWN_SERVICES = " + knownServices + "\nKNOWN_PROXIES = " + knownProxies);
}
}
/**
@@ -141,12 +136,7 @@ public class JBRApi {
RegisteredProxyInfo info = registeredProxyInfoByInterfaceName.get(i.getName());
if (info == null) return null;
ProxyInfo resolved = ProxyInfo.resolve(info);
if (resolved == null) {
if (VERBOSE) {
System.err.println("Couldn't resolve proxy info: " + i.getName());
}
return null;
} else return new Proxy<>(resolved);
return resolved != null ? new Proxy<>(resolved) : null;
});
}
@@ -169,17 +159,16 @@ public class JBRApi {
RegisteredProxyInfo info = registeredProxyInfoByTargetName.get(targetName);
if (info == null) return null;
try {
return Class.forName(info.interfaceName(), true,
(info.type().isPublicApi() ? outerLookup : info.apiModule()).lookupClass().getClassLoader());
} catch (ClassNotFoundException e) {
if (VERBOSE) e.printStackTrace();
return (info.type().isPublicApi() ? outerLookup : info.apiModule())
.findClass(info.interfaceName());
} catch (ClassNotFoundException | IllegalAccessException e) {
return null;
}
}
public static InternalServiceBuilder internalServiceBuilder(Lookup interFace, String... targets) {
public static InternalServiceBuilder internalServiceBuilder(Lookup interFace, String target) {
return new InternalServiceBuilder(new RegisteredProxyInfo(
interFace, interFace.lookupClass().getName(), targets, ProxyInfo.Type.INTERNAL_SERVICE, new ArrayList<>()));
interFace, interFace.lookupClass().getName(), target, ProxyInfo.Type.INTERNAL_SERVICE, new ArrayList<>()));
}
public static class InternalServiceBuilder {
@@ -190,9 +179,13 @@ public class JBRApi {
this.info = info;
}
public InternalServiceBuilder withStatic(String interfaceMethodName, String methodName, String... classes) {
public InternalServiceBuilder withStatic(String methodName, String clazz) {
return withStatic(methodName, clazz, methodName);
}
public InternalServiceBuilder withStatic(String interfaceMethodName, String clazz, String methodName) {
info.staticMethods().add(
new RegisteredProxyInfo.StaticMethodMapping(interfaceMethodName, methodName, classes));
new RegisteredProxyInfo.StaticMethodMapping(interfaceMethodName, clazz, methodName));
return this;
}
@@ -230,24 +223,22 @@ public class JBRApi {
this.lookup = lookup;
}
private ModuleRegistry addProxy(ProxyInfo.Type type, String interfaceName, String... targets) {
lastProxy = new RegisteredProxyInfo(lookup, interfaceName, targets, type, new ArrayList<>());
private ModuleRegistry addProxy(String interfaceName, String target, ProxyInfo.Type type) {
lastProxy = new RegisteredProxyInfo(lookup, interfaceName, target, type, new ArrayList<>());
registeredProxyInfoByInterfaceName.put(interfaceName, lastProxy);
for (String target : targets) {
if (target != null) {
registeredProxyInfoByTargetName.put(target, lastProxy);
}
if (targets.length == 1) {
validate2WayMapping(lastProxy, registeredProxyInfoByInterfaceName.get(targets[0]));
validate2WayMapping(lastProxy, registeredProxyInfoByInterfaceName.get(target));
validate2WayMapping(lastProxy, registeredProxyInfoByTargetName.get(interfaceName));
}
return this;
}
private static void validate2WayMapping(RegisteredProxyInfo p, RegisteredProxyInfo reverse) {
if (reverse != null &&
(!p.interfaceName().equals(reverse.targets()[0]) || !p.targets()[0].equals(reverse.interfaceName()))) {
(!p.interfaceName().equals(reverse.target()) || !p.target().equals(reverse.interfaceName()))) {
throw new IllegalArgumentException("Invalid 2-way proxy mapping: " +
p.interfaceName() + " -> " + p.targets()[0] + " & " +
reverse.interfaceName() + " -> " + reverse.targets()[0]);
p.interfaceName() + " -> " + p.target() + " & " +
reverse.interfaceName() + " -> " + reverse.target());
}
}
@@ -258,12 +249,12 @@ public class JBRApi {
* it's converted to corresponding {@code interFace} type by creating a proxy object
* that implements {@code interFace} and delegates method calls to {@code target}.
* @param interFace interface name in {@link com.jetbrains.JBR jetbrains.api} module.
* @param targets corresponding class/interface names in current JBR module, first found will be used. This must not be empty.
* @param target corresponding class/interface name in current JBR module.
* @apiNote class name example: {@code pac.ka.ge.Outer$Inner}
*/
public ModuleRegistry proxy(String interFace, String... targets) {
if (targets.length == 0) throw new IllegalArgumentException("Proxy must have at least one target");
return addProxy(ProxyInfo.Type.PROXY, interFace, targets);
public ModuleRegistry proxy(String interFace, String target) {
Objects.requireNonNull(target);
return addProxy(interFace, target, ProxyInfo.Type.PROXY);
}
/**
@@ -271,11 +262,11 @@ public class JBRApi {
* <p>
* Service is a singleton, which may be accessed by client using {@link com.jetbrains.JBR} class.
* @param interFace interface name in {@link com.jetbrains.JBR jetbrains.api} module.
* @param targets corresponding implementation class names in current JBR module, first found will be used.
* @param target corresponding implementation class name in current JBR module, or null.
* @apiNote class name example: {@code pac.ka.ge.Outer$Inner}
*/
public ModuleRegistry service(String interFace, String... targets) {
return addProxy(ProxyInfo.Type.SERVICE, interFace, targets);
public ModuleRegistry service(String interFace, String target) {
return addProxy(interFace, target, ProxyInfo.Type.SERVICE);
}
/**
@@ -291,7 +282,7 @@ public class JBRApi {
*/
public ModuleRegistry clientProxy(String interFace, String target) {
Objects.requireNonNull(target);
return addProxy(ProxyInfo.Type.CLIENT_PROXY, interFace, target);
return addProxy(interFace, target, ProxyInfo.Type.CLIENT_PROXY);
}
/**
@@ -312,24 +303,20 @@ public class JBRApi {
}
/**
* Delegate "{@code interfaceMethodName}" method calls to first found static "{@code methodName}" in "{@code classes}".
* Delegate interface "{@code methodName}" calls to static "{@code methodName}" in "{@code clazz}".
* @see #withStatic(String, String, String)
*/
public ModuleRegistry withStatic(String interfaceMethodName, String methodName, String... classes) {
public ModuleRegistry withStatic(String methodName, String clazz) {
return withStatic(methodName, clazz, methodName);
}
/**
* Delegate "{@code interfaceMethodName}" method calls to static "{@code methodName}" in "{@code clazz}".
*/
public ModuleRegistry withStatic(String interfaceMethodName, String clazz, String methodName) {
lastProxy.staticMethods().add(
new RegisteredProxyInfo.StaticMethodMapping(interfaceMethodName, methodName, classes));
new RegisteredProxyInfo.StaticMethodMapping(interfaceMethodName, clazz, methodName));
return this;
}
}
/**
* Thrown by service implementations indicating that the service is not available for some reason
*/
public static class ServiceNotAvailableException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
public ServiceNotAvailableException() { super(); }
public ServiceNotAvailableException(String message) { super(message); }
public ServiceNotAvailableException(String message, Throwable cause) { super(message, cause); }
public ServiceNotAvailableException(Throwable cause) { super(cause); }
}
}

View File

@@ -58,7 +58,6 @@ class Proxy<INTERFACE> {
private volatile MethodHandle constructor;
private volatile MethodHandle targetExtractor;
private volatile boolean instanceInitialized;
private volatile INTERFACE instance;
Proxy(ProxyInfo info) {
@@ -195,22 +194,15 @@ class Proxy<INTERFACE> {
*/
@SuppressWarnings("unchecked")
INTERFACE getInstance() {
if (instanceInitialized) return instance;
if (instance != null) return instance;
if (info.type != ProxyInfo.Type.SERVICE) return null;
synchronized (this) {
if (instance == null) {
initDependencyGraph();
try {
instance = (INTERFACE) getConstructor().invoke();
} catch (JBRApi.ServiceNotAvailableException e) {
if (JBRApi.VERBOSE) {
System.err.println("Service not available: " + info.interFace.getName());
e.printStackTrace();
}
} catch (Throwable e) {
throw new RuntimeException(e);
} finally {
instanceInitialized = true;
}
}
return instance;

View File

@@ -78,7 +78,7 @@ class ProxyDependencyManager {
* Collect dependencies for given class and store them into cache.
*/
private static void step(Node parent, Class<?> clazz) {
if (!clazz.getPackageName().startsWith("com.jetbrains") && !JBRApi.isKnownProxyInterface(clazz)) return;
if (!clazz.getPackageName().startsWith("com.jetbrains")) return;
if (parent != null && parent.findAndMergeCycle(clazz) != null) {
return;
}
@@ -101,9 +101,6 @@ class ProxyDependencyManager {
// Otherwise cache will contain incomplete data
for (Class<?> c : node.cycle.members) {
cache.put(c, node.cycle.dependencies);
if (JBRApi.VERBOSE) {
System.out.println("Found dependencies for " + c.getName() + ": " + node.cycle.dependencies);
}
}
}
}

View File

@@ -17,7 +17,6 @@
package com.jetbrains.internal;
import jdk.internal.org.objectweb.asm.*;
import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
@@ -55,15 +54,13 @@ class ProxyGenerator {
/**
* Print warnings about usage of deprecated interfaces and methods to {@link System#err}.
*/
private static final boolean LOG_DEPRECATED = System.getProperty("jetbrains.api.logDeprecated", String.valueOf(JBRApi.VERBOSE)).equalsIgnoreCase("true");
private static final boolean VERIFY_BYTECODE = Boolean.getBoolean("jetbrains.api.verifyBytecode");
private static final boolean LOG_DEPRECATED = System.getProperty("jetbrains.api.logDeprecated", "true").equalsIgnoreCase("true");
private static final AtomicInteger nameCounter = new AtomicInteger();
private final ProxyInfo info;
private final boolean generateBridge;
private final String proxyName, bridgeName;
private final ClassWriter originalProxyWriter, originalBridgeWriter;
private final ClassVisitor proxyWriter, bridgeWriter;
private final List<Supplier<MethodHandle>> handles = new ArrayList<>();
private final List<Supplier<Class<?>>> classReferences = new ArrayList<>();
@@ -80,9 +77,6 @@ class ProxyGenerator {
* classes until {@link #defineClasses()} is called.
*/
ProxyGenerator(ProxyInfo info) {
if (JBRApi.VERBOSE) {
System.out.println("Generating proxy " + info.interFace.getName());
}
this.info = info;
generateBridge = info.type.isPublicApi();
int nameId = nameCounter.getAndIncrement();
@@ -90,25 +84,26 @@ class ProxyGenerator {
bridgeName = generateBridge ? info.apiModule.lookupClass().getPackageName().replace('.', '/') + "/" +
info.interFace.getSimpleName() + "$$JBRApiBridge$" + nameId : null;
originalProxyWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
proxyWriter = VERIFY_BYTECODE ? new CheckClassAdapter(originalProxyWriter, true) : originalProxyWriter;
originalBridgeWriter = generateBridge ? new ClassWriter(ClassWriter.COMPUTE_FRAMES) : null;
if (generateBridge) {
bridgeWriter = VERIFY_BYTECODE ? new CheckClassAdapter(originalBridgeWriter, true) : originalBridgeWriter;
} else bridgeWriter = new ClassVisitor(Opcodes.ASM8) { // Empty visitor
@Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
return new MethodVisitor(api) {};
class ClassWriter extends jdk.internal.org.objectweb.asm.ClassWriter {
ClassWriter() { super(ClassWriter.COMPUTE_FRAMES); }
ClassVisitor createEmptyVisitor() {
return new ClassVisitor(api) {
@Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
return new MethodVisitor(api) {};
}
};
}
};
}
ClassWriter proxyClassWriter = new ClassWriter();
proxyWriter = proxyClassWriter;
bridgeWriter = generateBridge ? new ClassWriter() : proxyClassWriter.createEmptyVisitor();
proxyWriter.visit(CLASSFILE_VERSION, ACC_SUPER | ACC_FINAL | ACC_SYNTHETIC, proxyName, null,
"java/lang/Object", new String[] {Type.getInternalName(info.interFace)});
bridgeWriter.visit(CLASSFILE_VERSION, ACC_SUPER | ACC_FINAL | ACC_SYNTHETIC | ACC_PUBLIC, bridgeName, null,
"java/lang/Object", null);
generateConstructor();
generateMethods();
proxyWriter.visitEnd();
bridgeWriter.visitEnd();
}
boolean areAllMethodsImplemented() {
@@ -192,9 +187,9 @@ class ProxyGenerator {
void defineClasses() {
try {
Lookup bridge = !generateBridge ? null : MethodHandles.privateLookupIn(
info.apiModule.defineClass(originalBridgeWriter.toByteArray()), info.apiModule);
info.apiModule.defineClass(((ClassWriter) bridgeWriter).toByteArray()), info.apiModule);
generatedProxy = info.interFaceLookup.defineHiddenClass(
originalProxyWriter.toByteArray(), true, Lookup.ClassOption.STRONG, Lookup.ClassOption.NESTMATE);
((ClassWriter) proxyWriter).toByteArray(), true, Lookup.ClassOption.STRONG, Lookup.ClassOption.NESTMATE);
generatedHandlesHolder = generateBridge ? bridge : generatedProxy;
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
@@ -210,7 +205,6 @@ class ProxyGenerator {
if (LOG_DEPRECATED && info.interFace.isAnnotationPresent(Deprecated.class)) {
logDeprecated(p, "Warning: using deprecated JBR API interface " + info.interFace.getName());
}
p.visitCode();
p.visitVarInsn(ALOAD, 0);
if (info.target != null) {
p.visitInsn(DUP);
@@ -219,8 +213,7 @@ class ProxyGenerator {
}
p.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
p.visitInsn(RETURN);
p.visitMaxs(0, 0);
p.visitEnd();
p.visitMaxs(-1, -1);
}
private void generateMethods() {
@@ -257,11 +250,6 @@ class ProxyGenerator {
if (e1 != null) exceptions.add(e1);
if (e2 != null) exceptions.add(e2);
generateUnsupportedMethod(proxyWriter, method);
if (JBRApi.VERBOSE) {
System.err.println("Couldn't generate method " + method.getName());
if (e1 != null) e1.printStackTrace();
if (e2 != null) e2.printStackTrace();
}
allMethodsImplemented = false;
}
}
@@ -304,8 +292,6 @@ class ProxyGenerator {
logDeprecated(p, "Warning: using deprecated JBR API method " +
interfaceMethod.getDeclaringClass().getName() + "#" + interfaceMethod.getName());
}
p.visitCode();
b.visitCode();
MethodVisitor bp = generateBridge ? b : p;
bp.visitFieldInsn(GETSTATIC, bridgeOrProxyName, handleName, MH_DESCRIPTOR);
if (passInstance) {
@@ -329,10 +315,8 @@ class ProxyGenerator {
int returnOpcode = getReturnOpcode(mapping.returnMapping().to());
p.visitInsn(returnOpcode);
b.visitInsn(returnOpcode);
p.visitMaxs(0, 0);
b.visitMaxs(0, 0);
p.visitEnd();
b.visitEnd();
p.visitMaxs(-1, -1);
b.visitMaxs(-1, -1);
}
private String addHandle(ClassVisitor classWriter, Supplier<MethodHandle> handleSupplier) {

View File

@@ -19,8 +19,6 @@ package com.jetbrains.internal;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Stream;
import static java.lang.invoke.MethodHandles.Lookup;
@@ -42,14 +40,12 @@ class ProxyInfo {
type = i.type();
interFaceLookup = lookup(getInterfaceLookup(), i.interfaceName());
interFace = interFaceLookup == null ? null : interFaceLookup.lookupClass();
target = Stream.of(i.targets())
.map(t -> lookup(getTargetLookup(), t))
.filter(Objects::nonNull).findFirst().orElse(null);
target = i.target() == null ? null : lookup(getTargetLookup(), i.target());
for (RegisteredProxyInfo.StaticMethodMapping m : i.staticMethods()) {
Stream.of(m.classes())
.map(t -> lookup(getTargetLookup(), t))
.filter(Objects::nonNull).findFirst()
.ifPresent(l -> staticMethods.put(m.interfaceMethodName(), new StaticMethodMapping(l, m.methodName())));
Lookup l = lookup(getTargetLookup(), m.clazz());
if (l != null) {
staticMethods.put(m.interfaceMethodName(), new StaticMethodMapping(l, m.methodName()));
}
}
}

View File

@@ -25,9 +25,9 @@ import java.util.List;
*/
record RegisteredProxyInfo(MethodHandles.Lookup apiModule,
String interfaceName,
String[] targets,
String target,
ProxyInfo.Type type,
List<StaticMethodMapping> staticMethods) {
record StaticMethodMapping(String interfaceMethodName, String methodName, String[] classes) {}
record StaticMethodMapping(String interfaceMethodName, String clazz, String methodName) {}
}

View File

@@ -74,12 +74,11 @@ public final class CGraphicsDevice extends GraphicsDevice
public CGraphicsDevice(final int displayID) {
this.displayID = displayID;
this.initialMode = getDisplayMode();
StringBuilder errorMessage = new StringBuilder();
if (MacOSFlags.isMetalEnabled()) {
// Try to create MTLGraphicsConfig, if it fails,
// try to create CGLGraphicsConfig as a fallback
this.config = MTLGraphicsConfig.getConfig(this, displayID, errorMessage);
this.config = MTLGraphicsConfig.getConfig(this, displayID);
if (this.config != null) {
metalPipelineEnabled = true;
@@ -89,7 +88,7 @@ public final class CGraphicsDevice extends GraphicsDevice
// Should not fall back to OpenGL if Metal has been used before
// (it could cause CCE during replace of surface data)
throw new InternalError("Error - unable to initialize Metal" +
" after recreation of graphics device." + errorMessage);
" after recreation of graphics device.");
}
// Try falling back to OpenGL pipeline
@@ -120,7 +119,7 @@ public final class CGraphicsDevice extends GraphicsDevice
" rendering pipeline");
}
this.config = MTLGraphicsConfig.getConfig(this, displayID, errorMessage);
this.config = MTLGraphicsConfig.getConfig(this, displayID);
if (this.config != null) {
metalPipelineEnabled = true;
@@ -132,7 +131,7 @@ public final class CGraphicsDevice extends GraphicsDevice
// This indicates fallback to other rendering pipeline also failed.
// Should never reach here
throw new InternalError("Error - unable to initialize any" +
" rendering pipeline." + errorMessage);
" rendering pipeline.");
}
if (metalPipelineEnabled && MacOSFlags.isMetalVerbose()) {

View File

@@ -32,36 +32,22 @@ public final class CCompositeGlyphMapper extends CompositeGlyphMapper {
super(compFont);
}
@Override
public int charToVariationGlyph(int unicode, int variationSelector) {
if (variationSelector == 0) return charToGlyph(unicode);
else {
int glyph = convertToGlyph(unicode, variationSelector);
if (glyph == missingGlyph) glyph = charToGlyph(unicode);
return glyph;
}
}
@Override
protected int convertToGlyph(int unicode) {
int glyph = convertToGlyph(unicode, 0);
setCachedGlyphCode(unicode, glyph);
return glyph;
}
@Override
protected int convertToGlyph(int unicode, int variationSelector) {
CCompositeFont compositeFont = (CCompositeFont) font;
CFont mainFont = (CFont) font.getSlotFont(0);
String[] fallbackFontInfo = new String[2];
int glyphCode = nativeCodePointToGlyph(mainFont.getNativeFontPtr(), unicode, variationSelector, fallbackFontInfo);
int glyphCode = nativeCodePointToGlyph(mainFont.getNativeFontPtr(), unicode, fallbackFontInfo);
if (glyphCode == missingGlyph) {
setCachedGlyphCode(unicode, missingGlyph);
return missingGlyph;
}
String fallbackFontName = fallbackFontInfo[0];
String fallbackFontFamilyName = fallbackFontInfo[1];
if (fallbackFontName == null || fallbackFontFamilyName == null) {
return compositeGlyphCode(0, glyphCode);
int result = compositeGlyphCode(0, glyphCode);
setCachedGlyphCode(unicode, result);
return result;
}
int slot = compositeFont.findSlot(fallbackFontName);
@@ -82,10 +68,12 @@ public final class CCompositeGlyphMapper extends CompositeGlyphMapper {
slot = compositeFont.addSlot((CFont) fallbackFont);
}
return compositeGlyphCode(slot, glyphCode);
int result = compositeGlyphCode(slot, glyphCode);
setCachedGlyphCode(unicode, result);
return result;
}
// This invokes native font fallback mechanism, returning information about font (its Postscript and family names)
// able to display a given character, and corresponding glyph code
private static native int nativeCodePointToGlyph(long nativeFontPtr, int codePoint, int variationSelector, String[] result);
private static native int nativeCodePointToGlyph(long nativeFontPtr, int codePoint, String[] result);
}

View File

@@ -67,12 +67,6 @@ public final class CStrike extends PhysicalStrike {
double x,
double y);
private static native void getNativeGlyphRenderData(long nativeStrikePtr,
int glyphCode,
double x,
double y,
GlyphRenderData result);
private static native void getNativeGlyphOutlineBounds(long nativeStrikePtr,
int glyphCode,
float [] rectData);
@@ -236,12 +230,6 @@ public final class CStrike extends PhysicalStrike {
throw new Error("not implemented yet");
}
GlyphRenderData getGlyphRenderData(int glyphCode, float x, float y) {
GlyphRenderData result = new GlyphRenderData();
getNativeGlyphRenderData(getNativeStrikePtr(), glyphCode, x, y, result);
return result;
}
// called from the Sun2D renderer
long getGlyphImagePtr(int glyphCode) {
synchronized (glyphInfoCache) {

View File

@@ -83,8 +83,4 @@ public class NativeStrike extends PhysicalStrike {
return null;
}
GlyphRenderData getGlyphRenderData(int glyphCode, float x, float y) {
return null;
}
}

View File

@@ -25,7 +25,6 @@
package sun.java2d.metal;
import java.lang.annotation.Native;
import sun.awt.CGraphicsConfig;
import sun.awt.CGraphicsDevice;
import sun.awt.image.OffScreenImage;
@@ -73,11 +72,6 @@ import static sun.java2d.metal.MTLContext.MTLContextCaps.CAPS_EXT_BIOP_SHADER;
public final class MTLGraphicsConfig extends CGraphicsConfig
implements AccelGraphicsConfig, SurfaceManager.ProxiedGraphicsConfig
{
@Native private final static int LOAD_LIB_ERROR = -1;
@Native private final static int LOAD_LIB_OK = 0;
@Native private final static int LOAD_LIB_NO_DEVICE = 1;
@Native private final static int LOAD_LIB_NO_SHADER_LIB = 2;
private static boolean mtlAvailable;
private static boolean mtlUsed = false;
private static ImageCapabilities imageCaps = new MTLImageCaps();
@@ -97,7 +91,7 @@ public final class MTLGraphicsConfig extends CGraphicsConfig
private final int maxTextureSize;
private static native boolean isMetalFrameworkAvailable();
private static native int tryLoadMetalLibrary(int displayID, String shaderLib);
private static native boolean tryLoadMetalLibrary(int displayID, String shaderLib);
private static native long getMTLConfigInfo(int displayID, String mtlShadersLib);
/**
@@ -138,29 +132,21 @@ public final class MTLGraphicsConfig extends CGraphicsConfig
}
public static MTLGraphicsConfig getConfig(CGraphicsDevice device,
int displayID, StringBuilder errorMessage)
int displayID)
{
if (!mtlAvailable) {
return null;
}
if (!tryLoadMetalLibrary(displayID, mtlShadersLib)) {
return null;
}
long cfginfo = 0;
int textureSize = 0;
MTLRenderQueue rq = MTLRenderQueue.getInstance();
rq.lock();
try {
int res = tryLoadMetalLibrary(displayID, mtlShadersLib);
if (res != LOAD_LIB_OK) {
errorMessage.append(" Cannot load metal library: " +
switch (res) {
case LOAD_LIB_ERROR -> "Unexpected error.";
case LOAD_LIB_NO_DEVICE -> "No MTLDevice.";
case LOAD_LIB_NO_SHADER_LIB -> "No Metal shader library.";
default -> throw new IllegalStateException("Unexpected value: " + res);
});
return null;
}
cfginfo = getMTLConfigInfo(displayID, mtlShadersLib);
if (cfginfo != 0L) {
textureSize = nativeGetMaxTextureSize();
@@ -174,7 +160,6 @@ public final class MTLGraphicsConfig extends CGraphicsConfig
rq.unlock();
}
if (cfginfo == 0) {
errorMessage.append(" Cannot create MTLConfigInfo.");
return null;
}

View File

@@ -964,7 +964,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
return false;
}
boolean res = !focusedWindowChangeAllowed || parentPeer.requestWindowFocus(cause);
boolean res = parentPeer.requestWindowFocus(cause);
// If parent window can be made focused and has been made focused (synchronously)
// then we can proceed with children, otherwise we retreat
if (!res || !parentWindow.isFocused()) {

View File

@@ -271,7 +271,6 @@ public class CInputMethod extends InputMethodAdapter {
nativeEndComposition(getNativeViewPtr(fAwtFocussedComponentPeer));
}
fAwtFocussedComponent = null;
fAwtFocussedComponentPeer = null;
}
@@ -282,32 +281,34 @@ public class CInputMethod extends InputMethodAdapter {
* to talk to when responding to key events.
*/
protected void setAWTFocussedComponent(Component component) {
if (component == null || component == fAwtFocussedComponent) {
// Sometimes input happens for the natively unfocused window
// (e.g. in case of system emoji picker),
// so we don't reset last focused component on focus lost.
return;
}
LWComponentPeer<?, ?> peer = null;
long modelPtr = 0;
CInputMethod imInstance = this;
if (fAwtFocussedComponentPeer != null) {
long modelPtr = getNativeViewPtr(fAwtFocussedComponentPeer);
nativeNotifyPeer(modelPtr, null);
}
// component will be null when we are told there's no focused component.
// When that happens we need to notify the native architecture to stop generating IMEs
if (component == null) {
peer = fAwtFocussedComponentPeer;
imInstance = null;
} else {
peer = getNearestNativePeer(component);
fAwtFocussedComponent = component;
fAwtFocussedComponentPeer = getNearestNativePeer(component);
if (fAwtFocussedComponentPeer != null) {
long modelPtr = getNativeViewPtr(fAwtFocussedComponentPeer);
CInputMethod imInstance = this;
// If we have a passive client, don't pass input method events to it.
if (component.getInputMethodRequests() == null) {
imInstance = null;
}
}
if (peer != null) {
modelPtr = getNativeViewPtr(peer);
// modelPtr refers to the ControlModel that either got or lost focus.
nativeNotifyPeer(modelPtr, imInstance);
}
// Track the focused component and its nearest peer.
fAwtFocussedComponent = component;
fAwtFocussedComponentPeer = getNearestNativePeer(component);
}
/**

View File

@@ -101,8 +101,13 @@ final class CPlatformResponder {
}
int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags);
if ((jeventType == MouseEvent.MOUSE_PRESSED) && (jbuttonNumber > MouseEvent.NOBUTTON)) {
jmodifiers |= MouseEvent.getMaskForButton(jbuttonNumber);
if (!"false".equalsIgnoreCase(System.getProperty("jbr4765.forceMousePressedButtonModifier", "true"))) {
// JBR-4765: NSEvent.nsToJavaModifiers returns 0 for right taps.
// So ensure the pressed mouse button is also reflected by the appropriate modifier.
if ((jeventType == MouseEvent.MOUSE_PRESSED) && (jbuttonNumber > MouseEvent.NOBUTTON)) {
jmodifiers |= InputEvent.getMaskForButton(jbuttonNumber);
}
}
boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers);

View File

@@ -78,7 +78,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
public class CPlatformWindow extends CFRetainedResource implements PlatformWindow {
private native long nativeCreateNSWindow(long nsViewPtr,long ownerPtr, long styleBits, double x, double y, double w, double h, double transparentTitleBarHeight);
private native long nativeCreateNSWindow(long nsViewPtr,long ownerPtr, long styleBits, double x, double y, double w, double h);
private static native void nativeSetNSWindowStyleBits(long nsWindowPtr, int mask, int data);
private static native void nativeSetNSWindowAppearance(long nsWindowPtr, String appearanceName);
private static native void nativeSetNSWindowMenuBar(long nsWindowPtr, long menuBarPtr);
@@ -107,7 +107,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
private static native void nativeRaiseLevel(long nsWindowPtr, boolean popup, boolean onlyIfParentIsActive);
private static native void nativeSetTransparentTitleBarHeight(long nsWindowPtr, float height);
private static native void nativeCallDeliverMoveResizeEvent(long nsWindowPtr);
private static native void nativeSetRoundedCorners(long nsWindowPrt, float radius, int borderWidth, int borderColor);
// Loger to report issues happened during execution but that do not affect functionality
private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
@@ -141,7 +140,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
public static final String WINDOW_TITLE_VISIBLE = "apple.awt.windowTitleVisible";
public static final String WINDOW_APPEARANCE = "apple.awt.windowAppearance";
public static final String WINDOW_TRANSPARENT_TITLE_BAR_HEIGHT = "apple.awt.windowTransparentTitleBarHeight";
public static final String WINDOW_CORNER_RADIUS = "apple.awt.windowCornerRadius";
// This system property is named as jdk.* because it is not specific to AWT
// and it is also used in JavaFX
@@ -294,18 +292,9 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
new Property<CPlatformWindow>(WINDOW_TRANSPARENT_TITLE_BAR_HEIGHT) {
public void applyProperty(final CPlatformWindow c, final Object value) {
if (value != null && (value instanceof Float)) {
boolean enabled = (float) value != 0f;
c.setStyleBits(FULL_WINDOW_CONTENT, enabled);
c.setStyleBits(TRANSPARENT_TITLE_BAR, enabled);
c.setStyleBits(TITLE_VISIBLE, !enabled);
c.execute(ptr -> AWTThreading.executeWaitToolkit(wait -> nativeSetTransparentTitleBarHeight(ptr, (float) value)));
}
}
},
new Property<CPlatformWindow>(WINDOW_CORNER_RADIUS) {
public void applyProperty(final CPlatformWindow c, final Object value) {
c.setRoundedCorners(value);
}
}
}) {
@SuppressWarnings("deprecation")
@@ -373,8 +362,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
responder = createPlatformResponder();
contentView.initialize(peer, responder);
float transparentTitleBarHeight = getTransparentTitleBarHeight(_target);
Rectangle bounds;
if (!IS(DECORATED, styleBits)) {
// For undecorated frames the move/resize event does not come if the frame is centered on the screen
@@ -395,7 +382,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
+ ", bounds=" + bounds);
}
long windowPtr = createNSWindow(viewPtr, ownerPtr, styleBits,
bounds.x, bounds.y, bounds.width, bounds.height, transparentTitleBarHeight);
bounds.x, bounds.y, bounds.width, bounds.height);
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine("window created: " + Long.toHexString(windowPtr));
}
@@ -410,7 +397,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
+ ", bounds=" + bounds);
}
long windowPtr = createNSWindow(viewPtr, 0, styleBits,
bounds.x, bounds.y, bounds.width, bounds.height, transparentTitleBarHeight);
bounds.x, bounds.y, bounds.width, bounds.height);
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine("window created: " + Long.toHexString(windowPtr));
}
@@ -572,14 +559,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
if (prop != null) {
styleBits = SET(styleBits, TITLE_VISIBLE, Boolean.parseBoolean(prop.toString()));
}
prop = rootpane.getClientProperty(WINDOW_TRANSPARENT_TITLE_BAR_HEIGHT);
if (prop != null) {
boolean enabled = Float.parseFloat(prop.toString()) != 0f;
styleBits = SET(styleBits, FULL_WINDOW_CONTENT, enabled);
styleBits = SET(styleBits, TRANSPARENT_TITLE_BAR, enabled);
styleBits = SET(styleBits, TITLE_VISIBLE, !enabled);
}
}
if (isDialog) {
@@ -1216,6 +1195,12 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
* Callbacks from the AWTWindow and AWTView objc classes.
*************************************************************/
private void deliverWindowFocusEvent(boolean gained, CPlatformWindow opposite){
// Fix for 7150349: ingore "gained" notifications when the app is inactive.
if (gained && !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) {
focusLogger.fine("the app is inactive, so the notification is ignored");
return;
}
LWWindowPeer oppositePeer = (opposite == null)? null : opposite.getPeer();
responder.handleWindowFocusEvent(gained, oppositePeer);
}
@@ -1452,16 +1437,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
return false;
}
private long createNSWindow(long nsViewPtr,
long ownerPtr,
long styleBits,
double x,
double y,
double w,
double h,
double transparentTitleBarHeight) {
return AWTThreading.executeWaitToolkit(() ->
nativeCreateNSWindow(nsViewPtr, ownerPtr, styleBits, x, y, w, h, transparentTitleBarHeight));
private long createNSWindow(long nsViewPtr,long ownerPtr, long styleBits, double x, double y, double w, double h) {
return AWTThreading.executeWaitToolkit(() -> nativeCreateNSWindow(nsViewPtr, ownerPtr, styleBits, x, y, w, h));
}
// ----------------------------------------------------------------------
@@ -1495,49 +1472,20 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
isFullScreenAnimationOn = false;
}
private float getTransparentTitleBarHeight(Window target) {
if (target instanceof javax.swing.RootPaneContainer) {
final javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane();
if (rootpane != null) {
Object transparentTitleBarHeightProperty = rootpane.getClientProperty(WINDOW_TRANSPARENT_TITLE_BAR_HEIGHT);
if (transparentTitleBarHeightProperty != null) {
return Float.parseFloat(transparentTitleBarHeightProperty.toString());
// JBR API internals
private static void setCustomDecorationTitleBarHeight(Window target, ComponentPeer peer, float height) {
if (peer instanceof LWComponentPeer) {
PlatformWindow platformWindow = ((LWComponentPeer<?, ?>) peer).getPlatformWindow();
if (platformWindow instanceof CPlatformWindow) {
((CPlatformWindow) platformWindow).execute(ptr -> {
AWTThreading.executeWaitToolkit(wait -> nativeSetTransparentTitleBarHeight(ptr, height));
});
if (target instanceof javax.swing.RootPaneContainer) {
final javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane();
if (rootpane != null) rootpane.putClientProperty(WINDOW_TRANSPARENT_TITLE_BAR_HEIGHT, height);
}
}
}
return 0f;
}
// JBR API internals
private static void setCustomDecorationTitleBarHeight(Window target, ComponentPeer peer, float height) {
if (target instanceof javax.swing.RootPaneContainer) {
final javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane();
if (rootpane != null) rootpane.putClientProperty(WINDOW_TRANSPARENT_TITLE_BAR_HEIGHT, height);
}
}
// JBR API internals
private static void setRoundedCorners(Window window, Object params) {
Object peer = AWTAccessor.getComponentAccessor().getPeer(window);
if (peer instanceof CPlatformWindow) {
((CPlatformWindow)peer).setRoundedCorners(params);
} else if (window instanceof RootPaneContainer) {
JRootPane rootpane = ((RootPaneContainer)window).getRootPane();
if (rootpane != null) {
rootpane.putClientProperty(WINDOW_CORNER_RADIUS, params);
}
}
}
private void setRoundedCorners(Object params) {
if (params instanceof Float) {
execute(ptr -> nativeSetRoundedCorners(ptr, (float) params, 0, 0));
} else if (params instanceof Object[]) {
Object[] values = (Object[]) params;
if (values.length == 3 && values[0] instanceof Float && values[1] instanceof Integer && values[2] instanceof Color) {
Color color = (Color) values[2];
execute(ptr -> nativeSetRoundedCorners(ptr, (float) values[0], (int) values[1], color.getRGB()));
}
}
}
}

View File

@@ -50,9 +50,7 @@ final class CWrapper {
static void makeKeyAndOrderFront(long window) {
AWTThreading.executeWaitToolkit(wait -> nativeMakeKeyAndOrderFront(window, wait));
}
static void makeKeyWindow(long window) {
AWTThreading.executeWaitToolkit(wait -> nativeMakeKeyWindow(window, wait));
}
static native void makeKeyWindow(long window);
static native void makeMainWindow(long window);
static native boolean canBecomeMainWindow(long window);
static native boolean isKeyWindow(long window);
@@ -73,7 +71,6 @@ final class CWrapper {
}
private static native void nativeOrderOut(long window, boolean wait);
private static native void nativeMakeKeyWindow(long window, boolean wait);
private static native void nativeMakeKeyAndOrderFront(long window, boolean wait);
/**

View File

@@ -416,7 +416,7 @@ AWT_NS_WINDOW_IMPLEMENTATION
}
if (IS(mask, TITLE_VISIBLE) && [self.nsWindow respondsToSelector:@selector(setTitleVisibility:)]) {
[self.nsWindow setTitleVisibility:(IS(bits, TITLE_VISIBLE) ? NSWindowTitleVisible : NSWindowTitleHidden)];
[self.nsWindow setTitleVisibility:(IS(bits, TITLE_VISIBLE)) ? NSWindowTitleVisible :NSWindowTitleHidden];
}
}
@@ -426,7 +426,6 @@ AWT_NS_WINDOW_IMPLEMENTATION
styleBits:(jint)bits
frameRect:(NSRect)rect
contentView:(NSView *)view
transparentTitleBarHeight:(CGFloat)transparentTitleBarHeight
{
AWT_ASSERT_APPKIT_THREAD;
@@ -487,11 +486,6 @@ AWT_ASSERT_APPKIT_THREAD;
self.nsWindow.collectionBehavior = NSWindowCollectionBehaviorManaged;
self.isEnterFullScreen = NO;
_transparentTitleBarHeight = transparentTitleBarHeight;
if (transparentTitleBarHeight != 0.0 && !self.isFullScreen) {
[self setUpTransparentTitleBar];
}
return self;
}
@@ -1024,7 +1018,7 @@ AWT_ASSERT_APPKIT_THREAD;
#ifdef DEBUG
NSLog(@"resigned key: %d %@ %@", [self.nsWindow isMainWindow], [self.nsWindow title], [self menuBarForWindow]);
#endif
if (![self.nsWindow isMainWindow] || [NSApp keyWindow] == self.nsWindow) {
if (![self.nsWindow isMainWindow]) {
[self deactivateWindow];
}
}
@@ -1053,9 +1047,7 @@ AWT_ASSERT_APPKIT_THREAD;
NSWindow *keyWindow = [NSApp keyWindow];
AWTWindow *opposite = nil;
if ([AWTWindow isAWTWindow: keyWindow]) {
if (keyWindow != self.nsWindow) {
opposite = (AWTWindow *)[keyWindow delegate];
}
opposite = (AWTWindow *)[keyWindow delegate];
[AWTWindow setLastKeyWindow: self];
} else {
[AWTWindow setLastKeyWindow: nil];
@@ -1451,32 +1443,38 @@ static const CGFloat DefaultHorizontalTitleBarButtonOffset = 20.0;
- (void) setTransparentTitleBarHeight: (CGFloat) transparentTitleBarHeight
{
if (_transparentTitleBarHeight == transparentTitleBarHeight) return;
if (_transparentTitleBarHeight != 0.0f) {
_transparentTitleBarHeight = transparentTitleBarHeight;
if (transparentTitleBarHeight == 0.0f) {
if (!self.isFullScreen) {
dispatch_sync(dispatch_get_main_queue(), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
[self.nsWindow setTitlebarAppearsTransparent:NO];
[self.nsWindow setTitleVisibility:NSWindowTitleVisible];
[self.nsWindow setStyleMask:[self.nsWindow styleMask]&(~NSWindowStyleMaskFullSizeContentView)];
if (!self.isFullScreen) {
[self resetTitleBar];
});
}
}
});
} else if (_transparentTitleBarHeightConstraint != nil || _transparentTitleBarButtonCenterXConstraints != nil) {
[self updateTransparentTitleBarConstraints];
}
} else {
_transparentTitleBarHeight = transparentTitleBarHeight;
if (!self.isFullScreen) {
dispatch_sync(dispatch_get_main_queue(), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
[self.nsWindow setTitlebarAppearsTransparent:YES];
[self.nsWindow setTitleVisibility:NSWindowTitleHidden];
[self.nsWindow setStyleMask:[self.nsWindow styleMask]|NSWindowStyleMaskFullSizeContentView];
if (!self.isFullScreen) {
[self setUpTransparentTitleBar];
});
}
}
});
}
}
@end // AWTWindow
@implementation AWTWindowDragView {
CGFloat _accumulatedDragDelta;
enum WindowDragState {
NO_DRAG, // Mouse not dragging
SKIP_DRAG, // Mouse dragging in non-draggable area
@@ -1497,9 +1495,9 @@ static const CGFloat DefaultHorizontalTitleBarButtonOffset = 20.0;
return NO;
}
- (jint)hitTestCustomDecoration:(NSPoint)point
- (BOOL)isInDraggableArea:(NSPoint)point
{
jint returnValue = java_awt_Window_CustomWindowDecoration_NO_HIT_SPOT;
BOOL returnValue = YES;
JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
jobject platformWindow = (*env)->NewLocalRef(env, self.javaPlatformWindow);
if (platformWindow != NULL) {
@@ -1511,7 +1509,8 @@ static const CGFloat DefaultHorizontalTitleBarButtonOffset = 20.0;
if (awtWindow != NULL) {
NSRect frame = [self.window frame];
float windowHeight = frame.size.height;
returnValue = (*env)->CallIntMethod(env, awtWindow, jm_hitTestCustomDecoration, (jint) point.x, (jint) (windowHeight - point.y));
returnValue = (*env)->CallIntMethod(env, awtWindow, jm_hitTestCustomDecoration, (jint) point.x, (jint) (windowHeight - point.y)) ==
(jint) java_awt_Window_CustomWindowDecoration_NO_HIT_SPOT ? YES : NO;
CHECK_EXCEPTION();
(*env)->DeleteLocalRef(env, awtWindow);
}
@@ -1523,7 +1522,6 @@ static const CGFloat DefaultHorizontalTitleBarButtonOffset = 20.0;
- (void)mouseDown:(NSEvent *)event
{
_draggingWindow = NO_DRAG;
_accumulatedDragDelta = 0.0;
// We don't follow the regular responder chain here since the native window swallows events in some cases
[[self.window contentView] deliverJavaMouseEvent:event];
}
@@ -1531,17 +1529,12 @@ static const CGFloat DefaultHorizontalTitleBarButtonOffset = 20.0;
- (void)mouseDragged:(NSEvent *)event
{
if (_draggingWindow == NO_DRAG) {
jint hitSpot = [self hitTestCustomDecoration:event.locationInWindow];
switch (hitSpot) {
case java_awt_Window_CustomWindowDecoration_DRAGGABLE_AREA:
// Start drag only after 4px threshold inside DRAGGABLE_AREA
if ((_accumulatedDragDelta += fabs(event.deltaX) + fabs(event.deltaY)) <= 4.0) break;
case java_awt_Window_CustomWindowDecoration_NO_HIT_SPOT:
[self.window performWindowDragWithEvent:event];
_draggingWindow = DRAG;
break;
default:
_draggingWindow = SKIP_DRAG;
BOOL shouldStartWindowDrag = [self isInDraggableArea:event.locationInWindow];
if (shouldStartWindowDrag) {
[self.window performWindowDragWithEvent:event];
_draggingWindow = DRAG;
} else {
_draggingWindow = SKIP_DRAG;
}
}
}
@@ -1551,13 +1544,8 @@ static const CGFloat DefaultHorizontalTitleBarButtonOffset = 20.0;
if (_draggingWindow == DRAG) {
_draggingWindow = NO_DRAG;
} else {
jint hitSpot = [self hitTestCustomDecoration:event.locationInWindow];
if (event.clickCount == 2 && hitSpot == java_awt_Window_CustomWindowDecoration_NO_HIT_SPOT) {
if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"AppleActionOnDoubleClick"] isEqualToString:@"Maximize"]) {
[self.window performZoom:nil];
} else {
[self.window performMiniaturize:nil];
}
if (event.clickCount == 2 && [self isInDraggableArea:event.locationInWindow]) {
[self.window performZoom:nil];
}
// We don't follow the regular responder chain here since the native window swallows events in some cases
@@ -1589,10 +1577,10 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetAllowAutom
/*
* Class: sun_lwawt_macosx_CPlatformWindow
* Method: nativeCreateNSWindow
* Signature: (JJIDDDDD)J
* Signature: (JJIIII)J
*/
JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCreateNSWindow
(JNIEnv *env, jobject obj, jlong contentViewPtr, jlong ownerPtr, jlong styleBits, jdouble x, jdouble y, jdouble w, jdouble h, jdouble transparentTitleBarHeight)
(JNIEnv *env, jobject obj, jlong contentViewPtr, jlong ownerPtr, jlong styleBits, jdouble x, jdouble y, jdouble w, jdouble h)
{
__block AWTWindow *window = nil;
@@ -1619,8 +1607,7 @@ JNI_COCOA_ENTER(env);
ownerWindow:owner
styleBits:styleBits
frameRect:frameRect
contentView:contentView
transparentTitleBarHeight:(CGFloat)transparentTitleBarHeight];
contentView:contentView];
// the window is released is CPlatformWindow.nativeDispose()
if (window) {
@@ -1712,8 +1699,8 @@ JNI_COCOA_EXIT(env);
/*
* Class: sun_lwawt_macosx_CPlatformWindow
* Method: nativeSetNSWindowAppearance
* Signature: (JLjava/lang/String;)V
* Method: nativeSetNSWindowStyleBits
* Signature: (JII)V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowAppearance
(JNIEnv *env, jclass clazz, jlong windowPtr, jstring appearanceName)
@@ -2393,36 +2380,3 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCallDeliverMo
JNI_COCOA_EXIT(env);
}
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetRoundedCorners
(JNIEnv *env, jclass clazz, jlong windowPtr, jfloat radius, jint borderWidth, jint borderRgb)
{
JNI_COCOA_ENTER(env);
NSWindow *w = (NSWindow *)jlong_to_ptr(windowPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
w.hasShadow = YES;
w.contentView.wantsLayer = YES;
w.contentView.layer.cornerRadius = radius;
w.contentView.layer.masksToBounds = YES;
if (borderWidth > 0) {
CGFloat alpha = (((borderRgb >> 24) & 0xff) / 255.0);
CGFloat red = (((borderRgb >> 16) & 0xff) / 255.0);
CGFloat green = (((borderRgb >> 8) & 0xff) / 255.0);
CGFloat blue = (((borderRgb >> 0) & 0xff) / 255.0);
NSColor *color = [NSColor colorWithDeviceRed:red green:green blue:blue alpha:alpha];
w.contentView.layer.borderWidth = borderWidth;
w.contentView.layer.borderColor = color.CGColor;
}
w.backgroundColor = NSColor.clearColor;
w.opaque = NO;
// remove corner radius animation
[w.contentView.layer removeAllAnimations];
[w invalidateShadow];
}];
JNI_COCOA_EXIT(env);
}

View File

@@ -50,12 +50,12 @@ JNI_COCOA_EXIT(env);
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: nativeMakeKeyWindow
* Signature: (JZ)V
* Method: makeKeyWindow
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_nativeMakeKeyWindow
(JNIEnv *env, jclass cls, jlong windowPtr, jboolean wait)
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyWindow
(JNIEnv *env, jclass cls, jlong windowPtr)
{
JNI_COCOA_ENTER(env);
@@ -63,7 +63,7 @@ JNI_COCOA_ENTER(env);
[ThreadUtilities performOnMainThread:@selector(makeKeyWindow)
on:window
withObject:nil
waitUntilDone:(BOOL)wait];
waitUntilDone:NO];
JNI_COCOA_EXIT(env);
}

View File

@@ -218,11 +218,20 @@ JNI_COCOA_ENTER(env);
JNI_COCOA_EXIT(env);
}
jobject getGlyphOutline(JNIEnv *env, AWTStrike *awtStrike,
CTFontRef font, CGGlyph glyph,
jdouble xPos, jdouble yPos)
/*
* Class: sun_font_CStrike
* Method: getNativeGlyphOutline
* Signature: (JJIDD)Ljava/awt/geom/GeneralPath;
*/
JNIEXPORT jobject JNICALL
Java_sun_font_CStrike_getNativeGlyphOutline
(JNIEnv *env, jclass clazz,
jlong awtStrikePtr, jint glyphCode, jdouble xPos, jdouble yPos)
{
jobject generalPath = NULL;
JNI_COCOA_ENTER(env);
AWTPathRef path = NULL;
jfloatArray pointCoords = NULL;
jbyteArray pointTypes = NULL;
@@ -232,11 +241,21 @@ jobject getGlyphOutline(JNIEnv *env, AWTStrike *awtStrike,
AWT_FONT_CLEANUP_SETUP;
AWTStrike *awtStrike = (AWTStrike *)jlong_to_ptr(awtStrikePtr);
AWTFont *awtfont = awtStrike->fAWTFont;
AWT_FONT_CLEANUP_CHECK(awtfont);
// inverting the shear order and sign to compensate for the flipped coordinate system
CGAffineTransform tx = awtStrike->fTx;
tx.tx += xPos;
tx.ty += yPos;
// get the right font and glyph for this "Java GlyphCode"
CGGlyph glyph;
const CTFontRef font = CTS_CopyCTFallbackFontAndGlyphForJavaGlyphCode(awtfont, glyphCode, &glyph);
// get the advance of this glyph
CGSize advance;
CTFontGetAdvancesForGlyphs(font, kCTFontDefaultOrientation, &glyph, &advance, 1);
@@ -249,6 +268,7 @@ AWT_FONT_CLEANUP_CHECK(path);
tx = awtStrike->fTx;
tx = CGAffineTransformConcat(tx, sInverseTX);
AWTGetGlyphOutline(&glyph, (NSFont *)font, &advance, &tx, 0, 1, &path);
CFRelease(font);
pointCoords = (*env)->NewFloatArray(env, path->fNumberOfDataElements);
AWT_FONT_CLEANUP_CHECK(pointCoords);
@@ -282,190 +302,10 @@ cleanup:
}
AWT_FONT_CLEANUP_FINISH;
JNI_COCOA_EXIT(env);
return generalPath;
}
/*
* Class: sun_font_CStrike
* Method: getNativeGlyphOutline
* Signature: (JJIDD)Ljava/awt/geom/GeneralPath;
*/
JNIEXPORT jobject JNICALL
Java_sun_font_CStrike_getNativeGlyphOutline
(JNIEnv *env, jclass clazz,
jlong awtStrikePtr, jint glyphCode, jdouble xPos, jdouble yPos) {
jobject generalPath = NULL;
JNI_COCOA_ENTER(env);
AWT_FONT_CLEANUP_SETUP;
AWTStrike *awtStrike = (AWTStrike *)jlong_to_ptr(awtStrikePtr);
AWTFont *awtfont = awtStrike->fAWTFont;
AWT_FONT_CLEANUP_CHECK(awtfont);
// get the right font and glyph for this "Java GlyphCode"
CGGlyph glyph;
const CTFontRef font = CTS_CopyCTFallbackFontAndGlyphForJavaGlyphCode(awtfont, glyphCode, &glyph);
generalPath = getGlyphOutline(env, awtStrike, font, glyph, xPos, yPos);
cleanup:
CFRelease(font);
AWT_FONT_CLEANUP_FINISH;
JNI_COCOA_EXIT(env);
return generalPath;
}
// OpenType data is Big-Endian
#define GET_BE_INT32(data, i) CFSwapInt32BigToHost(*(const UInt32*) ((const UInt8*) (data) + (i)))
#define GET_BE_INT16(data, i) CFSwapInt16BigToHost(*(const UInt16*) ((const UInt8*) (data) + (i)))
static bool addBitmapRenderData(JNIEnv *env, AWTStrike *awtStrike,
CTFontRef font, CGGlyph glyph,
jdouble xPos, jdouble yPos, jobject result) {
bool success = false;
DECLARE_CLASS_RETURN(jc_GlyphRenderData, "sun/font/GlyphRenderData", false);
DECLARE_METHOD_RETURN(GlyphRenderDataAddBitmap, jc_GlyphRenderData, "addBitmap", "(DDDDDDIIII[I)V", false);
AWT_FONT_CLEANUP_SETUP;
CTFontDescriptorRef descriptor = NULL;
CGFontRef cgFont = CTFontCopyGraphicsFont(font, &descriptor);
CFDataRef sbixTable = CGFontCopyTableForTag(cgFont, kCTFontTableSbix);
if (sbixTable == NULL) goto cleanup;
// Parse sbix table
CFIndex sbixSize = CFDataGetLength(sbixTable);
if (sbixSize < 8) goto cleanup; // Corrupted table
const UInt8* sbix = CFDataGetBytePtr(sbixTable);
UInt32 numStrikes = GET_BE_INT32(sbix, 4);
if (8 + 4 * numStrikes > sbixSize) goto cleanup; // Corrupted table
// Find last strike which has data for our glyph
// Last is usually the biggest
const UInt8* glyphData = NULL;
UInt32 size;
UInt16 ppem, ppi;
for (int i = numStrikes - 1; i >= 0; i--) {
const UInt8* strike = sbix + GET_BE_INT32(sbix, 8 + 4 * i);
if (strike + 12 + 4 * glyph > sbix + sbixSize) goto cleanup; // Corrupted table
UInt32 offset = GET_BE_INT32(strike, 4 + 4 * glyph);
size = GET_BE_INT32(strike, 8 + 4 * glyph) - offset;
if (size > 0) {
ppem = GET_BE_INT16(strike, 0);
ppi = GET_BE_INT16(strike, 2);
glyphData = strike + offset;
break;
}
}
if (glyphData == NULL) goto cleanup;
if (glyphData + 4 > sbix + sbixSize) goto cleanup; // Corrupted table
// Read glyph data
FourCharCode graphicType = GET_BE_INT32(glyphData, 4);
glyphData += 8;
size -= 8;
if (glyphData + size > sbix + sbixSize) goto cleanup; // Corrupted table
// Decode glyph image
CGDataProviderRef dataProvider = CGDataProviderCreateWithData(NULL, glyphData, size, NULL);
CGImageRef image = NULL;
if (graphicType == 'jpg ') {
image = CGImageCreateWithJPEGDataProvider(dataProvider, NULL, false, kCGRenderingIntentDefault);
} else if (graphicType == 'png ') {
image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, false, kCGRenderingIntentDefault);
}
CGDataProviderRelease(dataProvider);
if (image != NULL) {
CGBitmapInfo info = CGImageGetBitmapInfo(image);
size_t bits = CGImageGetBitsPerPixel(image);
jint colorModel = -1;
if (info & (kCGImageAlphaPremultipliedLast | kCGImageAlphaLast)) colorModel = 0; // RGBA
else if (info & (kCGImageAlphaPremultipliedFirst | kCGImageAlphaFirst)) colorModel = 1; // ARGB
if (colorModel != -1 && (info & kCGBitmapFloatComponents) == 0 && bits == 32) {
size_t width = CGImageGetWidth(image);
size_t height = CGImageGetHeight(image);
size_t pitch = CGImageGetBytesPerRow(image) / 4;
dataProvider = CGImageGetDataProvider(image);
CFDataRef data = CGDataProviderCopyData(dataProvider);
jbyteArray array = (*env)->NewIntArray(env, pitch * height);
(*env)->SetIntArrayRegion(env, array, 0, pitch * height, (const jint*) CFDataGetBytePtr(data));
CFRelease(data);
double pointSize = 72.0 * ppem / ppi;
double scale = 1.0 / pointSize;
font = CTFontCreateWithGraphicsFont(cgFont, pointSize, NULL, descriptor);
CGRect bbox = CTFontGetBoundingRectsForGlyphs(font, kCTFontOrientationDefault, &glyph, NULL, 1);
CFRelease(font);
double tx = bbox.origin.x + xPos * pointSize / awtStrike->fSize;
double ty = -bbox.origin.y - (double) height + yPos * pointSize / awtStrike->fSize;
jdouble m00 = awtStrike->fTx.a * scale, m10 = awtStrike->fTx.b * scale;
jdouble m01 = -awtStrike->fTx.c * scale, m11 = -awtStrike->fTx.d * scale;
jdouble m02 = m00 * tx + m01 * ty, m12 = m10 * tx + m11 * ty;
(*env)->CallVoidMethod(env, result, GlyphRenderDataAddBitmap,
m00, m10, m01, m11, m02, m12,
width, height, pitch, 0, array);
success = true;
}
CGImageRelease(image);
}
// Cleanup
cleanup:
if (sbixTable) CFRelease(sbixTable);
if (cgFont) CFRelease(cgFont);
if (descriptor) CFRelease(descriptor);
AWT_FONT_CLEANUP_FINISH;
return success;
}
/*
* Class: sun_font_CStrike
* Method: getNativeGlyphRenderData
* Signature: (JIDDLsun/font/GlyphRenderData;)V
*/
JNIEXPORT void JNICALL
Java_sun_font_CStrike_getNativeGlyphRenderData
(JNIEnv *env, jclass clazz,
jlong awtStrikePtr, jint glyphCode, jdouble xPos, jdouble yPos, jobject result)
{
JNI_COCOA_ENTER(env);
DECLARE_CLASS(jc_GlyphRenderData, "sun/font/GlyphRenderData");
DECLARE_FIELD(GlyphRenderDataOutline, jc_GlyphRenderData, "outline", "Ljava/awt/geom/GeneralPath;")
AWT_FONT_CLEANUP_SETUP;
AWTStrike *awtStrike = (AWTStrike *)jlong_to_ptr(awtStrikePtr);
AWTFont *awtfont = awtStrike->fAWTFont;
AWT_FONT_CLEANUP_CHECK(awtfont);
// get the right font and glyph for this "Java GlyphCode"
CGGlyph glyph;
const CTFontRef font = CTS_CopyCTFallbackFontAndGlyphForJavaGlyphCode(awtfont, glyphCode, &glyph);
if (!addBitmapRenderData(env, awtStrike, font, glyph, xPos, yPos, result)) {
jobject gp = getGlyphOutline(env, awtStrike, font, glyph, xPos, yPos);
if (gp != NULL) {
(*env)->SetObjectField(env, result, GlyphRenderDataOutline, gp);
}
}
cleanup:
CFRelease(font);
AWT_FONT_CLEANUP_FINISH;
JNI_COCOA_EXIT(env);
}
/*
* Class: sun_font_CStrike
* Method: getNativeGlyphOutlineBounds

View File

@@ -118,17 +118,16 @@ JNI_COCOA_EXIT(env);
/*
* Class: sun_font_CCompositeGlyphMapper
* Method: nativeCodePointToGlyph
* Signature: (JII[Ljava/lang/String;)I
* Signature: (JI[Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL
Java_sun_font_CCompositeGlyphMapper_nativeCodePointToGlyph
(JNIEnv *env, jclass clazz, jlong awtFontPtr, jint codePoint, jint variationSelector, jobjectArray resultArray)
(JNIEnv *env, jclass clazz, jlong awtFontPtr, jint codePoint, jobjectArray resultArray)
{
JNI_COCOA_ENTER(env);
AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
CFStringRef fontNames[] = {NULL, NULL};
CGGlyph glyph = CTS_CopyGlyphAndFontNamesForCodePoint(awtFont, (UnicodeScalarValue)codePoint,
(UnicodeScalarValue)variationSelector, fontNames);
CGGlyph glyph = CTS_CopyGlyphAndFontNamesForCodePoint(awtFont, (UnicodeScalarValue)codePoint, fontNames);
if (glyph > 0) {
jstring fontName = NSStringToJavaString(env, (NSString *)fontNames[0]);
(*env)->SetObjectArrayElement(env, resultArray, 0, fontName);

View File

@@ -35,10 +35,6 @@
#define HI_SURROGATE_END 0xDBFF
#define LO_SURROGATE_START 0xDC00
#define LO_SURROGATE_END 0xDFFF
#define VS_START 0xFE00
#define VS_END 0xFE0F
#define VSS_START 0xE0100
#define VSS_END 0xE01FF
/*
* Transform Unicode characters into glyphs.
@@ -61,14 +57,11 @@ CTFontRef CTS_CopyCTFallbackFontAndGlyphForUnicode(const AWTFont *font, const UT
// Transform a single Unicode character code into glyph code.
// Names of the relevant font are also returned, if the substitution is used.
// Non-null components of fontNames array should always be released by the calling code, regardless of the returned value.
CGGlyph CTS_CopyGlyphAndFontNamesForCodePoint(const AWTFont *font, const UnicodeScalarValue codePoint, const UnicodeScalarValue variationSelector, CFStringRef fontNames[]);
CGGlyph CTS_CopyGlyphAndFontNamesForCodePoint(const AWTFont *font, const UnicodeScalarValue codePoint, CFStringRef fontNames[]);
// Breakup a 32 bit unicode value into the component surrogate pairs
void CTS_BreakupUnicodeIntoSurrogatePairs(int uniChar, UTF16Char charRef[]);
// Get number of UTF16 values from 32 bit unicode value (2 for surrogate pair and 1 otherwise)
int CTS_GetUnicodeSize(const UnicodeScalarValue unicode);
// Basic struct that holds everything CoreText is interested in
typedef struct CTS_ProviderStruct {

View File

@@ -88,44 +88,29 @@ ReleaseCTStateDictionary(CFDictionaryRef ctStateDict)
CFRelease(ctStateDict); // GC
}
int NextUnicode(const UniChar unicodes[], UnicodeScalarValue *codePoint, const size_t index, const size_t limit) {
if (index >= limit) return 0;
UniChar unicode = unicodes[index];
UniChar nextUnicode = (index+1) < limit ? unicodes[index+1] : 0;
bool surrogatePair = unicode >= HI_SURROGATE_START && unicode <= HI_SURROGATE_END
&& nextUnicode >= LO_SURROGATE_START && nextUnicode <= LO_SURROGATE_END;
*codePoint = surrogatePair ? (((int)(unicode - HI_SURROGATE_START)) << 10)
+ nextUnicode - LO_SURROGATE_START + 0x10000 : unicode;
return surrogatePair ? 2 : 1;
}
void GetFontsAndGlyphsForCharacters(CTFontRef font, CTFontRef fallbackBase,
const UniChar unicodes[], CGGlyph glyphs[], jint glyphsAsInts[],
CTFontRef actualFonts[], const size_t count)
{
CTFontGetGlyphsForCharacters(font, unicodes, glyphs, count);
if (!fallbackBase) fallbackBase = font;
size_t i, size;
for (i = 0; i < count; i += size) {
UnicodeScalarValue codePoint, variationCodePoint;
int codePointSize = size = NextUnicode(unicodes, &codePoint, i, count);
if (size == 0) break;
int variationSize = NextUnicode(unicodes, &variationCodePoint, i + size , count);
bool hasVariationSelector = variationSize > 0 &&
((variationCodePoint >= VSS_START && variationCodePoint <= VSS_END) ||
(variationCodePoint >= VS_START && variationCodePoint <= VS_END));
if (hasVariationSelector) size += variationSize;
size_t i;
for (i = 0; i < count; i++) {
UniChar unicode = unicodes[i];
UniChar nextUnicode = (i+1) < count ? unicodes[i+1] : 0;
bool surrogatePair = unicode >= HI_SURROGATE_START && unicode <= HI_SURROGATE_END
&& nextUnicode >= LO_SURROGATE_START && nextUnicode <= LO_SURROGATE_END;
CGGlyph glyph = glyphs[i];
if (glyph > 0 && (!hasVariationSelector || glyphs[i + codePointSize] > 0)) {
if (glyph > 0) {
glyphsAsInts[i] = glyph;
if (surrogatePair) i++;
continue;
}
const CTFontRef fallback = JRSFontCreateFallbackFontForCharacters(fallbackBase, &unicodes[i], size);
const CTFontRef fallback = JRSFontCreateFallbackFontForCharacters(fallbackBase, &unicodes[i], surrogatePair ? 2 : 1);
if (fallback) {
CTFontGetGlyphsForCharacters(fallback, &unicodes[i], &glyphs[i], size);
CTFontGetGlyphsForCharacters(fallback, &unicodes[i], &glyphs[i], surrogatePair ? 2 : 1);
glyph = glyphs[i];
if (actualFonts && glyph > 0) {
actualFonts[i] = fallback;
@@ -135,10 +120,13 @@ void GetFontsAndGlyphsForCharacters(CTFontRef font, CTFontRef fallbackBase,
}
if (glyph > 0) {
int codePoint = surrogatePair ? (((int)(unicode - HI_SURROGATE_START)) << 10)
+ nextUnicode - LO_SURROGATE_START + 0x10000 : unicode;
glyphsAsInts[i] = -codePoint; // set the glyph code to the negative unicode value
} else {
glyphsAsInts[i] = 0; // CoreText couldn't find a glyph for this character either
}
if (surrogatePair) i++;
}
}
@@ -162,26 +150,17 @@ void CTS_GetGlyphsAsIntsForCharacters
* Names of the corresponding substituted font are also returned if substitution is performed.
*/
CGGlyph CTS_CopyGlyphAndFontNamesForCodePoint
(const AWTFont *font, const UnicodeScalarValue codePoint, const UnicodeScalarValue variationSelector, CFStringRef fontNames[])
(const AWTFont *font, const UnicodeScalarValue codePoint, CFStringRef fontNames[])
{
CTFontRef fontRef = (CTFontRef)font->fFont;
CTFontRef fallbackBase = (CTFontRef)font->fFallbackBase;
int codePointSize = CTS_GetUnicodeSize(codePoint);
int count = codePointSize + (variationSelector == 0 ? 0 : CTS_GetUnicodeSize(variationSelector));
int count = codePoint >= 0x10000 ? 2 : 1;
UTF16Char unicodes[count];
if (codePoint < 0x10000) {
if (count == 1) {
unicodes[0] = (UTF16Char)codePoint;
} else {
CTS_BreakupUnicodeIntoSurrogatePairs(codePoint, unicodes);
}
if (variationSelector != 0) {
UTF16Char* codes = &unicodes[codePointSize];
if (variationSelector < 0x10000) {
codes[0] = (UTF16Char)variationSelector;
} else {
CTS_BreakupUnicodeIntoSurrogatePairs(variationSelector, codes);
}
}
CGGlyph glyphs[count];
jint glyphsAsInts[count];
CTFontRef actualFonts[count];
@@ -267,7 +246,3 @@ void CTS_BreakupUnicodeIntoSurrogatePairs(int uniChar, UTF16Char charRef[]) {
charRef[0] = high_surrogate;
charRef[1] = low_surrogate;
}
int CTS_GetUnicodeSize(const UnicodeScalarValue unicode) {
return unicode >= 0x10000 ? 2 : 1;
}

View File

@@ -70,11 +70,11 @@ Java_sun_java2d_metal_MTLGraphicsConfig_isMetalFrameworkAvailable
return metalSupported;
}
JNIEXPORT jint JNICALL
JNIEXPORT jboolean JNICALL
Java_sun_java2d_metal_MTLGraphicsConfig_tryLoadMetalLibrary
(JNIEnv *env, jclass mtlgc, jint displayID, jstring shadersLibName)
{
__block jint ret = sun_java2d_metal_MTLGraphicsConfig_LOAD_LIB_ERROR;
__block jboolean ret = JNI_FALSE;
JNI_COCOA_ENTER(env);
@@ -87,14 +87,12 @@ JNI_COCOA_ENTER(env);
NSError* error = nil;
id<MTLLibrary> lib = [device newLibraryWithFile:path error:&error];
if (lib != nil) {
ret = sun_java2d_metal_MTLGraphicsConfig_LOAD_LIB_OK;
ret = JNI_TRUE;
} else {
J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLGraphicsConfig_tryLoadMetalLibrary - Failed to load Metal shader library.");
ret = sun_java2d_metal_MTLGraphicsConfig_LOAD_LIB_NO_SHADER_LIB;
}
} else {
J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLGraphicsConfig_tryLoadMetalLibrary - Failed to create MTLDevice.");
ret = sun_java2d_metal_MTLGraphicsConfig_LOAD_LIB_NO_DEVICE;
}
}];

View File

@@ -26,17 +26,11 @@ import java.lang.invoke.MethodHandles;
public class JBRApiModule {
static {
JBRApi.registerModule(MethodHandles.lookup(), JBRApiModule.class.getModule()::addExports)
.service("com.jetbrains.ExtendedGlyphCache")
.withStatic("getSubpixelResolution", "getSubpixelResolution", "sun.font.FontUtilities")
.service("com.jetbrains.JBRFileDialogService")
.withStatic("getFileDialog", "get", "com.jetbrains.desktop.JBRFileDialog")
.service("com.jetbrains.ExtendedGlyphCache", null)
.withStatic("getSubpixelResolution", "sun.font.FontUtilities")
.service("com.jetbrains.JBRFileDialogService", null)
.withStatic("getFileDialog", "com.jetbrains.desktop.JBRFileDialog", "get")
.proxy("com.jetbrains.JBRFileDialog", "com.jetbrains.desktop.JBRFileDialog")
.service("com.jetbrains.CustomWindowDecoration", "java.awt.Window$CustomWindowDecoration")
.service("com.jetbrains.RoundedCornersManager")
.withStatic("setRoundedCorners", "setRoundedCorners", "sun.lwawt.macosx.CPlatformWindow",
"sun.awt.windows.WWindowPeer")
.service("com.jetbrains.DesktopActions")
.withStatic("setHandler", "setDesktopActionsHandler", "java.awt.Desktop")
.clientProxy("java.awt.Desktop$DesktopActionsHandler", "com.jetbrains.DesktopActions$Handler");
.service("com.jetbrains.CustomWindowDecoration", "java.awt.Window$CustomWindowDecoration");
}
}

View File

@@ -40,7 +40,6 @@ import java.awt.peer.DesktopPeer;
import java.io.File;
import java.io.FilePermission;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.AccessController;
@@ -429,11 +428,7 @@ public class Desktop {
checkActionSupport(Action.OPEN);
checkFileValidation(file);
final DesktopActions localHandler = actions;
if (localHandler != null && localHandler.openSupported)
localHandler.handler.open(file);
else
peer.open(file);
peer.open(file);
}
/**
@@ -468,12 +463,7 @@ public class Desktop {
if (file.isDirectory()) {
throw new IOException(file.getPath() + " is a directory");
}
final DesktopActions localHandler = actions;
if (localHandler != null && localHandler.editSupported)
localHandler.handler.edit(file);
else
peer.edit(file);
peer.edit(file);
}
/**
@@ -509,12 +499,7 @@ public class Desktop {
if (file.isDirectory()) {
throw new IOException(file.getPath() + " is a directory");
}
final DesktopActions localHandler = actions;
if (localHandler != null && localHandler.printSupported)
localHandler.handler.print(file);
else
peer.print(file);
peer.print(file);
}
/**
@@ -545,12 +530,7 @@ public class Desktop {
checkExec();
checkActionSupport(Action.BROWSE);
Objects.requireNonNull(uri);
final DesktopActions localHandler = actions;
if (localHandler != null && localHandler.browseSupported)
localHandler.handler.browse(uri);
else
peer.browse(uri);
peer.browse(uri);
}
/**
@@ -620,11 +600,7 @@ public class Desktop {
throw new IllegalArgumentException("URI scheme is not \"mailto\"");
}
final DesktopActions localHandler = actions;
if (localHandler != null && localHandler.mailSupported)
localHandler.handler.mail(mailtoURI);
else
peer.mail(mailtoURI);
peer.mail(mailtoURI);
}
private void checkExec() throws SecurityException {
@@ -1071,44 +1047,4 @@ public class Desktop {
});
return peer.moveToTrash(file);
}
private interface DesktopActionsHandler {
void open(File file) throws IOException;
void edit(File file) throws IOException;
void print(File file) throws IOException;
void mail(URI mailtoURL) throws IOException;
void browse(URI uri) throws IOException;
}
private static class DesktopActions {
private final DesktopActionsHandler handler;
private final boolean openSupported, editSupported, printSupported, mailSupported, browseSupported;
private static boolean isImplemented(Object target, String method, Class<?>... params) throws NoSuchMethodException {
return !target.getClass().getMethod(method, params)
.getDeclaringClass().getName().equals("com.jetbrains.DesktopActions$Handler");
}
private DesktopActions(DesktopActionsHandler handler) throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException {
this.handler = handler;
// Check which methods are actually implemented
Field targetField = handler.getClass().getDeclaredField("target");
targetField.setAccessible(true);
Object target = targetField.get(handler);
openSupported = isImplemented(target, "open", File.class);
editSupported = isImplemented(target, "edit", File.class);
printSupported = isImplemented(target, "print", File.class);
mailSupported = isImplemented(target, "mail", URI.class);
browseSupported = isImplemented(target, "browse", URI.class);
}
}
private static volatile DesktopActions actions;
static void setDesktopActionsHandler(DesktopActionsHandler h) {
try {
actions = new DesktopActions(h);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -152,6 +152,17 @@ public abstract class KeyboardFocusManager
public Container getCurrentFocusCycleRoot() {
return KeyboardFocusManager.currentFocusCycleRoot;
}
@Override
public void enqueueKeyEvents(Component untilFocused) {
KeyboardFocusManager.getCurrentKeyboardFocusManager().enqueueKeyEvents(
Toolkit.getEventQueue().getMostRecentKeyEventTime(), untilFocused);
}
@Override
public void dequeueKeyEvents(Component untilFocused) {
KeyboardFocusManager.getCurrentKeyboardFocusManager().dequeueKeyEvents(-1, untilFocused);
}
}
);
}

View File

@@ -4027,20 +4027,13 @@ public class Window extends Container implements Accessible {
private static class CustomWindowDecoration {
CustomWindowDecoration() {
if (Win.INSTANCE == null && MacOS.INSTANCE == null) {
throw new JBRApi.ServiceNotAvailableException("Only supported on Windows and macOS");
}
}
@Native public static final int
NO_HIT_SPOT = 0,
OTHER_HIT_SPOT = 1,
MINIMIZE_BUTTON = 2,
MAXIMIZE_BUTTON = 3,
CLOSE_BUTTON = 4,
MENU_BAR = 5,
DRAGGABLE_AREA = 6;
MENU_BAR = 5;
void setCustomDecorationEnabled(Window window, boolean enabled) {
window.hasCustomDecoration = enabled;
@@ -4074,14 +4067,14 @@ public class Window extends Container implements Accessible {
}
private interface Win {
Win INSTANCE = (Win) JBRApi.internalServiceBuilder(MethodHandles.lookup())
.withStatic("updateCustomDecoration", "updateCustomDecoration", "sun.awt.windows.WFramePeer").build();
Win INSTANCE = (Win) JBRApi.internalServiceBuilder(MethodHandles.lookup(), null)
.withStatic("updateCustomDecoration", "sun.awt.windows.WFramePeer").build();
void updateCustomDecoration(ComponentPeer peer);
}
private interface MacOS {
MacOS INSTANCE = (MacOS) JBRApi.internalServiceBuilder(MethodHandles.lookup())
.withStatic("setTitleBarHeight", "setCustomDecorationTitleBarHeight", "sun.lwawt.macosx.CPlatformWindow").build();
MacOS INSTANCE = (MacOS) JBRApi.internalServiceBuilder(MethodHandles.lookup(), null)
.withStatic("setTitleBarHeight", "sun.lwawt.macosx.CPlatformWindow", "setCustomDecorationTitleBarHeight").build();
void setTitleBarHeight(Window target, ComponentPeer peer, float height);
}
}

View File

@@ -464,6 +464,10 @@ public final class AWTAccessor {
* Return the current focus cycle root
*/
Container getCurrentFocusCycleRoot();
void enqueueKeyEvents(Component untilFocused);
void dequeueKeyEvents(Component untilFocused);
}
/**

View File

@@ -1064,7 +1064,7 @@ abstract class CMap {
public static final NullCMapClass theNullCmap = new NullCMapClass();
static int getControlCodeGlyph(int charCode, boolean noSurrogates) {
final int getControlCodeGlyph(int charCode, boolean noSurrogates) {
if (charCode < 0x0010) {
switch (charCode) {
case 0x0009:
@@ -1077,7 +1077,7 @@ abstract class CMap {
return -1;
}
static char getFormatCharGlyph(int charCode) {
final char getFormatCharGlyph(int charCode) {
if (charCode >= 0x200c) {
if ((charCode <= 0x200f) ||
(charCode >= 0x2028 && charCode <= 0x202e) ||
@@ -1144,17 +1144,15 @@ abstract class CMap {
}
}
private int findVariationSelectorIndex(int variationSelector) {
static final int VS_NOGLYPH = 0;
private int getGlyph(int charCode, int variationSelector) {
int targetSelector = -1;
for (int i = 0; i < numSelectors; i++) {
if (selector[i] == variationSelector) {
return i;
targetSelector = i;
break;
}
}
return -1;
}
static final int VS_NOGLYPH = 0;
private int getGlyph(int charCode, int targetSelector) {
if (targetSelector == -1) {
return VS_NOGLYPH;
}
@@ -1170,17 +1168,15 @@ abstract class CMap {
}
char getVariationGlyph(int charCode, int variationSelector) {
if (variationSelector == 0) return getGlyph(charCode);
char glyph = 0;
if (uvs != null) {
int targetSelector = uvs.findVariationSelectorIndex(variationSelector);
if (targetSelector != -1) {
int result = uvs.getGlyph(charCode, targetSelector);
if (result > 0) {
glyph = (char)(result & 0xFFFF);
} else {
glyph = getGlyph(charCode);
}
if (uvs == null) {
glyph = getGlyph(charCode);
} else {
int result = uvs.getGlyph(charCode, variationSelector);
if (result > 0) {
glyph = (char)(result & 0xFFFF);
} else {
glyph = getGlyph(charCode);
}
}
return glyph;

View File

@@ -109,18 +109,14 @@ public class CompositeGlyphMapper extends CharToGlyphMapper {
}
protected int convertToGlyph(int unicode) {
return convertToGlyph(unicode, 0);
}
protected int convertToGlyph(int unicode, int variationSelector) {
for (int slot = 0; slot < font.numSlots; slot++) {
if (!hasExcludes || !font.isExcludedChar(slot, unicode)) {
CharToGlyphMapper mapper = getSlotMapper(slot);
int glyphCode = mapper.charToVariationGlyph(unicode, variationSelector);
int glyphCode = mapper.charToGlyph(unicode);
if (glyphCode != mapper.getMissingGlyphCode()) {
glyphCode = compositeGlyphCode(slot, glyphCode);
if (variationSelector == 0) setCachedGlyphCode(unicode, glyphCode);
setCachedGlyphCode(unicode, glyphCode);
return glyphCode;
}
}
@@ -128,28 +124,6 @@ public class CompositeGlyphMapper extends CharToGlyphMapper {
return missingGlyph;
}
@Override
public int charToVariationGlyph(int unicode, int variationSelector) {
if (variationSelector == 0) return charToGlyph(unicode);
else {
int glyph = convertToGlyph(unicode, variationSelector);
// Glyph variation not found, fallback to base glyph.
// In fallback from variation glyph we ignore excluded chars,
// this is needed for proper display of monochrome emoji (\ufe0e)
if (glyph == missingGlyph) {
for (int slot = 0; slot < font.numSlots; slot++) {
CharToGlyphMapper mapper = getSlotMapper(slot);
glyph = mapper.charToGlyph(unicode);
if (glyph != mapper.getMissingGlyphCode()) {
glyph = compositeGlyphCode(slot, glyph);
break;
}
}
}
return glyph;
}
}
public int getNumGlyphs() {
int numGlyphs = 0;
/* The number of glyphs in a composite is affected by

View File

@@ -214,9 +214,4 @@ public final class CompositeStrike extends FontStrike {
return path;
}
}
GlyphRenderData getGlyphRenderData(int glyphCode, float x, float y) {
PhysicalStrike strike = getStrikeForGlyph(glyphCode);
return strike.getGlyphRenderData(glyphCode & SLOTMASK, x, y);
}
}

View File

@@ -234,16 +234,6 @@ public abstract class FileFont extends PhysicalFont {
}
}
public GlyphRenderData getGlyphRenderData(long pScalerContext, int glyphCode,
float x, float y) {
try {
return getScaler().getGlyphRenderData(pScalerContext, glyphCode, x, y);
} catch (FontScalerException fe) {
scaler = FontScaler.getNullScaler();
return getGlyphRenderData(pScalerContext, glyphCode, x, y);
}
}
/* T1 & TT implementation differ so this method is abstract.
NB: null should not be returned here! */
protected abstract FontScaler getScaler();

View File

@@ -1038,36 +1038,6 @@ public class FileFontStrike extends PhysicalStrike {
glyphs, glyphs.length, x, y);
}
private
WeakReference<ConcurrentHashMap<Integer, GlyphRenderData>> glyphRenderDataMapRef;
GlyphRenderData getGlyphRenderData(int glyphCode, float x, float y) {
GlyphRenderData grd = null;
ConcurrentHashMap<Integer, GlyphRenderData> glyphRenderDataMap = null;
if (glyphRenderDataMapRef != null) {
glyphRenderDataMap = glyphRenderDataMapRef.get();
if (glyphRenderDataMap != null) {
grd = glyphRenderDataMap.get(glyphCode);
}
}
if (grd == null) {
grd = fileFont.getGlyphRenderData(pScalerContext, glyphCode, 0, 0);
if (glyphRenderDataMap == null) {
glyphRenderDataMap = new ConcurrentHashMap<>();
glyphRenderDataMapRef = new WeakReference<>(glyphRenderDataMap);
}
glyphRenderDataMap.put(glyphCode, grd);
}
grd = new GlyphRenderData(grd); // mutable!
if (x != 0f || y != 0f) {
grd.transform(AffineTransform.getTranslateInstance(x, y));
}
return grd;
}
protected void adjustPoint(Point2D.Float pt) {
if (invertDevTx != null) {
invertDevTx.deltaTransform(pt, pt);

View File

@@ -118,34 +118,14 @@ public final class FontRunIterator {
}
int ch = nextCodePoint(lim);
int nch = nextCodePoint(lim);
int vs = CharToGlyphMapper.isVariationSelector(nch) ? nch : 0;
int sl = mapper.charToVariationGlyph(ch, vs) & CompositeGlyphMapper.SLOTMASK;
int sl = mapper.charToGlyph(ch) & CompositeGlyphMapper.SLOTMASK;
slot = sl >>> 24;
do {
if (vs == 0) {
ch = nch;
} else {
ch = nextCodePoint(lim);
}
nch = nextCodePoint(lim);
vs = CharToGlyphMapper.isVariationSelector(nch) ? nch : 0;
} while(ch != DONE && isSameRun(ch, vs, sl));
pushback(nch);
while ((ch = nextCodePoint(lim)) != DONE && (mapper.charToGlyph(ch) & CompositeGlyphMapper.SLOTMASK) == sl);
pushback(ch);
return true;
}
private boolean isSameRun(int ch, int variationSelector, int currentSlot) {
// Every font is meant to be able to render format chars
// So we make format chars stick to the current font run
if (CMap.getFormatCharGlyph(ch) == CharToGlyphMapper.INVISIBLE_GLYPH_ID) {
return true;
}
return (mapper.charToVariationGlyph(ch, variationSelector) & CompositeGlyphMapper.SLOTMASK) == currentSlot;
}
public boolean next() {
return next(Script.COMMON, limit);
}

View File

@@ -168,10 +168,6 @@ public abstract class FontScaler implements DisposerRecord {
int numGlyphs, float x, float y)
throws FontScalerException;
abstract GlyphRenderData getGlyphRenderData(long pScalerContext, int glyphCode,
float x, float y)
throws FontScalerException;
/* Used by Java2D disposer to ensure native resources are released.
Note: this method does not release any of created
scaler context objects! */

View File

@@ -76,6 +76,5 @@ public abstract class FontStrike {
abstract GeneralPath
getGlyphVectorOutline(int[] glyphs, float x, float y);
abstract GlyphRenderData getGlyphRenderData(int glyphCode, float x, float y);
}

View File

@@ -155,7 +155,7 @@ public final class FontUtilities {
* where the caller interprets 'layout' to mean any case where
* one 'char' (ie the java type char) does not map to one glyph
*/
public static final int MAX_LAYOUT_CHARCODE = CharToGlyphMapper.VSS_END;
public static final int MAX_LAYOUT_CHARCODE = 0x20F0;
/**
* Calls the private getFont2D() method in java.awt.Font objects.
@@ -322,19 +322,7 @@ public final class FontUtilities {
else if (code >= 0x206a && code <= 0x206f) { // directional control
return true;
}
else if (code >= 0x20d0 && code <= 0x20f0) { // U+20D0 - U+20F0 combining diacritical marks for symbols
return true;
}
else if (code >= 0x1f1e6 && code <= 0x1f1ff) { // U+1F1E6 - U+1F1FF flag letters https://emojipedia.org/emoji-flag-sequence/
return true;
}
else if (code == 0x1f3f4) { // black flag https://emojipedia.org/emoji-tag-sequence/
return true;
}
else if (code >= 0x1f3fb && code <= 0x1f3ff) { // U+1F3FB - U+1F3FF emoji modifiers
return true;
}
else if (CharToGlyphMapper.isVariationSelector(code)) {
else if (code >= 0x20d0) { // U+20D0 - U+20F0 combining diacritical marks for symbols
return true;
}
return false;

View File

@@ -194,21 +194,6 @@ class FreetypeFontScaler extends FontScaler {
.getNullScaler().getGlyphVectorOutline(0L, glyphs, numGlyphs, x, y);
}
synchronized GlyphRenderData getGlyphRenderData(long pScalerContext, int glyphCode,
float x, float y) throws FontScalerException {
if (nativeScaler != 0L) {
GlyphRenderData result = new GlyphRenderData();
getGlyphRenderDataNative(font.get(),
pScalerContext,
nativeScaler,
glyphCode,
x, y, result);
return result;
}
return FontScaler.getNullScaler().
getGlyphRenderData(0L, glyphCode, x,y);
}
/* This method should not be called directly, in case
* it is being invoked from a thread with a native context.
*/
@@ -299,9 +284,6 @@ class FreetypeFontScaler extends FontScaler {
private native GeneralPath getGlyphVectorOutlineNative(Font2D font,
long pScalerContext, long pScaler,
int[] glyphs, int numGlyphs, float x, float y);
private native void getGlyphRenderDataNative(Font2D font, long pScalerContext,
long pScaler, int glyphCode,
float x, float y, GlyphRenderData result);
private native Point2D.Float getGlyphPointNative(Font2D font,
long pScalerContext, long pScaler, int glyphCode, int ptNumber);

View File

@@ -1,168 +0,0 @@
/*
* Copyright 2000-2022 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.font;
import jdk.internal.misc.Unsafe;
import java.awt.*;
import java.awt.color.ColorSpace;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.image.*;
import java.util.ArrayList;
import java.util.List;
/**
* Data for rendering any number of glyphs bypassing glyph cache.
*/
public class GlyphRenderData {
public GeneralPath outline;
public List<ColorLayer> colorLayers;
public List<Bitmap> bitmaps;
public GlyphRenderData() {}
public GlyphRenderData(GlyphRenderData i) {
if (i.outline != null) outline = (GeneralPath) i.outline.clone();
if (i.colorLayers != null) {
colorLayers = new ArrayList<>(i.colorLayers.size());
for (ColorLayer l : i.colorLayers) {
colorLayers.add(new ColorLayer(l.color, (GeneralPath) l.outline.clone()));
}
}
if (i.bitmaps != null) {
bitmaps = new ArrayList<>(i.bitmaps.size());
for (Bitmap b : i.bitmaps) {
bitmaps.add(new Bitmap(new AffineTransform(b.transform), b.image));
}
}
}
/**
* @param i must not be used afterwards
*/
public void merge(GlyphRenderData i) {
if (i.outline != null) {
if (outline == null) outline = i.outline;
else outline.append(i.outline.getPathIterator(null), false);
}
if (i.colorLayers != null) {
if (colorLayers == null) colorLayers = i.colorLayers;
else colorLayers.addAll(i.colorLayers);
}
if (i.bitmaps != null) {
if (bitmaps == null) bitmaps = i.bitmaps;
else bitmaps.addAll(i.bitmaps);
}
}
public void transform(AffineTransform transform) {
if (outline != null) outline.transform(transform);
if (colorLayers != null) {
for (ColorLayer layer : colorLayers) {
layer.outline.transform(transform);
}
}
if (bitmaps != null) {
for (Bitmap bitmap : bitmaps) {
bitmap.transform.preConcatenate(transform);
}
}
}
public void draw(Graphics2D g) {
if (outline != null) g.fill(outline);
if (colorLayers != null) {
Color color = g.getColor();
for (ColorLayer layer : colorLayers) {
g.setColor(layer.color == null ? color : layer.color);
g.fill(layer.outline);
}
g.setColor(color);
}
if (bitmaps != null) {
for (Bitmap bitmap : bitmaps) {
g.drawImage(bitmap.image, bitmap.transform, null);
}
}
}
public record ColorLayer(Color color, GeneralPath outline) {}
public record Bitmap(AffineTransform transform, Image image) {}
// These methods exist for convenience and are called from native
private void setColorLayersList(int capacity) {
colorLayers = new ArrayList<>(capacity);
}
private void addColorLayers(GeneralPath outline) {
colorLayers.add(new ColorLayer(null, outline));
}
private void addColorLayers(int r, int g, int b, int a, GeneralPath outline) {
colorLayers.add(new ColorLayer(new Color(r, g, b, a), outline));
}
private static DirectColorModel colorModel(boolean premultiplied, int bits, int r, int g, int b, int a) {
if (Unsafe.getUnsafe().isBigEndian()) {
r = Integer.reverse(r) >>> (32 - bits);
g = Integer.reverse(g) >>> (32 - bits);
b = Integer.reverse(b) >>> (32 - bits);
a = Integer.reverse(a) >>> (32 - bits);
}
return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
bits, r, g, b, a, premultiplied, DataBuffer.TYPE_INT);
}
private static final DirectColorModel[] BITMAP_COLOR_MODELS = {
colorModel(false, 32, // macOS RGBA
0x000000ff,
0x0000ff00,
0x00ff0000,
0xff000000),
colorModel(false, 32, // macOS ARGB
0x0000ff00,
0x00ff0000,
0xff000000,
0x000000ff),
colorModel(true, 32, // Freetype BGRA
0x00ff0000,
0x0000ff00,
0x000000ff,
0xff000000)
};
private void addBitmap(double m00, double m10,
double m01, double m11,
double m02, double m12,
int width, int height, int pitch,
int colorModel, int[] data) {
if (bitmaps == null) bitmaps = new ArrayList<>();
DirectColorModel color = BITMAP_COLOR_MODELS[colorModel];
DataBuffer buffer = new DataBufferInt(data, data.length);
WritableRaster raster = Raster.createPackedRaster(buffer, width, height, pitch, color.getMasks(), null);
BufferedImage image = new BufferedImage(color, raster, color.isAlphaPremultiplied(), null);
bitmaps.add(new Bitmap(new AffineTransform(m00, m10, m01, m11, m02, m12), image));
}
}

View File

@@ -64,11 +64,6 @@ class NullFontScaler extends FontScaler {
return new GeneralPath();
}
GlyphRenderData getGlyphRenderData(long pScalerContext, int glyphCode,
float x, float y) {
return new GlyphRenderData();
}
long createScalerContext(double[] matrix, int aa,
int fm, float boldness, float italic) {
return getNullScalerContext();

View File

@@ -876,21 +876,6 @@ public class StandardGlyphVector extends GlyphVector {
return result;
}
public GlyphRenderData getGlyphRenderData(float x, float y) {
setFRCTX();
initPositions();
GlyphRenderData result = new GlyphRenderData();
for (int i = 0, n = 0; i < glyphs.length; ++i, n += 2) {
float px = x + positions[n];
float py = y + positions[n+1];
getGlyphStrike(i).appendGlyphRenderData(glyphs[i], result, px, py);
}
return result;
}
//////////////////////
// StandardGlyphVector package private methods
/////////////////////
@@ -1840,19 +1825,6 @@ public class StandardGlyphVector extends GlyphVector {
PathIterator iterator = gp.getPathIterator(null);
result.append(iterator, false);
}
void appendGlyphRenderData(int glyphID, GlyphRenderData result, float x, float y) {
// !!! fontStrike needs a method for this. For that matter, GeneralPath does.
GlyphRenderData grd;
if (sgv.invdtx == null) {
grd = strike.getGlyphRenderData(glyphID, x + dx, y + dy);
} else {
grd = strike.getGlyphRenderData(glyphID, 0, 0);
grd.transform(sgv.invdtx);
grd.transform(AffineTransform.getTranslateInstance(x + dx, y + dy));
}
result.merge(grd);
}
}
public String toString() {

View File

@@ -366,10 +366,10 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
jreFontMap.put("JetBrainsMono-Thin.ttf", new BundledFontInfo("JetBrainsMono-Thin", 2, 225, 0));
jreFontMap.put("JetBrainsMono-ThinItalic.ttf", new BundledFontInfo("JetBrainsMono-ThinItalic", 2, 225, 0));
jreFontMap.put("Inter-SemiBold.otf", new BundledFontInfo("Inter-SemiBold", 3, 19, 0));
jreFontMap.put("Inter-Bold.otf", new BundledFontInfo("Inter-Bold", 3, 19, 0));
jreFontMap.put("Inter-Regular.otf", new BundledFontInfo("Inter-Regular", 3, 19, 0));
jreFontMap.put("Inter-Italic.otf", new BundledFontInfo("Inter-Italic", 3, 19, 0));
jreFontMap.put("Inter-SemiBoldItalic.otf", new BundledFontInfo("Inter-SemiBoldItalic", 3, 19, 0));
jreFontMap.put("Inter-BoldItalic.otf", new BundledFontInfo("Inter-BoldItalic", 3, 19, 0));
jreBundledFontFiles.addAll(jreFontMap.keySet());
}

View File

@@ -28,13 +28,12 @@ package sun.java2d.pipe;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.TextLayout;
import sun.font.GlyphRenderData;
import sun.font.StandardGlyphVector;
import sun.java2d.SunGraphics2D;
import sun.awt.SunHints;
import java.awt.geom.GeneralPath;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.font.TextLayout;
/**
* A delegate pipe of SG2D for drawing "large" text with
@@ -79,22 +78,36 @@ public class OutlineTextRenderer implements TextPipe {
}
TextLayout tl = new TextLayout(str, g2d.getFont(),
g2d.getFontRenderContext());
Shape s = tl.getOutline(AffineTransform.getTranslateInstance(x, y));
// This will end up calling our drawGlyphVector
tl.draw(g2d, (float) x, (float) y);
int textAAHint = g2d.getFontInfo().aaHint;
int prevaaHint = - 1;
if (textAAHint != SunHints.INTVAL_TEXT_ANTIALIAS_OFF &&
g2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) {
prevaaHint = g2d.antialiasHint;
g2d.antialiasHint = SunHints.INTVAL_ANTIALIAS_ON;
g2d.validatePipe();
} else if (textAAHint == SunHints.INTVAL_TEXT_ANTIALIAS_OFF
&& g2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_OFF) {
prevaaHint = g2d.antialiasHint;
g2d.antialiasHint = SunHints.INTVAL_ANTIALIAS_OFF;
g2d.validatePipe();
}
g2d.fill(s);
if (prevaaHint != -1) {
g2d.antialiasHint = prevaaHint;
g2d.validatePipe();
}
}
public void drawGlyphVector(SunGraphics2D g2d, GlyphVector gv,
float x, float y) {
GlyphRenderData grd;
if (gv instanceof StandardGlyphVector) {
grd = ((StandardGlyphVector) gv).getGlyphRenderData(x, y);
} else {
grd = new GlyphRenderData();
grd.outline = new GeneralPath(gv.getOutline(x, y));
}
Shape s = gv.getOutline(x, y);
int prevaaHint = - 1;
FontRenderContext frc = gv.getFontRenderContext();
boolean aa = frc.isAntiAliased();
@@ -121,7 +134,7 @@ public class OutlineTextRenderer implements TextPipe {
g2d.validatePipe();
}
grd.draw(g2d);
g2d.fill(s);
if (prevaaHint != -1) {
g2d.antialiasHint = prevaaHint;

Binary file not shown.

Binary file not shown.

View File

@@ -80,12 +80,6 @@ typedef struct FontManagerNativeIDs {
/* sun/font/GlyphList */
jfieldID glyphListX, glyphListY, glyphListLen,
glyphImages, glyphListUsePos, glyphListPos, lcdRGBOrder, lcdSubPixPos;
/* sun/font/GlyphRenderData */
jfieldID glyphRenderDataOutline, glyphRenderDataColorLayers;
jmethodID glyphRenderDataSetColorLayersListMID,
glyphRenderDataAddColorLayerMID, glyphRenderDataAddColorLayerFGMID,
glyphRenderDataAddBitmapMID;
} FontManagerNativeIDs;
/* Note: we share variable in the context of fontmanager lib

View File

@@ -56,16 +56,6 @@
#include FT_MODULE_H
#include FT_LCD_FILTER_H
// Linux is built with system Freetype by default,
// and it's often a bit old and doesn't have FT_COLOR_H.
// Thus, we disable colored outlines on Linux to be able
// to build on older Linuxes, this is not a big problem,
// as Linux uses bitmap emoji anyway.
#if defined(_WIN32) || defined(MACOSX)
#include FT_COLOR_H
#define ENABLE_COLOR_OUTLINES
#endif
#ifndef DISABLE_FONTCONFIG
/* Use bundled fontconfig.h for now */
#include "fontconfig.h"
@@ -97,7 +87,6 @@
#define ROUND(x) ((int) ((x<0) ? (x-0.5) : (x+0.5)))
#define FT26Dot6ToDouble(x) ((x) / ((double) (1<<6)))
#define FT26Dot6ToInt(x) (((int)(x)) >> 6)
#define FT26Dot6ToIntRound(x) (((int)(x + (1 << 5))) >> 6)
#define FT26Dot6ToIntCeil(x) (((int)(x - 1 + (1 << 6))) >> 6)
#define IntToFT26Dot6(x) (((FT_Fixed)(x)) << 6)
#define DEFAULT_DPI 72
@@ -139,12 +128,6 @@ typedef struct CachedMatch {
#define NUM_CACHED_VALUES 8
#endif
// Define these manually when building with old Freetype (before 2.5)
#if !defined(FT_LOAD_COLOR)
#define FT_LOAD_COLOR ( 1L << 20 )
#define FT_PIXEL_MODE_BGRA 7
#endif
typedef struct {
/* Important note:
JNI forbids sharing same env between different threads.
@@ -633,7 +616,7 @@ static void setInterpreterVersion(FT_Library library) {
((FT_MulFix(units_per_EM, y_scale) / BOLD_DIVISOR ))
#define BOLD_MODIFIER(units_per_EM, y_scale) \
((context->doBold && !context->colorFont) ? BOLD_FACTOR(units_per_EM, y_scale) : 0)
(context->doBold ? BOLD_FACTOR(units_per_EM, y_scale) : 0)
static void GlyphSlot_Embolden(FT_GlyphSlot slot, FT_Matrix transform) {
FT_Pos extra = 0;
@@ -895,7 +878,7 @@ static void setupLoadRenderFlags(FTScalerContext *context, int fcHintStyle, FcBo
static void setupTransform(FT_Matrix* target, FTScalerContext *context) {
FT_Matrix* transform = &context->transform;
if (context->doItalize && !context->colorFont) {
if (context->doItalize) {
// we cannot use FT_GlyphSlot_Oblique as it doesn't work well with arbitrary transforms,
// so we add corresponding shear transform to the requested glyph transformation
target->xx = FT_MATRIX_ONE;
@@ -936,18 +919,18 @@ static int setupFTContext(JNIEnv *env, jobject font2D, FTScalerInfo *scalerInfo,
scalerInfo->font2D = font2D;
if (context != NULL) {
context->colorFont = FT_HAS_COLOR(scalerInfo->face) || !FT_IS_SCALABLE(scalerInfo->face);
setupTransform(&matrix, context);
FT_Set_Transform(scalerInfo->face, &matrix, NULL);
FT_UInt dpi = (FT_UInt) getScreenResolution(env);
if (FT_IS_SCALABLE(scalerInfo->face)) { // Standard scalable face
context->colorFont = FT_HAS_COLOR(scalerInfo->face) ? TRUE : FALSE;
context->fixedSizeIndex = -1;
errCode = FT_Set_Char_Size(scalerInfo->face, 0,
ADJUST_FONT_SIZE(context->ptsz, dpi),
dpi, dpi);
} else { // Non-scalable face (that should only be bitmap faces)
context->colorFont = TRUE;
const int ptsz = context->ptsz;
// Best size is smallest, but not smaller than requested
int bestSizeIndex = 0;
@@ -1217,8 +1200,7 @@ static int setupFTContext(JNIEnv *env, jobject font2D, FTScalerInfo *scalerInfo,
}
// using same values as for the transformation matrix
#define OBLIQUE_MODIFIER(y) \
((context->doItalize && !context->colorFont) ? ((y)*FT_MATRIX_OBLIQUE_XY/FT_MATRIX_ONE) : 0)
#define OBLIQUE_MODIFIER(y) (context->doItalize ? ((y)*FT_MATRIX_OBLIQUE_XY/FT_MATRIX_ONE) : 0)
/*
* Class: sun_font_FreetypeFontScaler
@@ -1367,7 +1349,7 @@ static jlong
getGlyphImageNativeInternal(
JNIEnv *env, jobject scaler, jobject font2D,
jlong pScalerContext, jlong pScaler, jint glyphCode,
jboolean renderImage, jboolean setupContext);
jboolean renderImage);
/*
* Class: sun_font_FreetypeFontScaler
@@ -1396,7 +1378,7 @@ Java_sun_font_FreetypeFontScaler_getGlyphAdvanceNative(
jlong image;
image = getGlyphImageNativeInternal(
env, scaler, font2D, pScalerContext, pScaler, glyphCode, JNI_FALSE, JNI_TRUE);
env, scaler, font2D, pScalerContext, pScaler, glyphCode, JNI_FALSE);
info = (GlyphInfo*) jlong_to_ptr(image);
if (info != NULL) {
@@ -1422,7 +1404,7 @@ Java_sun_font_FreetypeFontScaler_getGlyphMetricsNative(
jlong image = getGlyphImageNativeInternal(
env, scaler, font2D,
pScalerContext, pScaler, glyphCode, JNI_FALSE, JNI_TRUE);
pScalerContext, pScaler, glyphCode, JNI_FALSE);
info = (GlyphInfo*) jlong_to_ptr(image);
if (info != NULL) {
@@ -1732,14 +1714,14 @@ Java_sun_font_FreetypeFontScaler_getGlyphImageNative(
return getGlyphImageNativeInternal(
env, scaler, font2D,
pScalerContext, pScaler, glyphCode, JNI_TRUE, JNI_TRUE);
pScalerContext, pScaler, glyphCode, JNI_TRUE);
}
static jlong
getGlyphImageNativeInternal(
JNIEnv *env, jobject scaler, jobject font2D,
jlong pScalerContext, jlong pScaler, jint glyphCode,
jboolean renderImage, jboolean setupContext) {
jboolean renderImage) {
static int PADBYTES = 3;
int error, imageSize;
@@ -1789,13 +1771,11 @@ static jlong
((double)context->ptsz)/64.0);
}
if (setupContext) {
error = setupFTContext(env, font2D, scalerInfo, context, TRUE);
if (error) {
if (logFFS) fprintf(stderr, "FFS_LOG: Cannot setup FT context\n");
invalidateJavaScaler(env, scaler, scalerInfo);
return ptr_to_jlong(getNullGlyphImage());
}
error = setupFTContext(env, font2D, scalerInfo, context, TRUE);
if (error) {
if (logFFS) fprintf(stderr, "FFS_LOG: Cannot setup FT context\n");
invalidateJavaScaler(env, scaler, scalerInfo);
return ptr_to_jlong(getNullGlyphImage());
}
/*
@@ -1962,13 +1942,13 @@ static jlong
(float) - (advh * FTFixedToFloat(context->transform.yx));
} else {
if (!ftglyph->advance.y) {
glyphInfo->advanceX = FT26Dot6ToIntRound(
FT_MulFix(ftglyph->advance.x, manualScale));
glyphInfo->advanceX =
(float) ROUND(FT26Dot6ToFloat(FT_MulFix(ftglyph->advance.x, manualScale)));
glyphInfo->advanceY = 0;
} else if (!ftglyph->advance.x) {
glyphInfo->advanceX = 0;
glyphInfo->advanceY = FT26Dot6ToIntRound(
-FT_MulFix(ftglyph->advance.y, manualScale));
glyphInfo->advanceY =
(float) ROUND(FT26Dot6ToFloat(-FT_MulFix(ftglyph->advance.y, manualScale)));
} else {
glyphInfo->advanceX = FT26Dot6ToFloat(
FT_MulFix(ftglyph->advance.x, manualScale));
@@ -2164,13 +2144,24 @@ Java_sun_font_FreetypeFontScaler_getGlyphCodeNative(
#define FloatToF26Dot6(x) ((unsigned int) ((x)*64))
static FT_Outline* getFTOutlineNoSetup(FTScalerContext *context, FTScalerInfo* scalerInfo,
jint glyphCode, jfloat xpos, jfloat ypos) {
static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D,
FTScalerContext *context, FTScalerInfo* scalerInfo,
jint glyphCode, jfloat xpos, jfloat ypos) {
FT_Error error;
FT_GlyphSlot ftglyph;
FT_Int32 loadFlags;
if (glyphCode >= INVISIBLE_GLYPHS ||
isNullScalerContext(context) || scalerInfo == NULL) {
return NULL;
}
error = setupFTContext(env, font2D, scalerInfo, context, TRUE);
if (error) {
return NULL;
}
// We cannot get an outline from bitmap version of glyph
loadFlags = FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP;
@@ -2180,10 +2171,9 @@ static FT_Outline* getFTOutlineNoSetup(FTScalerContext *context, FTScalerInfo* s
}
ftglyph = scalerInfo->face->glyph;
int outlineGlyph = ftglyph->format == FT_GLYPH_FORMAT_OUTLINE;
/* apply styles */
if (context->doBold && outlineGlyph && !context->colorFont) { /* if bold style */
if (context->doBold) { /* if bold style */
GlyphSlot_Embolden(ftglyph, context->transform);
}
@@ -2194,24 +2184,6 @@ static FT_Outline* getFTOutlineNoSetup(FTScalerContext *context, FTScalerInfo* s
return &ftglyph->outline;
}
static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D,
FTScalerContext *context, FTScalerInfo* scalerInfo,
jint glyphCode, jfloat xpos, jfloat ypos) {
FT_Error error;
if (glyphCode >= INVISIBLE_GLYPHS ||
isNullScalerContext(context) || scalerInfo == NULL) {
return NULL;
}
error = setupFTContext(env, font2D, scalerInfo, context, TRUE);
if (error) {
return NULL;
}
return getFTOutlineNoSetup(context, scalerInfo, glyphCode, xpos, ypos);
}
#define F26Dot6ToFloat(n) (((float)(n))/((float) 64))
/* Types of GeneralPath segments.
@@ -2368,13 +2340,19 @@ static void freeGP(GPData* gpdata) {
}
}
static jobject outlineToGeneralPath(JNIEnv* env, FT_Outline* outline) {
static jobject getGlyphGeneralPath(JNIEnv* env, jobject font2D,
FTScalerContext *context, FTScalerInfo *scalerInfo,
jint glyphCode, jfloat xpos, jfloat ypos) {
FT_Outline* outline;
jobject gp = NULL;
jbyteArray types;
jfloatArray coords;
GPData gpdata;
outline = getFTOutline(env, font2D, context, scalerInfo,
glyphCode, xpos, ypos);
if (outline == NULL || outline->n_points == 0) {
return gp;
}
@@ -2412,75 +2390,6 @@ static jobject outlineToGeneralPath(JNIEnv* env, FT_Outline* outline) {
return gp;
}
static jboolean addColorLayersRenderData(JNIEnv* env, FTScalerContext *context,
FTScalerInfo* scalerInfo, jint glyphCode,
jfloat xpos, jfloat ypos, jobject result) {
#ifdef ENABLE_COLOR_OUTLINES
FT_Error error;
FT_Color* colors;
error = FT_Palette_Select(scalerInfo->face, 0, &colors);
if (error) return JNI_FALSE;
FT_LayerIterator iterator;
iterator.p = NULL;
FT_UInt glyphIndex, colorIndex;
if (!FT_Get_Color_Glyph_Layer(scalerInfo->face, glyphCode,
&glyphIndex, &colorIndex, &iterator)) return JNI_FALSE;
(*env)->CallVoidMethod(env, result, sunFontIDs.glyphRenderDataSetColorLayersListMID, iterator.num_layers);
do {
FT_Outline* outline = getFTOutlineNoSetup(context, scalerInfo, glyphIndex, xpos, ypos);
jobject gp = outlineToGeneralPath(env, outline);
if (colorIndex == 0xFFFF) {
(*env)->CallVoidMethod(env, result, sunFontIDs.glyphRenderDataAddColorLayerFGMID, gp);
} else {
(*env)->CallVoidMethod(env, result, sunFontIDs.glyphRenderDataAddColorLayerMID,
colors[colorIndex].red, colors[colorIndex].green,
colors[colorIndex].blue, colors[colorIndex].alpha, gp);
}
} while(FT_Get_Color_Glyph_Layer(scalerInfo->face, glyphCode,
&glyphIndex, &colorIndex, &iterator));
return JNI_TRUE;
#else
return JNI_FALSE;
#endif
}
static void addBitmapRenderData(JNIEnv *env, jobject scaler, jobject font2D,
FTScalerContext *context, FTScalerInfo* scalerInfo,
jint glyphCode, jfloat xpos, jfloat ypos, jobject result) {
GlyphInfo* glyphInfo = (GlyphInfo*) jlong_to_ptr(getGlyphImageNativeInternal(
env, scaler, font2D,
ptr_to_jlong(context), ptr_to_jlong(scalerInfo),
glyphCode, JNI_FALSE, JNI_FALSE));
FT_GlyphSlot ftglyph = scalerInfo->face->glyph;
if (ftglyph->bitmap.pixel_mode != FT_PIXEL_MODE_BGRA) return;
int pitch = ftglyph->bitmap.pitch / 4;
int size = pitch * ftglyph->bitmap.rows;
jintArray array = (*env)->NewIntArray(env, size);
(*env)->SetIntArrayRegion(env, array, 0, size, (jint*) ftglyph->bitmap.buffer);
double bitmapSize = (double) scalerInfo->face->available_sizes[context->fixedSizeIndex].size;
double scale = (double) context->ptsz / bitmapSize / (double) (ftFixed1);
double tx = ftglyph->bitmap_left + xpos * bitmapSize / (double) context->ptsz;
double ty = -ftglyph->bitmap_top + ypos * bitmapSize / (double) context->ptsz;
jdouble m00 = (jdouble) context->transform.xx * scale, m10 = (jdouble) context->transform.xy * scale;
jdouble m01 = (jdouble) context->transform.yx * scale, m11 = (jdouble) context->transform.yy * scale;
jdouble m02 = m00 * tx + m01 * ty, m12 = m10 * tx + m11 * ty;
free(glyphInfo);
(*env)->CallVoidMethod(env, result, sunFontIDs.glyphRenderDataAddBitmapMID,
m00, m10, m01, m11, m02, m12,
ftglyph->bitmap.width, ftglyph->bitmap.rows, pitch, 2, array);
}
/*
* Class: sun_font_FreetypeFontScaler
* Method: getGlyphOutlineNative
@@ -2495,10 +2404,13 @@ Java_sun_font_FreetypeFontScaler_getGlyphOutlineNative(
(FTScalerContext*) jlong_to_ptr(pScalerContext);
FTScalerInfo* scalerInfo = (FTScalerInfo *) jlong_to_ptr(pScaler);
FT_Outline* outline = getFTOutline(env, font2D, context,
scalerInfo, glyphCode,
xpos, ypos);
jobject gp = outlineToGeneralPath(env, outline);
jobject gp = getGlyphGeneralPath(env,
font2D,
context,
scalerInfo,
glyphCode,
xpos,
ypos);
if (gp == NULL) { /* can be legal */
gp = (*env)->NewObject(env,
sunFontIDs.gpClass,
@@ -2646,42 +2558,6 @@ Java_sun_font_FreetypeFontScaler_getGlyphVectorOutlineNative(
return (*env)->NewObject(env, sunFontIDs.gpClass, sunFontIDs.gpCtrEmpty);
}
/*
* Class: sun_font_FreetypeFontScaler
* Method: getGlyphRenderDataNative
* Signature: (Lsun/font/Font2D;JIFFLsun/font/GlyphRenderData;)V
*/
JNIEXPORT void JNICALL
Java_sun_font_FreetypeFontScaler_getGlyphRenderDataNative(
JNIEnv *env, jobject scaler, jobject font2D, jlong pScalerContext,
jlong pScaler, jint glyphCode, jfloat xpos, jfloat ypos, jobject result) {
FTScalerContext *context =
(FTScalerContext*) jlong_to_ptr(pScalerContext);
FTScalerInfo* scalerInfo = (FTScalerInfo *) jlong_to_ptr(pScaler);
if (glyphCode >= INVISIBLE_GLYPHS ||
isNullScalerContext(context) || scalerInfo == NULL) {
return;
}
FT_Error error = setupFTContext(env, font2D, scalerInfo, context, TRUE);
if (error) return;
if (context->fixedSizeIndex == -1) {
if (!context->colorFont ||
!addColorLayersRenderData(env, context, scalerInfo, glyphCode, xpos, ypos, result)) {
FT_Outline* outline = getFTOutlineNoSetup(context, scalerInfo, glyphCode, xpos, ypos);
jobject gp = outlineToGeneralPath(env, outline);
if (gp != NULL) {
(*env)->SetObjectField(env, result, sunFontIDs.glyphRenderDataOutline, gp);
}
}
} else {
addBitmapRenderData(env, scaler, font2D, context, scalerInfo, glyphCode, xpos, ypos, result);
}
}
JNIEXPORT jlong JNICALL
Java_sun_font_FreetypeFontScaler_getUnitsPerEMNative(
JNIEnv *env, jobject scaler, jlong pScaler) {

View File

@@ -189,20 +189,6 @@ static void initFontIDs(JNIEnv *env) {
CHECK_NULL(sunFontIDs.lcdSubPixPos =
(*env)->GetFieldID(env, tmpClass, "lcdSubPixPos", "Z"));
CHECK_NULL(tmpClass = (*env)->FindClass(env, "sun/font/GlyphRenderData"));
CHECK_NULL(sunFontIDs.glyphRenderDataOutline =
(*env)->GetFieldID(env, tmpClass, "outline", "Ljava/awt/geom/GeneralPath;"));
CHECK_NULL(sunFontIDs.glyphRenderDataColorLayers =
(*env)->GetFieldID(env, tmpClass, "colorLayers", "Ljava/util/List;"));
CHECK_NULL(sunFontIDs.glyphRenderDataSetColorLayersListMID =
(*env)->GetMethodID(env, tmpClass, "setColorLayersList", "(I)V"));
CHECK_NULL(sunFontIDs.glyphRenderDataAddColorLayerMID =
(*env)->GetMethodID(env, tmpClass, "addColorLayers", "(IIIILjava/awt/geom/GeneralPath;)V"));
CHECK_NULL(sunFontIDs.glyphRenderDataAddColorLayerFGMID =
(*env)->GetMethodID(env, tmpClass, "addColorLayers", "(Ljava/awt/geom/GeneralPath;)V"));
CHECK_NULL(sunFontIDs.glyphRenderDataAddBitmapMID =
(*env)->GetMethodID(env, tmpClass, "addBitmap", "(DDDDDDIIII[I)V"));
initLCDGammaTables();
initialisedFontIDs = 1;

View File

@@ -1,156 +0,0 @@
/****************************************************************************
*
* ftcolor.c
*
* FreeType's glyph color management (body).
*
* Copyright (C) 2018-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/sfnt.h>
#include <freetype/internal/tttypes.h>
#include <freetype/ftcolor.h>
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
static
const FT_Palette_Data null_palette_data = { 0, NULL, NULL, 0, NULL };
/* documentation is in ftcolor.h */
FT_EXPORT_DEF( FT_Error )
FT_Palette_Data_Get( FT_Face face,
FT_Palette_Data *apalette_data )
{
if ( !face )
return FT_THROW( Invalid_Face_Handle );
if ( !apalette_data)
return FT_THROW( Invalid_Argument );
if ( FT_IS_SFNT( face ) )
*apalette_data = ( (TT_Face)face )->palette_data;
else
*apalette_data = null_palette_data;
return FT_Err_Ok;
}
/* documentation is in ftcolor.h */
FT_EXPORT_DEF( FT_Error )
FT_Palette_Select( FT_Face face,
FT_UShort palette_index,
FT_Color* *apalette )
{
FT_Error error;
TT_Face ttface;
SFNT_Service sfnt;
if ( !face )
return FT_THROW( Invalid_Face_Handle );
if ( !FT_IS_SFNT( face ) )
{
if ( apalette )
*apalette = NULL;
return FT_Err_Ok;
}
ttface = (TT_Face)face;
sfnt = (SFNT_Service)ttface->sfnt;
error = sfnt->set_palette( ttface, palette_index );
if ( error )
return error;
ttface->palette_index = palette_index;
if ( apalette )
*apalette = ttface->palette;
return FT_Err_Ok;
}
/* documentation is in ftcolor.h */
FT_EXPORT_DEF( FT_Error )
FT_Palette_Set_Foreground_Color( FT_Face face,
FT_Color foreground_color )
{
TT_Face ttface;
if ( !face )
return FT_THROW( Invalid_Face_Handle );
if ( !FT_IS_SFNT( face ) )
return FT_Err_Ok;
ttface = (TT_Face)face;
ttface->foreground_color = foreground_color;
ttface->have_foreground_color = 1;
return FT_Err_Ok;
}
#else /* !TT_CONFIG_OPTION_COLOR_LAYERS */
FT_EXPORT_DEF( FT_Error )
FT_Palette_Data_Get( FT_Face face,
FT_Palette_Data *apalette_data )
{
FT_UNUSED( face );
FT_UNUSED( apalette_data );
return FT_THROW( Unimplemented_Feature );
}
FT_EXPORT_DEF( FT_Error )
FT_Palette_Select( FT_Face face,
FT_UShort palette_index,
FT_Color* *apalette )
{
FT_UNUSED( face );
FT_UNUSED( palette_index );
FT_UNUSED( apalette );
return FT_THROW( Unimplemented_Feature );
}
FT_EXPORT_DEF( FT_Error )
FT_Palette_Set_Foreground_Color( FT_Face face,
FT_Color foreground_color )
{
FT_UNUSED( face );
FT_UNUSED( foreground_color );
return FT_THROW( Unimplemented_Feature );
}
#endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */
/* END */

View File

@@ -114,7 +114,12 @@ final class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer {
try {
quit = !b;
if (b) {
new Thread(null, this::showNativeDialog, "ShowDialog", 0, false).start();
Runnable task = () -> {
showNativeDialog();
standaloneWindow = 0;
fd.setVisible(false);
};
new Thread(null, task, "ShowDialog", 0, false).start();
} else {
quit();
fd.setVisible(false);
@@ -203,13 +208,4 @@ final class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer {
}
return false;
}
/**
* Called by native code when GTK dialog is closing.
*/
private void onClose() {
widget = 0;
standaloneWindow = 0;
fd.setVisible(false);
}
}

View File

@@ -293,21 +293,15 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
* when a component inside a Frame is requesting focus.
* See 6314575 for details.
*/
boolean res = wpeer.requestWindowFocus(null);
if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
focusLog.finer("Requested window focus: " + res);
}
// If parent window can be made focused and has been made focused(synchronously)
// then we can proceed with children, otherwise we retreat.
if (!(res && parentWindow.isFocused())) {
return rejectFocusRequestHelper("Waiting for asynchronous processing of the request");
}
return XKeyboardFocusManagerPeer.deliverFocus(lightweightChild,
target,
temporary,
focusedWindowChangeAllowed,
time, cause);
return wpeer.requestWindowFocus(null, () -> {
XKeyboardFocusManagerPeer.deliverFocus(lightweightChild,
target,
temporary,
focusedWindowChangeAllowed,
time, cause);
}, () -> {
rejectFocusRequestHelper("Waiting for asynchronous processing of the request");
});
// Motif compatibility code
case XKeyboardFocusManagerPeer.SNFH_SUCCESS_HANDLED:
// Either lightweight or excessive request - all events are generated.

View File

@@ -415,10 +415,6 @@ abstract class XDecoratedPeer extends XWindowPeer {
insets_corrected = true;
reshape(dimensions, SET_SIZE, false);
} else if (xe.get_parent() == root) {
if (!isReparented()) {
// X server on Windows (e.g. Cygwin/X) does perform a no-op reparenting to the root window
return;
}
configure_seen = false;
insets_corrected = false;
@@ -1258,7 +1254,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
if (target == activeWindow && target != focusedWindow) {
// Happens when an owned window is currently focused
focusLog.fine("Focus is on child window - transferring it back to the owner");
handleWindowFocusInSync(-1);
handleWindowFocusInSync(-1, () -> {});
return true;
}
Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow();

View File

@@ -111,8 +111,7 @@ final class XWM
UNITY_COMPIZ_WM = 16,
XMONAD_WM = 17,
AWESOME_WM = 18,
I3_WM = 19,
WESTON_WM = 20;
I3_WM = 19;
public String toString() {
switch (WMID) {
@@ -152,8 +151,6 @@ final class XWM
return "Awesome";
case XWM.I3_WM:
return "I3WM";
case XWM.WESTON_WM:
return "Weston";
case UNDETERMINED_WM:
default:
return "Undetermined WM";
@@ -631,10 +628,6 @@ final class XWM
return isNetWMName("i3");
}
static boolean isWeston() {
return isNetWMName("Weston");
}
static int awtWMNonReparenting = -1;
static boolean isNonReparentingWM() {
if (awtWMNonReparenting == -1) {
@@ -840,8 +833,6 @@ final class XWM
awt_wmgr = XWM.AWESOME_WM;
} else if (isI3()) {
awt_wmgr = XWM.I3_WM;
} else if (isWeston()) {
awt_wmgr = XWM.WESTON_WM;
}
/*
* We don't check for legacy WM when we already know that WM

View File

@@ -424,13 +424,14 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
return false;
}
static void sendEvent(final AWTEvent e) {
static void sendEvent(final AWTEvent e, Runnable lightweigtRequestRunnable) {
// The uses of this method imply that the incoming event is system-generated
SunToolkit.setSystemGenerated(e);
PeerEvent pe = new PeerEvent(Toolkit.getDefaultToolkit(), new Runnable() {
public void run() {
AWTAccessor.getAWTEventAccessor().setPosted(e);
((Component)e.getSource()).dispatchEvent(e);
lightweigtRequestRunnable.run();
}
}, PeerEvent.ULTIMATE_PRIORITY_EVENT);
if (focusLog.isLoggable(PlatformLogger.Level.FINER) && (e instanceof FocusEvent)) {
@@ -439,6 +440,9 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), pe);
}
static void sendEvent(final AWTEvent e) {
sendEvent(e, () -> {});
}
/*
* Post an event to the event queue.

View File

@@ -618,16 +618,15 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
target.dispatchEvent(we);
}
}
public void handleWindowFocusInSync(long serial) {
public void handleWindowFocusInSync(long serial, Runnable lightweigtRequest) {
WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
sendEvent(we);
sendEvent(we, lightweigtRequest);
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
public void handleWindowFocusIn(long serial) {
handleWindowFocusInSync(serial);
handleWindowFocusInSync(serial, () -> {});
}
// NOTE: This method may be called by privileged threads.
@@ -848,7 +847,16 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
if (focusLog.isLoggable(PlatformLogger.Level.FINE)) {
focusLog.fine("Requesting window focus");
}
requestWindowFocus(time, timeProvided);
Runnable finishRunnable = this::dequeueKeyEvents;
requestWindowFocus(time, timeProvided, finishRunnable, finishRunnable);
}
private void dequeueKeyEvents() {
AWTAccessor.getKeyboardFocusManagerAccessor().dequeueKeyEvents(target);
}
private void enqueueKeyEvents() {
AWTAccessor.getKeyboardFocusManagerAccessor().enqueueKeyEvents(target);
}
public final boolean focusAllowedFor() {
@@ -1136,14 +1144,17 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
warningWindow.setSecurityWarningVisible(false, false);
}
boolean refreshChildsTransientFor = isVisible() != vis;
// To enable type-ahead for 'simple' windows, we initiate internal focus transfer to such a window even before
// it's mapped by a window manager. 'Simple' windows aren't natively focusable, so for this to work as expected
// we only need to be sure that the window will be mapped soon after we request it. There are known cases when
// window manager delays mapping the window for a long time (e.g. i3wm does this when another window is in
// full-screen mode), but no known cases when it does it for popup windows, so we hope that we're safe here with
// 'simple' windows.
if (vis && isSimpleWindow() && shouldFocusOnMapNotify()) {
requestInitialFocus();
// We enable type-ahead mechanism only for showing of simple windows. That's because, when enabling it,
// we need to be sure that the final state (focusing) of the target window will definitely be available
// very soon, not to block key events for a long period of time. As simple windows are not focused natively,
// the only event we should wait for before focusing them internally is MapNotify, and that event usually
// comes quite fast after map request. There are known cases when window manager delays mapping the window
// for a long time (e.g. i3wm does this when another window is in full-screen mode), but no known cases
// when it does it for popup windows, so we hope that we're safe here with simple windows. For decorated
// windows we also wait for the native focus to be transferred to the target window (FocusIn event),
// which adds to the uncertainty - the focus might or might not be transferred.
enqueueKeyEvents();
}
super.setVisible(vis);
if (refreshChildsTransientFor) {
@@ -1212,7 +1223,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
if (targetOwner != null) {
XWindowPeer xwndpeer = AWTAccessor.getComponentAccessor().getPeer(targetOwner);
if (xwndpeer != null) {
xwndpeer.requestWindowFocus();
xwndpeer.requestWindowFocus(() -> {}, () -> {});
}
}
}
@@ -1484,9 +1495,11 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
}
}
}
if (!isSimpleWindow() && shouldFocusOnMapNotify() && !XWM.isWeston()) {
if (shouldFocusOnMapNotify()) {
focusLog.fine("Automatically request focus on window");
requestInitialFocus();
} else {
dequeueKeyEvents();
}
isUnhiding = false;
isBeforeFirstMapNotify = false;
@@ -2038,16 +2051,25 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
return window;
}
public boolean requestWindowFocus(XWindowPeer actualFocusedWindow) {
public boolean requestWindowFocus(XWindowPeer actualFocusedWindow, Runnable lightweigtRequest, Runnable rejectFocusRequest) {
setActualFocusedWindow(actualFocusedWindow);
return requestWindowFocus();
return requestWindowFocus(lightweigtRequest, rejectFocusRequest);
}
public boolean requestWindowFocus() {
return requestWindowFocus(0, false);
return requestWindowFocus(() -> {}, () -> {});
}
public boolean requestWindowFocus(Runnable lightweigtRequest, Runnable rejectFocusRequest) {
return requestWindowFocus(0, false, lightweigtRequest, rejectFocusRequest);
}
public boolean requestWindowFocus(long time, boolean timeProvided) {
return requestWindowFocus(time, timeProvided, () -> {}, () -> {});
}
public boolean requestWindowFocus(long time, boolean timeProvided,
Runnable lightweigtRequest, Runnable rejectFocusRequest) {
focusLog.fine("Request for window focus");
// If this is Frame or Dialog we can't assure focus request success - but we still can try
// If this is Window and its owner Frame is active we can be sure request succedded.
@@ -2057,11 +2079,12 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
if (isWMStateNetHidden()) {
focusLog.fine("The window is unmapped, so rejecting the request");
rejectFocusRequest.run();
return false;
}
if (activeWindow == ownerWindow) {
focusLog.fine("Parent window is active - generating focus for this window");
handleWindowFocusInSync(-1);
handleWindowFocusInSync(-1, lightweigtRequest);
return true;
}
focusLog.fine("Parent window is not active");
@@ -2069,9 +2092,11 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
XDecoratedPeer wpeer = AWTAccessor.getComponentAccessor().getPeer(ownerWindow);
if (wpeer != null && wpeer.requestWindowFocus(this, time, timeProvided)) {
focusLog.fine("Parent window accepted focus request - generating focus for this window");
handleWindowFocusInSync(-1, lightweigtRequest);
return true;
}
focusLog.fine("Denied - parent window is not active and didn't accept focus request");
rejectFocusRequest.run();
return false;
}

View File

@@ -292,8 +292,4 @@ class NativeStrike extends PhysicalStrike {
return new GeneralPath();
}
GlyphRenderData getGlyphRenderData(int glyphCode, float x, float y) {
return new GlyphRenderData();
}
}

View File

@@ -67,7 +67,7 @@ public class X11TextRenderer extends GlyphListPipe {
}
}
native boolean doDrawGlyphList(long dstData, long xgc,
native void doDrawGlyphList(long dstData, long xgc,
Region clip, GlyphList gl);
protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
@@ -78,23 +78,7 @@ public class X11TextRenderer extends GlyphListPipe {
long xgc = x11sd.getRenderGC(clip, SunGraphics2D.COMP_ISCOPY,
null, sg2d.pixel);
gl.startGlyphIteration();
boolean allGlyphsRendered = doDrawGlyphList(x11sd.getNativeOps(), xgc, clip, gl);
// There are some color glyphs, which we couldn't draw
if (!allGlyphsRendered) {
gl.startGlyphIteration();
for (int i = 0; i < gl.getNumGlyphs(); i++) {
if (gl.isColorGlyph(i)) {
int end;
for (end = i + 1; end < gl.getNumGlyphs(); end++) {
if (!gl.isColorGlyph(end)) break;
}
sg2d.loops.drawGlyphListColorLoop.
DrawGlyphListColor(sg2d, sg2d.surfaceData,
gl, i, end);
i = end - 1;
} else gl.setGlyphIndex(i);
}
}
doDrawGlyphList(x11sd.getNativeOps(), xgc, clip, gl);
} finally {
SunToolkit.awtUnlock();
}
@@ -105,11 +89,11 @@ public class X11TextRenderer extends GlyphListPipe {
}
public static class Tracer extends X11TextRenderer {
boolean doDrawGlyphList(long dstData, long xgc,
void doDrawGlyphList(long dstData, long xgc,
Region clip, GlyphList gl)
{
GraphicsPrimitive.tracePrimitive("X11DrawGlyphs");
return super.doDrawGlyphList(dstData, xgc, clip, gl);
super.doDrawGlyphList(dstData, xgc, clip, gl);
}
}
}

View File

@@ -103,7 +103,7 @@ static jboolean checkPixmap(JNIEnv *env, AwtGraphicsConfigDataPtr cData)
static void FillBitmap(XImage *theImage,
ImageRef *glyphs, jint totalGlyphs,
jint clipLeft, jint clipTop,
jint clipRight, jint clipBottom, jboolean *allGlyphsRendered)
jint clipRight, jint clipBottom)
{
int glyphCounter;
int scan = theImage->bytes_per_line;
@@ -124,17 +124,12 @@ static void FillBitmap(XImage *theImage,
if (!pixels) {
continue;
}
rowBytes = glyphs[glyphCounter].rowBytes;
rowBytes = glyphs[glyphCounter].width;
left = glyphs[glyphCounter].x;
top = glyphs[glyphCounter].y;
width = glyphs[glyphCounter].width;
height = glyphs[glyphCounter].height;
if ((int) rowBytes == width * 4) { // Skip colored glyphs
*allGlyphsRendered = JNI_FALSE;
continue;
}
/* if any clipping required, modify parameters now */
right = left + width;
bottom = top + height;
@@ -211,7 +206,7 @@ static void FillBitmap(XImage *theImage,
JNIEXPORT void JNICALL
AWTDrawGlyphList(JNIEnv *env, jobject xtr,
jlong dstData, jlong gc,
SurfaceDataBounds *bounds, ImageRef *glyphs, jint totalGlyphs, jboolean *allGlyphsRendered)
SurfaceDataBounds *bounds, ImageRef *glyphs, jint totalGlyphs)
{
#ifndef HEADLESS
GC xgc, theGC;
@@ -264,7 +259,7 @@ AWTDrawGlyphList(JNIEnv *env, jobject xtr,
FillBitmap(theImage,
glyphs,
totalGlyphs,
cx1, cy1, cx2, cy2, allGlyphsRendered);
cx1, cy1, cx2, cy2);
// NOTE: Since we are tiling around by BM_W, BM_H offsets
// and thePixmap is BM_W x BM_H, we do not have to move

View File

@@ -45,7 +45,6 @@ static jmethodID filenameFilterCallbackMethodID = NULL;
static jmethodID setFileInternalMethodID = NULL;
static jfieldID widgetFieldID = NULL;
static jmethodID setWindowMethodID = NULL;
static jmethodID onCloseMethodID = NULL;
JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_initIDs
(JNIEnv *env, jclass cx)
@@ -66,9 +65,6 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_initIDs
setWindowMethodID = (*env)->GetMethodID(env, cx, "setWindow", "(J)Z");
DASSERT(setWindowMethodID != NULL);
onCloseMethodID = (*env)->GetMethodID(env, cx, "onClose", "()V");
DASSERT(onCloseMethodID != NULL);
}
static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gpointer obj)
@@ -95,8 +91,6 @@ static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
GtkWidget * dialog = (GtkWidget*)jlong_to_ptr(
(*env)->GetLongField(env, jpeer, widgetFieldID));
(*env)->CallVoidMethod(env, jpeer, onCloseMethodID);
if (dialog != NULL)
{
// Callbacks from GTK signals are made within the GTK lock
@@ -111,6 +105,8 @@ static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
gtk->gtk_main_quit ();
(*env)->SetLongField(env, jpeer, widgetFieldID, 0);
if (!isSignalHandler) {
gtk->gdk_threads_leave();
}

View File

@@ -45,14 +45,14 @@
JNIEXPORT void JNICALL AWTDrawGlyphList
(JNIEnv *env, jobject xtr,
jlong dstData, jlong gc,
SurfaceDataBounds *bounds, ImageRef *glyphs, jint totalGlyphs, jboolean *allGlyphsRendered);
SurfaceDataBounds *bounds, ImageRef *glyphs, jint totalGlyphs);
/*
* Class: sun_font_X11TextRenderer
* Method: doDrawGlyphList
* Signature: (Lsun/java2d/SurfaceData;Ljava/awt/Rectangle;ILsun/font/GlyphList;J)Z
* Signature: (Lsun/java2d/SurfaceData;Ljava/awt/Rectangle;ILsun/font/GlyphList;J)V
*/
JNIEXPORT jboolean JNICALL Java_sun_font_X11TextRenderer_doDrawGlyphList
JNIEXPORT void JNICALL Java_sun_font_X11TextRenderer_doDrawGlyphList
(JNIEnv *env, jobject xtr,
jlong dstData, jlong xgc, jobject clip,
jobject glyphlist)
@@ -64,15 +64,13 @@ JNIEXPORT jboolean JNICALL Java_sun_font_X11TextRenderer_doDrawGlyphList
glyphCount = (*env)->GetIntField(env, glyphlist, sunFontIDs.glyphListLen);
if ((gbv = setupBlitVector(env, glyphlist, 0, glyphCount)) == NULL) {
return JNI_TRUE;
return;
}
if (!RefineBounds(gbv, &bounds)) {
free(gbv);
return JNI_TRUE;
return;
}
jboolean allGlyphsRendered = JNI_TRUE;
AWTDrawGlyphList(env, xtr, dstData, xgc,
&bounds, gbv->glyphs, gbv->numGlyphs, &allGlyphsRendered);
&bounds, gbv->glyphs, gbv->numGlyphs);
free(gbv);
return allGlyphsRendered;
}

View File

@@ -62,9 +62,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.JRootPane;
import javax.swing.RootPaneContainer;
import sun.awt.AWTAccessor;
import sun.awt.AppContext;
import sun.awt.DisplayChangedListener;
@@ -87,8 +84,6 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WWindowPeer");
private static final PlatformLogger screenLog = PlatformLogger.getLogger("sun.awt.windows.screen.WWindowPeer");
public static final String WINDOW_CORNER_RADIUS = "apple.awt.windowCornerRadius";
// we can't use WDialogPeer as blocker may be an instance of WPrintDialogPeer that
// extends WWindowPeer, not WDialogPeer
private WWindowPeer modalBlocker = null;
@@ -259,13 +254,6 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
this.isOpaque = true;
setOpaque(((Window)target).isOpaque());
}
if (target instanceof RootPaneContainer) {
JRootPane rootpane = ((RootPaneContainer)target).getRootPane();
if (rootpane != null) {
setRoundedCornersImpl(rootpane.getClientProperty(WINDOW_CORNER_RADIUS));
}
}
}
native void createAwtWindow(WComponentPeer parent);
@@ -831,35 +819,6 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
}
}
// JBR API internals
private static void setRoundedCorners(Window window, Object params) {
Object peer = AWTAccessor.getComponentAccessor().getPeer(window);
if (peer instanceof WWindowPeer) {
((WWindowPeer)peer).setRoundedCornersImpl(params);
} else if (window instanceof RootPaneContainer) {
JRootPane rootpane = ((RootPaneContainer)window).getRootPane();
if (rootpane != null) {
rootpane.putClientProperty(WINDOW_CORNER_RADIUS, params);
}
}
}
private void setRoundedCornersImpl(Object params) {
if (params instanceof String) {
int type = 0; // default
if ("none".equals(params)) {
type = 1;
} else if ("full".equals(params)) {
type = 2;
} else if ("small".equals(params)) {
type = 3;
}
setRoundedCorners(type);
}
}
private native void setRoundedCorners(int type);
native void updateWindowImpl(int[] data, int width, int height);
@Override

View File

@@ -85,11 +85,6 @@ public class NativeFont extends PhysicalFont {
return null;
}
public GlyphRenderData getGlyphRenderData(long pScalerContext, int glyphCode,
float x, float y) {
return null;
}
long getGlyphImage(long pScalerContext, int glyphCode) {
return 0L;

View File

@@ -83,8 +83,4 @@ public class NativeStrike extends PhysicalStrike {
return null;
}
GlyphRenderData getGlyphRenderData(int glyphCode, float x, float y) {
return null;
}
}

View File

@@ -515,15 +515,7 @@ MsgRouting AwtFrame::WmMouseMove(UINT flags, int x, int y) {
* If this Frame is non-focusable then we should implement move and size operation for it by
* ourselfves because we don't dispatch appropriate mouse messages to default window procedure.
*/
if (isInManualMoveOrSize) {
if (grabbedHitTest == HTCAPTION) {
WINDOWPLACEMENT placement;
::GetWindowPlacement(GetHWnd(), &placement);
if (placement.showCmd == SW_SHOWMAXIMIZED) {
placement.showCmd = SW_SHOWNORMAL;
::SetWindowPlacement(GetHWnd(), &placement);
}
}
if (!IsFocusableWindow() && isInManualMoveOrSize) {
DWORD curPos = ::GetMessagePos();
x = GET_X_LPARAM(curPos);
y = GET_Y_LPARAM(curPos);
@@ -635,29 +627,10 @@ MsgRouting AwtFrame::WmNcMouseDown(WPARAM hitTest, int x, int y, int button) {
// Do not handle events from caption itself to preserve native drag behavior
if (HasCustomDecoration()) {
switch (hitTest) {
case HTCAPTION:
case HTMINBUTTON:
case HTMAXBUTTON:
case HTCLOSE:
case HTMENU:
RECT rcWindow;
GetWindowRect(GetHWnd(), &rcWindow);
if (hitTest == HTCAPTION) {
JNIEnv *env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
jint customSpot = JNU_CallMethodByName(env, NULL, GetTarget(env),
"hitTestCustomDecoration", "(II)I",
ScaleDownX(x - rcWindow.left),
ScaleDownY(y - rcWindow.top)).i;
if (customSpot == java_awt_Window_CustomWindowDecoration_DRAGGABLE_AREA) {
if (button & LEFT_BUTTON) {
savedMousePos.x = x;
savedMousePos.y = y;
::SetCapture(GetHWnd());
isInManualMoveOrSize = TRUE;
grabbedHitTest = hitTest;
}
} else break;
}
POINT myPos;
myPos.x = x;
myPos.y = y;
@@ -1814,7 +1787,6 @@ LRESULT HitTestNCA(AwtFrame* frame, int x, int y) {
frame->ScaleDownY(y - rcWindow.top)).i;
switch (customSpot) {
case java_awt_Window_CustomWindowDecoration_NO_HIT_SPOT:
case java_awt_Window_CustomWindowDecoration_DRAGGABLE_AREA:
break; // Nothing
case java_awt_Window_CustomWindowDecoration_MINIMIZE_BUTTON:
return HTMINBUTTON;

View File

@@ -46,15 +46,11 @@
#include "sun_awt_windows_WCanvasPeer.h"
#include <windowsx.h>
#include <dwmapi.h>
#include <math.h>
#if !defined(__int3264)
typedef __int32 LONG_PTR;
#endif // __int3264
#define DWM_WINDOW_CORNER_PREFERENCE int
#define DWMWA_WINDOW_CORNER_PREFERENCE 33
#if defined(_MSC_VER) && _MSC_VER >= 1800
# define ROUND_TO_INT(num) ((int) round(num))
#else
@@ -135,11 +131,6 @@ struct OpaqueStruct {
jobject window;
jboolean isOpaque;
};
// struct for _SetRoundedCorners() method
struct RoundedCornersStruct {
jobject window;
DWM_WINDOW_CORNER_PREFERENCE type;
};
// struct for _UpdateWindow() method
struct UpdateWindowStruct {
jobject window;
@@ -3363,23 +3354,6 @@ void AwtWindow::_SetOpaque(void* param)
delete os;
}
void AwtWindow::_SetRoundedCorners(void *param) {
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
RoundedCornersStruct *rcs = (RoundedCornersStruct *)param;
jobject self = rcs->window;
PDATA pData;
JNI_CHECK_PEER_GOTO(self, ret);
AwtWindow *window = (AwtWindow *)pData;
DwmSetWindowAttribute(window->GetHWnd(), DWMWA_WINDOW_CORNER_PREFERENCE, &rcs->type, sizeof(DWM_WINDOW_CORNER_PREFERENCE));
ret:
env->DeleteGlobalRef(self);
delete rcs;
}
void AwtWindow::_UpdateWindow(void* param)
{
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
@@ -4140,26 +4114,6 @@ Java_sun_awt_windows_WWindowPeer_repositionSecurityWarning(JNIEnv *env,
CATCH_BAD_ALLOC;
}
/*
* Class: sun_awt_windows_WWindowPeer
* Method: setRoundedCorners
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_sun_awt_windows_WWindowPeer_setRoundedCorners(JNIEnv *env, jobject self, jint type)
{
TRY;
RoundedCornersStruct *rcs = new RoundedCornersStruct;
rcs->window = env->NewGlobalRef(self);
rcs->type = (DWM_WINDOW_CORNER_PREFERENCE)type;
AwtToolkit::GetInstance().SyncCall(AwtWindow::_SetRoundedCorners, rcs);
// global refs and rcs are deleted in _SetRoundedCorners
CATCH_BAD_ALLOC;
}
/*
* Class: sun_awt_windows_WLightweightFramePeer
* Method: overrideNativeHandle

View File

@@ -249,7 +249,6 @@ public:
static void _SetFullScreenExclusiveModeState(void* param);
static void _GetNativeWindowSize(void* param);
static void _OverrideHandle(void *param);
static void _SetRoundedCorners(void* param);
inline static BOOL IsResizing() {
return sm_resizing;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,15 +49,11 @@ jint shmemBase_receivePacket(SharedMemoryConnection *, jdwpPacket *packet);
jint shmemBase_name(SharedMemoryTransport *, char **name);
jint shmemBase_getlasterror(char *msg, jint size);
#ifndef SHMEM_BUILD_TIME
#define SHMEM_BUILD_TIME __DATE__
#endif
#ifdef DEBUG
#define SHMEM_ASSERT(expression) \
do { \
if (!(expression)) { \
exitTransportWithError("assertion failed", __FILE__, SHMEM_BUILD_TIME, __LINE__); \
exitTransportWithError("assertion failed", __FILE__, __DATE__, __LINE__); \
} \
} while (0)
#else
@@ -67,7 +63,7 @@ do { \
#define SHMEM_GUARANTEE(expression) \
do { \
if (!(expression)) { \
exitTransportWithError("assertion failed", __FILE__, SHMEM_BUILD_TIME, __LINE__); \
exitTransportWithError("assertion failed", __FILE__, __DATE__, __LINE__); \
} \
} while (0)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,16 +39,12 @@
static HANDLE memHandle = NULL;
#ifndef SHMEM_BUILD_TIME
#define SHMEM_BUILD_TIME __DATE__
#endif
#ifdef DEBUG
#define sysAssert(expression) { \
if (!(expression)) { \
exitTransportWithError \
("\"%s\", line %d: assertion failure\n", \
__FILE__, SHMEM_BUILD_TIME, __LINE__); \
__FILE__, __DATE__, __LINE__); \
} \
}
#else

View File

@@ -24,59 +24,19 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Custom window decoration allows merging of window content with native title bar,
* which is usually done by treating title bar as part of client area, but with some
* special behavior like dragging or maximizing on double click.
* @implNote Behavior is platform-dependent, only macOS and Windows are supported.
*/
public interface CustomWindowDecoration {
/*CONST java.awt.Window.*_HIT_SPOT*/
/*CONST java.awt.Window.*_BUTTON*/
/*CONST java.awt.Window.MENU_BAR*/
/*CONST java.awt.Window.DRAGGABLE_AREA*/
/**
* Turn custom decoration on or off, {@link #setCustomDecorationTitleBarHeight(Window, int)}
* must be called to configure title bar height.
*/
void setCustomDecorationEnabled(Window window, boolean enabled);
/**
* @see #setCustomDecorationEnabled(Window, boolean)
*/
boolean isCustomDecorationEnabled(Window window);
/**
* Set list of hit test spots for a custom decoration.
* Hit test spot is a special area inside custom-decorated title bar.
* Each hit spot type has its own (probably platform-specific) behavior:
* <ul>
* <li>{@link #NO_HIT_SPOT} - default title bar area, can be dragged to move a window, maximizes on double-click</li>
* <li>{@link #OTHER_HIT_SPOT} - generic hit spot, window cannot be moved with drag or maximized on double-click</li>
* <li>{@link #MINIMIZE_BUTTON} - like {@link #OTHER_HIT_SPOT} but displays tooltip on Windows when hovered</li>
* <li>{@link #MAXIMIZE_BUTTON} - like {@link #OTHER_HIT_SPOT} but displays tooltip / snap layout menu on Windows when hovered</li>
* <li>{@link #CLOSE_BUTTON} - like {@link #OTHER_HIT_SPOT} but displays tooltip on Windows when hovered</li>
* <li>{@link #MENU_BAR} - currently no different from {@link #OTHER_HIT_SPOT}</li>
* <li>{@link #DRAGGABLE_AREA} - special type, moves window when dragged, but doesn't maximize on double-click</li>
* </ul>
* @param spots pairs of hit spot shapes with corresponding types.
* @implNote Hit spots are tested in sequence, so in case of overlapping areas, first found wins.
*/
void setCustomDecorationHitTestSpots(Window window, List<Map.Entry<Shape, Integer>> spots);
/**
* @see #setCustomDecorationHitTestSpots(Window, List)
*/
List<Map.Entry<Shape, Integer>> getCustomDecorationHitTestSpots(Window window);
/**
* Set height of custom window decoration, won't take effect until custom decoration
* is enabled via {@link #setCustomDecorationEnabled(Window, boolean)}.
*/
void setCustomDecorationTitleBarHeight(Window window, int height);
/**
* @see #setCustomDecorationTitleBarHeight(Window, int)
*/
int getCustomDecorationTitleBarHeight(Window window);

View File

@@ -1,42 +0,0 @@
/*
* Copyright 2000-2022 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.jetbrains;
import java.io.File;
import java.io.IOException;
import java.net.URI;
public interface DesktopActions {
void setHandler(Handler handler);
interface Handler {
default void open(File file) throws IOException { throw new UnsupportedOperationException(); }
default void edit(File file) throws IOException { throw new UnsupportedOperationException(); }
default void print(File file) throws IOException { throw new UnsupportedOperationException(); }
default void mail(URI mailtoURL) throws IOException { throw new UnsupportedOperationException(); }
default void browse(URI uri) throws IOException { throw new UnsupportedOperationException(); }
}
}

View File

@@ -1,37 +0,0 @@
/*
* Copyright 2000-2022 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jetbrains;
import java.awt.Window;
/**
* This manager allows decorate awt Window with rounded corners.
* Appearance depends from operating system.
*/
public interface RoundedCornersManager {
/**
* @param params for macOS is Float object with radius or
* Array with {Float for radius, Integer for border width, java.awt.Color for border color}.
*
* @param params for Windows 11 is String with values:
* "default" - let the system decide whether or not to round window corners,
* "none" - never round window corners,
* "full" - round the corners if appropriate,
* "small" - round the corners if appropriate, with a small radius.
*/
void setRoundedCorners(Window window, Object params);
}

View File

@@ -250,11 +250,12 @@ public class Gensrc {
}
private void findInModule(String content) {
Pattern servicePattern = compile("(service|proxy|twoWayProxy)\\s*\\(([^,)]+)");
Pattern servicePattern = compile("(service|proxy|twoWayProxy)\\s*\\(([^)]+)");
Matcher matcher = servicePattern.matcher(content);
while (matcher.find()) {
String type = matcher.group(1);
String interfaceName = extractFromStringLiteral(matcher.group(2));
String parameters = matcher.group(2);
String interfaceName = extractFromStringLiteral(parameters.substring(0, parameters.indexOf(',')));
if (type.equals("service")) services.add(interfaceName);
else proxies.add(interfaceName);
}

View File

@@ -6,9 +6,9 @@
# 2. When only new API is added, or some existing API was @Deprecated - increment MINOR, reset PATCH to 0
# 3. For major backwards incompatible API changes - increment MAJOR, reset MINOR and PATCH to 0
VERSION = 1.1.1
VERSION = 0.0.5
# Hash is used to track changes to jetbrains.api, so you would not forget to update version when needed.
# When you make any changes, "make jbr-api" will fail and ask you to update hash and version number here.
HASH = 80FE49AB3B6461EBB48F9F2FC2A1D45F
HASH = 2F4DD7564F018A0AB7CD8DFF010E3B4

View File

@@ -142,55 +142,4 @@ vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn001/forceEa
#############################################################################
vmTestbase/vm/jit/LongTransitions/nativeFnc1/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc10/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc11/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc12/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc13/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc14/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc15/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc16/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc17/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc18/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc19/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc2/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc20/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc21/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc22/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc23/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc24/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc25/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc26/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc27/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc28/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc29/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc3/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc30/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc31/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc32/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc33/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc34/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc35/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc36/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc37/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc38/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc39/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc4/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc40/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc41/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc42/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc43/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc44/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc45/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc46/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc47/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc48/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc49/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc5/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc50/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc51/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc52/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc6/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc7/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc8/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions/nativeFnc9/TestDescription.java 8271615 macosx-all
vmTestbase/vm/jit/LongTransitions 8271615 macosx-all

View File

@@ -85,10 +85,6 @@ tier4 = \
-:tier2 \
-:tier3
tier4_no_desktop = \
:tier4 \
-:jdk_desktop
###############################################################################
#
# Other test definitions; generally smaller granularity than tiers

Some files were not shown because too many files have changed in this diff Show More