Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v7]

2021-09-03 Thread Sergey Bylokhov
On Fri, 3 Sep 2021 08:04:52 GMT, Andrey Turbanov wrote: >> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to >> use `ArrayList` if a thread-safe implementation is not needed. In >> post-BiasedLocking times, this is gets worse, as every access is >> synchronized. >>

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v6]

2021-09-02 Thread Sergey Bylokhov
On Wed, 1 Sep 2021 19:46:51 GMT, Andrey Turbanov wrote: >> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to >> use `ArrayList` if a thread-safe implementation is not needed. In >> post-BiasedLocking times, this is gets worse, as every access is >> synchronized. >>

[OpenJDK 2D-Dev] Integrated: 8272805: Avoid looking up standard charsets

2021-09-02 Thread Sergey Bylokhov
On Sun, 22 Aug 2021 02:53:44 GMT, Sergey Bylokhov wrote: > This is the continuation of JDK-8233884, JDK-8271456, and JDK-8272120. > > In many places standard charsets are looked up via their names, for example: > absolutePath.getBytes("UTF-8"); > > This could be don

Re: [OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets [v4]

2021-08-31 Thread Sergey Bylokhov
n this fix: the Xerces library(should be fixed upstream), > J2DBench(should be compatible to 1.4), some code in the network(the change > there are not straightforward, will do it later). > > Tested by the tier1/tier2/tier3 tests on Linux/Windows/macOS. Sergey Bylokhov has updated the

Re: [OpenJDK 2D-Dev] RFR: 8264666: Reuse Math.multiplyExact/addExact in the LCMSImageLayout class

2021-08-31 Thread Sergey Bylokhov
On Fri, 2 Apr 2021 23:02:50 GMT, Sergey Bylokhov wrote: > - The hand-crafted methods for addition and multiplication are replaced by > the "Math" versions. > - Cleanup: the usage of do/while(false) is removed not now - PR: https://git.openjdk.java.net/jdk/pull/

Re: [OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets [v3]

2021-08-30 Thread Sergey Bylokhov
n this fix: the Xerces library(should be fixed upstream), > J2DBench(should be compatible to 1.4), some code in the network(the change > there are not straightforward, will do it later). > > Tested by the tier1/tier2/tier3 tests on Linux/Windows/macOS. Sergey Bylokhov has updated the

[OpenJDK 2D-Dev] RFR: 8273102: Delete deprecated for removal the empty finalize() in java.desktop module

2021-08-29 Thread Sergey Bylokhov
The "java.desktop" module has a few implementations of the finalize() which do nothing, deprecated since jdk9, and are marked "forRemoval = true" since jdk16. This is a request to delete such empty methods. CSR: https://bugs.openjdk.java.net/browse/JDK-8273103 - Commit messages:

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v4]

2021-08-27 Thread Sergey Bylokhov
On Fri, 27 Aug 2021 17:52:19 GMT, Andrey Turbanov wrote: >> src/java.desktop/share/classes/javax/swing/JMenu.java line 1340: >> >>> 1338: } >>> 1339: MenuElement[] me = new MenuElement[elements.size()]; >>> 1340: elements.toArray(me); >> >> Implementation of the "toArra

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v4]

2021-08-27 Thread Sergey Bylokhov
On Wed, 25 Aug 2021 17:53:00 GMT, Andrey Turbanov wrote: >> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to >> use `ArrayList` if a thread-safe implementation is not needed. In >> post-BiasedLocking times, this is gets worse, as every access is >> synchronized. >>

Re: [OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets [v2]

2021-08-26 Thread Sergey Bylokhov
On Thu, 26 Aug 2021 17:39:36 GMT, Sergey Bylokhov wrote: >> Sergey Bylokhov has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request cont

Re: [OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets [v2]

2021-08-26 Thread Sergey Bylokhov
On Sun, 22 Aug 2021 23:02:06 GMT, Sergey Bylokhov wrote: >> This is the continuation of JDK-8233884, JDK-8271456, and JDK-8272120. >> >> In many places standard charsets are looked up via their names, for example: >> absolutePath.getBytes("UTF-8"); >> &

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v2]

2021-08-24 Thread Sergey Bylokhov
On Tue, 24 Aug 2021 21:13:57 GMT, Andrey Turbanov wrote: >> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to >> use `ArrayList` if a thread-safe implementation is not needed. In >> post-BiasedLocking times, this is gets worse, as every access is >> synchronized. >>

Re: [OpenJDK 2D-Dev] RFR: 8272863: Replace usages of Collections.sort with List.sort call in public java modules

2021-08-23 Thread Sergey Bylokhov
On Mon, 23 Aug 2021 21:01:48 GMT, Andrey Turbanov wrote: > Collections.sort is just a wrapper, so it is better to use an instance method > directly. The changes in the src/java.desktop/ looks fine. Filed: https://bugs.openjdk.java.net/browse/JDK-8272863 - Marked as reviewed by s

Re: [OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets

2021-08-23 Thread Sergey Bylokhov
On Sun, 22 Aug 2021 18:31:02 GMT, Andrey Turbanov wrote: > I think it's worth to update _static_ initializer in > `sun.datatransfer.DataFlavorUtil.CharsetComparator` too. Updated as suggested. - PR: https://git.openjdk.java.net/jdk/pull/5210

Re: [OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets [v2]

2021-08-23 Thread Sergey Bylokhov
On Sun, 22 Aug 2021 15:09:26 GMT, Alan Bateman wrote: >> Sergey Bylokhov has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request cont

Re: [OpenJDK 2D-Dev] RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop

2021-08-23 Thread Sergey Bylokhov
On Mon, 23 Aug 2021 13:08:02 GMT, Alexey Ivanov wrote: >> Looks like there's no purpose, `tags` is not used after assignment > > Maybe it's kind of a protection from a race. Yet it's possible either way: > another thread could see `essentialTags == null` before this one initialises > the field.

Re: [OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets [v2]

2021-08-22 Thread Sergey Bylokhov
n this fix: the Xerces library(should be fixed upstream), > J2DBench(should be compatible to 1.4), some code in the network(the change > there are not straightforward, will do it later). > > Tested by the tier1/tier2/tier3 tests on Linux/Windows/macOS. Sergey Bylokhov has updated the

[OpenJDK 2D-Dev] RFR: 8272805: Avoid looking up standard charsets

2021-08-21 Thread Sergey Bylokhov
This is the continuation of JDK-8233884, JDK-8271456, and JDK-8272120. See https://github.com/openjdk/jdk/pull/5063 and https://github.com/openjdk/jdk/pull/4951 In many places standard charsets are looked up via their names, for example: absolutePath.getBytes("UTF-8"); This could be done more ef

Re: [OpenJDK 2D-Dev] RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop

2021-08-20 Thread Sergey Bylokhov
On Fri, 20 Aug 2021 09:41:15 GMT, Сергей Цыпанов wrote: > This is a continuation of > > - https://bugs.openjdk.java.net/browse/JDK-6736490 > - https://bugs.openjdk.java.net/browse/JDK-8035284 > - https://bugs.openjdk.java.net/browse/JDK-8145680 > - https://bugs.openjdk.java.net/browse/JDK-82515

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux [v6]

2021-08-17 Thread Sergey Bylokhov
On Mon, 16 Aug 2021 07:51:12 GMT, Maxim Kartashev wrote: >> Added an `ExceptionCheck()` followed by `ExceptionDescribe()` and >> `ExceptionClear()` immediately after the Java calls made from the callback >> function `ReadTTFontFileFunc()` in `freetypeScaler.c`. >> >> The exception(s) need to

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked [v6]

2021-08-17 Thread Sergey Bylokhov
On Tue, 17 Aug 2021 06:09:51 GMT, Alexander Zuev wrote: >> Initial implementation and a test case. >> >> The problem is that Aqua LaF shows the focused component with the glow on >> the border, hence when the border is not painted the foxus is not displayed. >> The idea is to paint the glowing

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked [v4]

2021-08-16 Thread Sergey Bylokhov
On Mon, 16 Aug 2021 23:39:05 GMT, Alexander Zuev wrote: >> What about the color property? > >> What about the color property? > > That would be unnecessary, whoever does painting does not just assumes that > the color is set to his preferred choice, everywhere in the code color is set > up bef

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked [v4]

2021-08-16 Thread Sergey Bylokhov
On Mon, 16 Aug 2021 19:45:11 GMT, Alexander Zuev wrote: >> src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java line 340: >> >>> 338: Color ringColor = UIManager.getColor("Focus.color"); >>> 339: g.setColor(ringColor); >>> 340: g.drawRoundRect(5, 3, b.getWidth(

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux [v6]

2021-08-16 Thread Sergey Bylokhov
On Mon, 16 Aug 2021 07:51:12 GMT, Maxim Kartashev wrote: >> Added an `ExceptionCheck()` followed by `ExceptionDescribe()` and >> `ExceptionClear()` immediately after the Java calls made from the callback >> function `ReadTTFontFileFunc()` in `freetypeScaler.c`. >> >> The exception(s) need to

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked [v4]

2021-08-16 Thread Sergey Bylokhov
On Fri, 13 Aug 2021 19:17:13 GMT, Alexander Zuev wrote: >> Initial implementation and a test case. >> >> The problem is that Aqua LaF shows the focused component with the glow on >> the border, hence when the border is not painted the foxus is not displayed. >> The idea is to paint the glowing

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked [v4]

2021-08-15 Thread Sergey Bylokhov
On Fri, 13 Aug 2021 19:17:13 GMT, Alexander Zuev wrote: >> Initial implementation and a test case. >> >> The problem is that Aqua LaF shows the focused component with the glow on >> the border, hence when the border is not painted the foxus is not displayed. >> The idea is to paint the glowing

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux [v3]

2021-08-13 Thread Sergey Bylokhov
On Fri, 13 Aug 2021 12:11:15 GMT, Maxim Kartashev wrote: >> Does it actually suppress the "Xcheck:jni" or it clears a raised exception? >> If an exception is still "raised" after this call we should do some >> additional steps to log/clean it. > > Yes, the exception will still be "raised" afte

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v4]

2021-08-13 Thread Sergey Bylokhov
On Fri, 13 Aug 2021 14:30:58 GMT, Alexey Ushakov wrote: >> Keep MTLLayer opacity in sync with window content view >> Keep layer translucent for translucent windows > > Alexey Ushakov has updated the pull request incrementally with one additional > commit since the last revision: > > 8266079:

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v3]

2021-08-12 Thread Sergey Bylokhov
On Thu, 12 Aug 2021 23:33:51 GMT, Alexey Ushakov wrote: >> Then you can roll back this change to the default opaque layer? > > Did you mean to make MTLLayer opaque by default? Yes, I did it in the latest > version. Then why do you need " platformWindow.setOpaque(!isTranslucent());" above?

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v3]

2021-08-12 Thread Sergey Bylokhov
On Thu, 12 Aug 2021 18:58:59 GMT, Alexey Ushakov wrote: >> Interesting, now I'm also able to reproduce this problem with the latest >> version of the fix. Actually, looks like the problem exists even without the >> fix. We get invalid background with the same scenario. It's not so visible >> b

Re: [OpenJDK 2D-Dev] RFR: 8205138: Remove Applet references from Font2DTest [v2]

2021-08-12 Thread Sergey Bylokhov
On Thu, 12 Aug 2021 19:16:55 GMT, Phil Race wrote: >> Applet support was removed already but the .html file was left as well as >> docs on applet issues >> and a parameter only relevant to applets. > > Phil Race has updated the pull request with a new target base due to a merge > or a rebase. T

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux [v3]

2021-08-12 Thread Sergey Bylokhov
On Mon, 19 Jul 2021 08:31:21 GMT, Maxim Kartashev wrote: >> src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderQueue.cpp line >> 870: >> >>> 868: J2dTraceLn(J2D_TRACE_VERBOSE, " executing runnable"); >>> 869: jboolean ignoreException; >>> 870: JNU_CallMethodByN

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked

2021-08-12 Thread Sergey Bylokhov
On Wed, 11 Aug 2021 11:22:50 GMT, Alexander Zuev wrote: > Initial implementation and a test case. > > The problem is that Aqua LaF shows the focused component with the glow on the > border, hence when the border is not painted the foxus is not displayed. The > idea is to paint the glowing bord

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked

2021-08-12 Thread Sergey Bylokhov
On Wed, 11 Aug 2021 11:22:50 GMT, Alexander Zuev wrote: > Initial implementation and a test case. > > The problem is that Aqua LaF shows the focused component with the glow on the > border, hence when the border is not painted the foxus is not displayed. The > idea is to paint the glowing bord

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked

2021-08-12 Thread Sergey Bylokhov
On Wed, 11 Aug 2021 11:22:50 GMT, Alexander Zuev wrote: > Initial implementation and a test case. > > The problem is that Aqua LaF shows the focused component with the glow on the > border, hence when the border is not painted the foxus is not displayed. The > idea is to paint the glowing bord

Re: [OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked

2021-08-11 Thread Sergey Bylokhov
On Wed, 11 Aug 2021 11:22:50 GMT, Alexander Zuev wrote: > Initial implementation and a test case. > > The problem is that Aqua LaF shows the focused component with the glow on the > border, hence when the border is not painted the foxus is not displayed. The > idea is to paint the glowing bord

[OpenJDK 2D-Dev] Integrated: 8271718: Crash when during color transformation the color profile is replaced

2021-08-10 Thread Sergey Bylokhov
On Sat, 7 Aug 2021 07:57:22 GMT, Sergey Bylokhov wrote: > I have started the investigation of this code after this comment: > https://github.com/openjdk/jdk/pull/2957#discussion_r592988443 > > We have a suspicious synchronized keyword on the "setTagData" method. This

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop

2021-08-09 Thread Sergey Bylokhov
On Mon, 5 Jul 2021 14:00:07 GMT, Сергей Цыпанов wrote: >> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to >> use `ArrayList` if a thread-safe implementation is not needed. In >> post-BiasedLocking times, this is gets worse, as every access is >> synchronized. >> I

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop

2021-08-09 Thread Sergey Bylokhov
On Sun, 4 Jul 2021 20:42:41 GMT, Andrey Turbanov wrote: > Usage of thread-safe collection `Vector` is unnecessary. It's recommended to > use `ArrayList` if a thread-safe implementation is not needed. In > post-BiasedLocking times, this is gets worse, as every access is synchronized. > I checke

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v2]

2021-08-08 Thread Sergey Bylokhov
On Wed, 4 Aug 2021 23:06:54 GMT, Sergey Bylokhov wrote: >> 1. Run SwingSet2 >> 2. Click on all tabs starting from the second one >> 3. On the tab with swing tree control try to expand some tree nodes -> >> you'll see black rectangles while performing the clicks

[OpenJDK 2D-Dev] RFR: 8271718: Crash when during color transformation the color profile is replaced

2021-08-07 Thread Sergey Bylokhov
I have started the investigation of this code after this comment: https://github.com/openjdk/jdk/pull/2957#discussion_r592988443 We have a suspicious synchronized keyword on the "setTagData" method. This method modified the data of the profile and invalidates the pointer to the native part of t

Re: [OpenJDK 2D-Dev] RFR: 8271718: Crash when during color transformation the color profile is replaced

2021-08-07 Thread Sergey Bylokhov
On Sat, 7 Aug 2021 07:57:22 GMT, Sergey Bylokhov wrote: > I have started the investigation of this code after this comment: > https://github.com/openjdk/jdk/pull/2957#discussion_r592988443 > > We have a suspicious synchronized keyword on the "setTagData" method. This

Re: [OpenJDK 2D-Dev] RFR: 8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 9 [v2]

2021-08-04 Thread Sergey Bylokhov
On Wed, 4 Aug 2021 20:10:50 GMT, Phil Race wrote: >> These fields >> - have not been used by the implementation since JDK8, >> - are not supposed to be used by applications, >> - have been deprecated for removal since JDK 9 >> - are non-standard, JDK not Java, classes >> - very few clients are e

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v2]

2021-08-04 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 20:04:14 GMT, Alexey Ushakov wrote: >> How to reproduce that artifact? > > 1. Run SwingSet2 > 2. Click on all tabs starting from the second one > 3. On the tab with swing tree control try to expand some tree nodes -> you'll > see black rectangles while performing the clicks

[OpenJDK 2D-Dev] Integrated: 8271456: Avoid looking up standard charsets in "java.desktop" module

2021-08-04 Thread Sergey Bylokhov
On Sun, 1 Aug 2021 07:07:21 GMT, Sergey Bylokhov wrote: > This is a request to clean up a desktop module as was done in JDK-8233884 for > "java.base" module. > > In many places standard charsets are looked up via their names, for example: > absolutePath.getBytes(&qu

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v2]

2021-08-03 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 22:42:55 GMT, Alexey Ivanov wrote: >> I am fine to do that, if there are no objections I can change the whole fix. > >> >> I am fine to do that, if there are no objections I can change the whole fix. > > Modifying the entire changeset seems like an overkill. > Using static im

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v4]

2021-08-03 Thread Sergey Bylokhov
efficiently(x20 time faster) with use of > java.nio.charset.StandardCharsets: > absolutePath.getBytes(StandardCharsets.UTF_8); > > The later variant also makes the code cleaner, as it is known not to throw > UnsupportedEncodingException in contrary to the former variant. > > Tested b

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v3]

2021-08-03 Thread Sergey Bylokhov
efficiently(x20 time faster) with use of > java.nio.charset.StandardCharsets: > absolutePath.getBytes(StandardCharsets.UTF_8); > > The later variant also makes the code cleaner, as it is known not to throw > UnsupportedEncodingException in contrary to the former variant. > > Tested b

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v2]

2021-08-03 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 21:54:08 GMT, Alexey Ivanov wrote: >> it is aligned already, the StandardCharsets.UTF_8 is parameter of "new >> String()", not the getTransferData. > > Ah, right! > But it's confusing: it looks as if `StandardCharsets.UTF_8` is a parameter to > `getTransferData`. Maybe avoid

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v2]

2021-08-03 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 21:18:40 GMT, Alexey Ivanov wrote: >> Sergey Bylokhov has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request conta

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL

2021-08-03 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 19:51:30 GMT, Alexey Ushakov wrote: >> Yes, sounds reasonable. Moreover, It was my initial attempt but I faced with >> some regressions in SwingSet2 demo. In some cases background of tree nodes >> become black and this artifact was reproducible only if some other tabs were

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v2]

2021-08-03 Thread Sergey Bylokhov
efficiently(x20 time faster) with use of > java.nio.charset.StandardCharsets: > absolutePath.getBytes(StandardCharsets.UTF_8); > > The later variant also makes the code cleaner, as it is known not to throw > UnsupportedEncodingException in contrary to the former variant. > > Tested b

Re: [OpenJDK 2D-Dev] RFR: 8270893: IndexOutOfBoundsException while reading large TIFF file [v2]

2021-08-03 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 09:11:07 GMT, Jayathirth D V wrote: >> We are incorrectly passing source offset to ImageInputStream.readFully() >> which is getting used on destination buffer. streamPos maintained in each >> implementation of stream maintain's appropriate source offset while reading >> the

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module

2021-08-03 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 13:30:28 GMT, Alexander Zvegintsev wrote: >> This is a request to clean up a desktop module as was done in JDK-8233884 >> for "java.base" module. >> >> In many places standard charsets are looked up via their names, for example: >> absolutePath.getBytes("UTF-8"); >> >> This

Re: [OpenJDK 2D-Dev] RFR: 8264666: Reuse Math.multiplyExact/addExact in the LCMSImageLayout class

2021-08-02 Thread Sergey Bylokhov
On Fri, 2 Apr 2021 23:02:50 GMT, Sergey Bylokhov wrote: > - The hand-crafted methods for addition and multiplication are replaced by > the "Math" versions. > - Cleanup: the usage of do/while(false) is removed not now - PR: https://git.openjdk.java.net/jdk/pull/

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL

2021-08-02 Thread Sergey Bylokhov
On Mon, 2 Aug 2021 20:04:43 GMT, Alexey Ushakov wrote: >> src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java line 199: >> >>> 197: >>> 198: platformWindow.initialize(target, this, ownerDelegate); >>> 199: platformWindow.setOpaque(!isTranslucent()); >> >> !isTranslucent

Re: [OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL

2021-08-02 Thread Sergey Bylokhov
On Fri, 30 Jul 2021 15:39:19 GMT, Alexey Ushakov wrote: > Keep MTLLayer opacity in sync with window content view > Keep layer translucent for translucent windows src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java line 199: > 197: > 198: platformWindow.initialize(target, this,

Re: [OpenJDK 2D-Dev] RFR: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying

2021-08-01 Thread Sergey Bylokhov
On Mon, 14 Jun 2021 17:00:29 GMT, Andrey Turbanov wrote: > I found few places, where code initially perform `Object[] > Colleciton.toArray()` call and then manually copy array into another array > with required type. > This PR cleanups such places to more shorter call `T[] > Collection.toArra

[OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module

2021-08-01 Thread Sergey Bylokhov
This is a request to clean up a desktop module as was done in JDK-8233884 for "java.base" module. In many places standard charsets are looked up via their names, for example: absolutePath.getBytes("UTF-8"); This could be done more efficiently(x20 time faster) with use of java.nio.charset.Standa

Re: [OpenJDK 2D-Dev] RFR: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying

2021-07-26 Thread Sergey Bylokhov
On Mon, 14 Jun 2021 17:00:29 GMT, Andrey Turbanov wrote: > I found few places, where code initially perform `Object[] > Colleciton.toArray()` call and then manually copy array into another array > with required type. > This PR cleanups such places to more shorter call `T[] > Collection.toArra

Re: [OpenJDK 2D-Dev] RFR: 8270893: IndexOutOfBoundsException while reading large TIFF file

2021-07-23 Thread Sergey Bylokhov
On Tue, 20 Jul 2021 06:25:22 GMT, Jayathirth D V wrote: > We are incorrectly passing source offset to ImageInputStream.readFully() > which is getting used on destination buffer. streamPos maintained in each > implementation of stream maintain's appropriate source offset while reading > the dat

Re: [OpenJDK 2D-Dev] RFR: 8270893: IndexOutOfBoundsException while reading large TIFF file

2021-07-21 Thread Sergey Bylokhov
On Tue, 20 Jul 2021 06:25:22 GMT, Jayathirth D V wrote: > We are incorrectly passing source offset to ImageInputStream.readFully() > which is getting used on destination buffer. streamPos maintained in each > implementation of stream maintain's appropriate source offset while reading > the dat

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux [v3]

2021-07-16 Thread Sergey Bylokhov
On Wed, 14 Jul 2021 05:48:42 GMT, Maxim Kartashev wrote: >> Added an `ExceptionCheck()` followed by `ExceptionDescribe()` and >> `ExceptionClear()` immediately after the Java calls made from the callback >> function `ReadTTFontFileFunc()` in `freetypeScaler.c`. >> >> The exception(s) need to

Re: [OpenJDK 2D-Dev] RFR: 8270859: Post JEP 411 refactoring: client libs with maximum covering > 10K

2021-07-16 Thread Sergey Bylokhov
On Fri, 16 Jul 2021 20:52:08 GMT, Weijun Wang wrote: > This is the last part of Post JEP 411 refactoring that makes > `@SuppressWarnings("removal")` more fine grained. This fix deals with all > client libs annotations that cover more than 10K bytes of code. After the requested change to the Pr

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux [v2]

2021-07-09 Thread Sergey Bylokhov
On Fri, 2 Jul 2021 04:02:45 GMT, Sergey Bylokhov wrote: >> Maxim Kartashev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Addressed PR comments >> >> 1. Allowed test to run on any platform. >

Re: [OpenJDK 2D-Dev] RFR: 8264666: Reuse Math.multiplyExact/addExact in the LCMSImageLayout class

2021-07-05 Thread Sergey Bylokhov
On Fri, 2 Apr 2021 23:02:50 GMT, Sergey Bylokhov wrote: > - The hand-crafted methods for addition and multiplication are replaced by > the "Math" versions. > - Cleanup: the usage of do/while(false) is removed not now - PR: https://git.openjdk.java.net/jdk/pull/

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v5]

2021-07-05 Thread Sergey Bylokhov
On Mon, 5 Jul 2021 15:55:20 GMT, Alexey Ushakov wrote: >> Implemented blit via compute kernel > > Alexey Ushakov has updated the pull request incrementally with one additional > commit since the last revision: > > 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL >

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux [v2]

2021-07-01 Thread Sergey Bylokhov
On Wed, 30 Jun 2021 10:42:44 GMT, Maxim Kartashev wrote: >> Added an `ExceptionCheck()` followed by `ExceptionDescribe()` and >> `ExceptionClear()` immediately after the Java calls made from the callback >> function `ReadTTFontFileFunc()` in `freetypeScaler.c`. >> >> The exception(s) need to

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8267602: [macos] [lanai] java/awt/PrintJob/Text/stringwidth.sh doesn't exit on cancelling print dialog [v2]

2021-06-30 Thread Sergey Bylokhov
On Wed, 30 Jun 2021 08:09:28 GMT, Jayathirth D V wrote: >> No, I meant if we dispose the frame/exist from the app/etc before >> "Java_sun_java2d_metal_MTLLayer_blitTexture" method is executed but after we >> call "startDisplayLink", when we will call the stopDisplayLink in this case? > > @mrser

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8267602: [macos] [lanai] java/awt/PrintJob/Text/stringwidth.sh doesn't exit on cancelling print dialog [v2]

2021-06-30 Thread Sergey Bylokhov
On Wed, 30 Jun 2021 14:37:31 GMT, Jayathirth D V wrote: >> Final blit operation in MTLLayer.blitTexture() is driven by CVDisplayLink in >> Metal. >> In this test case we are hitting an invalid condition because of which we >> exit from MTLLayer.blitTexture(), but we are not stopping the CVDispl

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8267602: [macos] [lanai] java/awt/PrintJob/Text/stringwidth.sh doesn't exit on cancelling print dialog

2021-06-29 Thread Sergey Bylokhov
On Wed, 30 Jun 2021 04:00:54 GMT, Jayathirth D V wrote: >> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 286: >> >>> 284: if (layer == NULL || ctx == NULL) { >>> 285: J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer_blit : Layer or >>> Context is null"); >>> 286:

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8267602: [macos] [lanai] java/awt/PrintJob/Text/stringwidth.sh doesn't exit on cancelling print dialog

2021-06-29 Thread Sergey Bylokhov
On Tue, 29 Jun 2021 17:34:00 GMT, Jayathirth D V wrote: > Final blit operation in MTLLayer.blitTexture() is driven by CVDisplayLink in > Metal. > In this test case we are hitting an invalid condition because of which we > exit from MTLLayer.blitTexture(), but we are not stopping the CVDisplayLi

Re: [OpenJDK 2D-Dev] RFR: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux

2021-06-29 Thread Sergey Bylokhov
On Wed, 23 Jun 2021 09:19:16 GMT, Maxim Kartashev wrote: > Added an `ExceptionCheck()` followed by `ExceptionDescribe()` and > `ExceptionClear()` immediately after the Java calls made from the callback > function `ReadTTFontFileFunc()` in `freetypeScaler.c`. > > The exception(s) need to be c

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v2]

2021-06-28 Thread Sergey Bylokhov
On Wed, 23 Jun 2021 12:15:03 GMT, Alexey Ushakov wrote: >> Implemented blit via compute kernel > > Alexey Ushakov has refreshed the contents of this pull request, and previous > commits have been removed. The incremental views will show differences > compared to the previous content of the PR.

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL

2021-06-17 Thread Sergey Bylokhov
On Wed, 16 Jun 2021 10:34:50 GMT, Alexey Ushakov wrote: >> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 159: >> >>> 157: [computeEncoder endEncoding]; >>> 158: [cb commit]; >>> 159: #endif >> >> This is better than changing the background color, but s

Re: [OpenJDK 2D-Dev] [jdk17] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL

2021-06-15 Thread Sergey Bylokhov
On Tue, 15 Jun 2021 16:57:00 GMT, Alexey Ushakov wrote: > Implemented blit via compute kernel Marked as reviewed by serb (Reviewer). src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 159: > 157: [computeEncoder endEncoding]; > 158: [cb commit]; > 159: #en

Re: [OpenJDK 2D-Dev] RFR: 8264666: Reuse Math.multiplyExact/addExact in the LCMSImageLayout class

2021-06-07 Thread Sergey Bylokhov
On Fri, 2 Apr 2021 23:02:50 GMT, Sergey Bylokhov wrote: > - The hand-crafted methods for addition and multiplication are replaced by > the "Math" versions. > - Cleanup: the usage of do/while(false) is removed not now - PR: https://git.openjdk.java.net/jdk/pull/

Re: [OpenJDK 2D-Dev] RFR: 8266159: macOS ARM + Metal pipeline shows artifacts on Swing Menu with Java L&F [v2]

2021-06-07 Thread Sergey Bylokhov
On Mon, 7 Jun 2021 12:03:35 GMT, Ajit Ghaisas wrote: >> This PR fixes an issue exclusively seen on Apple M1 systems when SwingSet2 >> demo is run with uiScale=1.0. >> >> **Issue :** >> SwingSet2 Demo - As reported in JBS description >> J2DDemo - As reported in a comment on JBS >> >> **Root Cau

2d-dev@openjdk.java.net

2021-06-05 Thread Sergey Bylokhov
On Fri, 4 Jun 2021 11:14:46 GMT, Ajit Ghaisas wrote: > This PR fixes an issue exclusively seen on Apple M1 systems when SwingSet2 > demo is run with uiScale=1.0. > > **Issue :** > SwingSet2 Demo - As reported in JBS description > J2DDemo - As reported in a comment on JBS > > **Root Cause :**

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v16]

2021-05-27 Thread Sergey Bylokhov
On Fri, 7 May 2021 17:53:49 GMT, Alexander Zuev wrote: >> This comment is also about the case of not fetching icons of sizes smaller >> than requested size. > > Sorry, missed that in my latest fix. Indeed there is no legitimate ways to > set scaling factor to less than 100% on Windows so yes, o

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v15]

2021-05-27 Thread Sergey Bylokhov
On Thu, 27 May 2021 16:38:02 GMT, Alexander Zuev wrote: >> Is this requirement is so important? can we return an MRI(same as on >> Windows) which will have just one resolution? Otherwise what the user should >> do if the requested size was 32x32 but returned image will be 21x21? Paint >> the s

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v15]

2021-05-27 Thread Sergey Bylokhov
On Wed, 26 May 2021 21:39:19 GMT, Alexander Zuev wrote: >> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 87: >> >>> 85: } >>> 86: >>> 87: if (implComplete && icon.getIconWidth() != size) { >> >> Why the size of the returned images might be di

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v15]

2021-05-26 Thread Sergey Bylokhov
On Wed, 26 May 2021 16:52:38 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Alexander Zuev has updated the pull request incrementally with two additional > commits since the last revision: > > - Fixed small errors >Adjustments in the test > - Grammar fix in met

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-26 Thread Sergey Bylokhov
On Fri, 21 May 2021 19:37:19 GMT, Alexander Zuev wrote: >> Didn't you answer your question already? If `FileSystemView.getRoots()` >> returns Desktop in Windows shell namespace. Otherwise, I don't know a way to >> get a reference to a *virtual* folder in Windows shell namespace which >> doesn'

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v15]

2021-05-26 Thread Sergey Bylokhov
On Wed, 26 May 2021 16:52:38 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Alexander Zuev has updated the pull request incrementally with two additional > commits since the last revision: > > - Fixed small errors >Adjustments in the test > - Grammar fix in met

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v10]

2021-05-21 Thread Sergey Bylokhov
On Fri, 21 May 2021 01:11:38 GMT, Sergey Bylokhov wrote: >>> But this is shared code, which has a specification it should work >>> everywhere, so even if on Linux and macOS it is not implemented in the best >>> way it should return something. >> >> T

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-21 Thread Sergey Bylokhov
On Fri, 21 May 2021 06:32:02 GMT, Alexander Zuev wrote: >> It is accessible from the "JFileChooser" drop-down menu. On my system, the >> Libraries at that drop down menu contain "GIT", "Documents", "Music". >> https://docs.microsoft.com/en-us/windows/client-management/windows-libraries >> >> T

Re: [OpenJDK 2D-Dev] RFR: 8263486: Clean up MTLSurfaceDataBase.h [v2]

2021-05-21 Thread Sergey Bylokhov
On Fri, 21 May 2021 15:14:23 GMT, Ajit Ghaisas wrote: >> This PR addresses some cleanup activities : >> - Cleaned up MTLSurfaceDataBase.h & MTLSurfaceData.m >> - Removed OpenGL references from MTLPipelineStatesStorage.m & >> MTLRenderQueue.m > > Ajit Ghaisas has updated the pull request with a

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-20 Thread Sergey Bylokhov
On Fri, 21 May 2021 04:15:41 GMT, Alexander Zuev wrote: >> Maybe we can test this case by just reusing this method where the >> "sf.getIcon(largeicon)" previously used in the WindowsPlacesBar class? That >> old method has the special code for "folder.isLibrary()" so I assume it >> supported th

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-20 Thread Sergey Bylokhov
On Fri, 21 May 2021 02:45:15 GMT, Sergey Bylokhov wrote: >> No, libraries are not supported. >> >> I see no contradiction here: `JFileChooser` uses Windows Shell API to >> enumerate objects and navigate the shell namespace. But it does not return >> non-file ob

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-20 Thread Sergey Bylokhov
On Thu, 20 May 2021 18:51:54 GMT, Alexey Ivanov wrote: >> So the libraries are not supported? I doubt since JFileChooser should >> support them, and supports of it is one of the reasons why we use shell >> folder to iterate the folders and do not use the javaio. > > No, libraries are not suppor

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v10]

2021-05-20 Thread Sergey Bylokhov
On Thu, 20 May 2021 22:59:43 GMT, Alexander Zuev wrote: >> I did not get how you will be able to force use MRI later since this method >> is implemented as a return icon. So this choice should be made before >> integration. > >> I did not get how you will be able to force use MRI later since th

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v10]

2021-05-20 Thread Sergey Bylokhov
On Thu, 20 May 2021 23:03:02 GMT, Alexander Zuev wrote: >> But this is shared code, which has a specification it should work >> everywhere, so even if on Linux and macOS it is not implemented in the best >> way it should return something. > >> But this is shared code, which has a specification

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v10]

2021-05-20 Thread Sergey Bylokhov
On Thu, 20 May 2021 19:25:38 GMT, Alexander Zuev wrote: >> Here I am not talking about specification, I am talking about the usage of >> it, is the instanceof+cast is helpful? It does not look good, why we cannot >> always return MRI? > >> Here I am not talking about specification, I am talking

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v10]

2021-05-20 Thread Sergey Bylokhov
On Thu, 20 May 2021 18:49:53 GMT, Alexander Zuev wrote: >> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 27: >> >>> 25: * @test >>> 26: * @bug 8182043 >>> 27: * @requires os.family == "windows" >> >> Other than using "explorer" what prevents us to run this test on

Re: [OpenJDK 2D-Dev] RFR: 8263486: Clean up MTLSurfaceDataBase.h

2021-05-20 Thread Sergey Bylokhov
On Thu, 13 May 2021 11:43:17 GMT, Ajit Ghaisas wrote: > This PR addresses some cleanup activities : > - Cleaned up MTLSurfaceDataBase.h & MTLSurfaceData.m > - Removed OpenGL references from MTLPipelineStatesStorage.m & > MTLRenderQueue.m src/java.desktop/macosx/native/libawt_lwawt/java2d/metal

Re: [OpenJDK 2D-Dev] RFR: 8263583: Emoji rendering on macOS [v3]

2021-05-20 Thread Sergey Bylokhov
On Fri, 7 May 2021 08:02:36 GMT, Dmitry Batrak wrote: >> This is the implementation used by JetBrains Runtime for the last 4 years, >> after some cleanup, and with one problem, >> found while preparing the pull request, fixed. >> Even though typical scenarios for a UI application should be cover

Re: [OpenJDK 2D-Dev] RFR: 8256372: [macos] Unexpected symbol was displayed on JTextField with Monospaced font

2021-05-20 Thread Sergey Bylokhov
On Tue, 18 May 2021 15:55:09 GMT, Phil Race wrote: > See the bug report for lots of explanation. > The short version (not that short) is that Swing adds a new line char to > editable TextComponents > It used to work because harfbuzz asked CoreText which mapped it to an > invisible glyph > Now h

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-20 Thread Sergey Bylokhov
On Thu, 20 May 2021 16:45:35 GMT, Alexander Zuev wrote: >> We do not test for that in the regression test but i did tested it manually >> and we do return null for the non-existed files. I tested it on non-windows >> platform too. We still return null. > >> Are we sure that all possible paths c

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v10]

2021-05-20 Thread Sergey Bylokhov
On Thu, 20 May 2021 17:25:33 GMT, Alexander Zuev wrote: >> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 72: >> >>> 70: if (icon.getImage() instanceof MultiResolutionImage) { >>> 71: MultiResolutionImage mri = (MultiResolutionImage) >>> ic

  1   2   3   4   5   6   7   8   9   10   >