Re: [OpenJDK 2D-Dev] RFR: 8250855: Address reliance on default constructors in the Java 2D APIs
Just for my curiosity, what issues can arise relying on default constructors? I couldn't find anything with google (apart from links back to these messages!) Thanks, Peter
Re: [OpenJDK 2D-Dev] RFR : 8248802: Add log helper methods to FontUtilities.java
Probably not my place to comment, but, does it matter that it's doing unnecessary work evaluating the argument to logWarning et al, in the case where logging is not enabled? It only seems to be string concatenation and maybe would be optimised out anyway, I don't know. Peter On Thu, 9 Jul 2020 at 08:32, Baesken, Matthias wrote: > > Thank‘s for the review ! > > May I get a second review ? > > > > > > Best regards, Matthias > > > > > > > > From: Jayathirth D v > Sent: Donnerstag, 9. Juli 2020 07:21 > To: Baesken, Matthias > Cc: 2d-dev@openjdk.java.net > Subject: Re: [OpenJDK 2D-Dev] RFR : 8248802: Add log helper methods to > FontUtilities.java > > > > Looks good to me. > > > > Thanks, > > Jay > > > > On 06-Jul-2020, at 12:43 PM, Baesken, Matthias > wrote: > > > > Hello, please review this small change to font related logging . > > > > We have a lot of font logging calls in java.desktop that look similar to this > coding : > > if (FontUtilities.isLogging()) { > FontUtilities.getLogger().info("Here comes my important info"); > } > > This coding could be simplified by adding static log methods to > FontUtilities.java > > > > public static void logWarning(String s); > > public static void logInfo(String s); > > public static void logSevere(String s); > > > > doing the isLogging check + FontUtilities.getLogger(). … > > > > > > > > Bug/webrev : > > > > https://bugs.openjdk.java.net/browse/JDK-8248802 > > > > http://cr.openjdk.java.net/~mbaesken/webrevs/8248802.0/ > > > > > > Thanks, Matthias > >
Re: [OpenJDK 2D-Dev] BufferedImage.getTileGridXOffset() not compliant with its specification?
On Fri, 21 Feb 2020 at 13:44, Martin Desruisseaux wrote: > Implementation of getTileGridXOffset() and getTileGridXOffset() in > BufferedImage seems in contradiction with specification. The RenderedImage > specification said: Is this the same as bug 8166038? https://bugs.openjdk.java.net/browse/JDK-8166038?attachmentSortBy=fileName
Re: [OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
On Tue, Nov 20, 2018 at 8:28 AM Laurent Bourgès wrote: > Will you have time to review 2 small patchs on time ? If it would help for me to have a look, I am happy to do so. Pete
Re: [OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
This has been given a Java bug number now: JDK-8212124 https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8212124 I have been following the discussion here and I have a couple of workarounds to try, which is great. But, is there any more information you need from me? I'm always happy to help. Thanks, Pete
Re: [OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
Hi Laurent, Thanks for the detailed explanation. I quickly checked on the older Windows system and the Java 11 window was the same size as the Java 8 one, implying no scaling was going on (I guess just because it has a lower resolution monitor) - so that confirms your hypothesis. If I use -Dsun.java2d.uiScale=1.0 that's OK for my laptop, it doesn't matter if the window is a bit small. However I believe some higher end systems have much higher scaling factors (2x, 3x?). Is there a general way to specify a 1px line regardless of scaling, because in my case I don't mind too much if it's a 'hair-line'? By the way, my actual application doesn't have 65000 lines but it draws 3 graphs with about 3000 points, which makes it noticeably slow when resizing the Window. I suppose I should look into cutting down the number of points somehow... Pete
Re: [OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
I can answer part of that, but I can't get access to the older system just now. On Wed, Oct 10, 2018 at 4:41 PM Philip Race wrote: > In other words does > > -Dsun.java2d.uiScale=1.0 > > even change the physical size of the window on JDK 9/10/11 ? > Yes, because I can run the same jar under Java 8 and 11. Without the scale option, the Java 11 window is bigger than the Java 8 one, by about 1.25x (this corresponds to my system setting) When I add the scale=1 option to both, they are both the same size (and the same as JDK8 without any scaling) I've attached 2 images so you can see what I mean, one is without any scale option (and I labelled the approx size on this) and the other is with -Dsun.java2d.uiScale=1.0. The window title contains the system property "java.runtime.version" so you can see which is which. I do appreciate your help on this. It looks like it's coming down to Intel's graphics driver, do you agree? Pete
Re: [OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
On Wed, Oct 10, 2018 at 1:21 PM Peter Hull wrote: > -Dsun.java2d.uiScale=1.0 > And this does make it fast again for me (paint time < 0.1sec)! Also I tried on an older system with "Intel HD Graphics 4600" and it did not have the slow down problem. So it seems to be quite specific to my system.
Re: [OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
On Wed, 10 Oct 2018 at 11:55 Laurent Bourgès wrote: > > Peter, > What is the corresponding bug ? > I don't know; I filled in the details and it said they would let me know the bug number if & when it was accepted. > > > I think it is -Djava2d.ui.scale=1.0 AFAIR. It's -Dsun.java2d.uiScale=1.0 And this does make it fast again for me (paint time < 0.1sec)! How do I make it run verbosely, I tried -Dsun.java2d.trace=log,out:log.txt,verbose But didn't see anything helpful. Thanks, Peter
Re: [OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
On Tue, Oct 9, 2018 at 3:52 PM Laurent Bourgès wrote: > Peter, what is your hardware & OS info ? It's an Intel core i7-8750H, 8GB RAM, intel UHD 630 graphics Windows 10 Pro 1803 build 17134.320 Note that Java 8 is still 'fast' so there must be some difference between 8 & 11. I saw that on Java 11, the window size was bigger. I assume this is due to the HiDPI support added in Java 9 (my display scaling is set to 125%, which is the 'recommended' setting) Are there any options I can pass to java.exe which would turn off scaling - that might help to narrow down the problem. By the way, I tried it on a Mac, it was also 'fast', so it just seems to be Windows at the moment. I would appreciate it if someone else on Windows could check it out. Thanks, Peter
[OpenJDK 2D-Dev] Speed of drawPolyline on JDK11
I posted this message first on Java Discuss and was asked to file a Java bug. It was also suggested I post it here for discussion. I've recently started using Java 11 and noticed that drawPolyline is much slower on my PC than it was on Java 8. Example, simplified code: @Override protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D graphics = (Graphics2D) g; long starttime = System.nanoTime(); graphics.drawPolyline(xs, ys, xs.length); long endtime = System.nanoTime(); Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Paint Time: {0}s", (double)(endtime-starttime) / 1.0e9); } where xs[] and ys[] are large (65536 points) integer arrays. On Java 8 I get a paint time of 0.025s and on Java 11 it is 25s, i.e. factor of 1000. This may be related to JEP263 (HiDPI) I've got a recent Core i7 processor with Intel graphics, running Windows 10. With VisualVM I can see that all the time goes in drawPolyline, I can't get any more detail than that. I have done some experimentation with RenderingHints but nothing makes the JDK11 go as fast as JDK8. Is there anything else I can try to either improve matters or to provide a clearer idea of why there is such a difference? I have a self-contained NetBeans project if anyone wants to try to see they can reproduce this. https://github.com/pedro-w/PolylineTest.git Thanks, Peter Versions: openjdk version "11" 2018-09-25 OpenJDK Runtime Environment 18.9 (build 11+28) OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode) openjdk version "1.8.0-adoptopenjdk" OpenJDK Runtime Environment (build 1.8.0-adoptopenjdk-_2018_05_19_00_59-b00) OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)