From Alan.Bateman at oracle.com Sat Feb 1 00:08:56 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 01 Feb 2014 08:08:56 +0000 Subject: JDK 9 RFR of JDK-8033181: Fix doclint missing issues in java.awt.{peer, im[.spi]} In-Reply-To: <52EBECF6.9080102@oracle.com> References: <52E9553F.4030606@oracle.com> <52EBECF6.9080102@oracle.com> Message-ID: <52ECAB98.70000@oracle.com> On 31/01/2014 18:35, Joe Darcy wrote: > *ping* > > Thanks, > > -Joe I've skimmed through the changes and don't see anything obviously wrong. All the @returns are okay. For the @param then it requires a bit of domain knowledge (and I don't know this area). For InputMethodContext.dispatchInputMethodEvent then I see it comes from InputMethodEvent so I think that is okay (btw: I think technically the input method area is i18n-awt rather than awt-dev). To my knowledge then the peer API is not in the generated javadoc but it looks okay to me too. One thing to consider is keeping the formatting consistent (where possible) for what seems to be the norm in this area. I see that there is typically a blank line between the method description and the @param or @return tags. The wrapping when descriptions go into two or more lines is another one. This type of thing is more obvious in a webrev or patch because it doesn't have color coding. This doesn't impact the generated javadoc of course. -Alan. From Alan.Bateman at oracle.com Sat Feb 1 00:11:59 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 01 Feb 2014 08:11:59 +0000 Subject: JDK 9 RFR of JDK-8033222: Fix serial lint warnings in sun.awt.* In-Reply-To: <52EBED13.6040106@oracle.com> References: <52E9E8BF.1050003@oracle.com> <52EBED13.6040106@oracle.com> Message-ID: <52ECAC4F.6050605@oracle.com> On 31/01/2014 18:36, Joe Darcy wrote: > *ping* > > Thanks, > > -Joe This update looks okay to me. It would be good for someone working in this area to re-visit these at some point to see if any of these are actually serialized (indirectly) and whether any other actions should be taken. -Alan From Alan.Bateman at oracle.com Sun Feb 2 03:51:46 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 02 Feb 2014 11:51:46 +0000 Subject: Should changes to client libraries be pushed to jdk9/dev instead of jdk9/client In-Reply-To: <52EC35BF.60505@oracle.com> References: <52E40C2C.8070503@oracle.com> <52E4D5A4.4040104@oracle.com> <52EB67F2.7030800@oracle.com> <52EB754C.6040904@oracle.com> <52EC35BF.60505@oracle.com> Message-ID: <52EE3152.6020006@oracle.com> On 31/01/2014 23:46, Joseph Darcy wrote: > : > > Discussions are on going as to which forest client libraries fixes > should go into, the client forest (where closed-source deployment > changes happen to be going) or to the dev forest where all the other > libraries work is going; FWIW, I favor the latter. I would too but I assume it depends on whether the changes require any special pre-integration testing that would prohibit weekly or more frequent integrations into master. > > In any case, for all the forests which will be integrating into dev, > including the client and hotspot forests, the maintainers of those > forests are responsible for regularly pulling down changes from dev > and merging them in. In my estimation, unless there is a reason for > temporary isolation, the frequency of syncing with dev should be > closer to daily than weekly or monthly. The dev forest was open for > business on Dec. 13, 2013, and fixes started going into it that day. > From my reading of the JDK 9 master > (http://hg.openjdk.java.net/jdk9/jdk9/jdk/), the tag for jdk9-b01 was > added about three weeks ago. So if the first sync from dev into client > has only done in the last day or two, that would seem to be tardy to me. I assume that since this is a new structure that it will take time to get used to. While I'm not too concerned about jdk9/client being behind for a bit, I do wonder about the changes backing up in jdk9/client. I don't think there has been any client->dev push yet and some of the changes in jdk9/client were pushed in December. Hopefully that will be sorted out soon. > > The goal for dev is to have integrations into master no less than > weekly, but I'd like us to transition to having smaller and more > frequent integrations. We are laying the foundational work, cleaning > up intermittent test failures, etc. to allow that to happen. Indeed, and I expect that the test work will continue for a long time. -Alan. From anton.tarasov at oracle.com Mon Feb 3 06:36:48 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Mon, 03 Feb 2014 18:36:48 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52EC4F5E.7060906@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> Message-ID: <52EFA980.6000404@oracle.com> Hi Jim, Please look at the updated version: http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.4 On 01.02.2014 5:35, Jim Graham wrote: > Hi Anton, > > On 1/31/14 6:37 AM, Anton V. Tarasov wrote: >> My understanding is that, unless the fix is absolutely irrelevant (whic >> I hope it isn't), we should integrate it into 9/8u20 to support >> SwingNode in its current implementation on Retina displays. >> >> What do you think? > > I agree with this sentiment. My suggestion for reducing its footprint aside (which it looks like > you are investigating), the main thing I will be looking for is whether or not we return an object > to a developer (i.e. it isn't just managed internally to our own code) where they can do > "instanceof BufferedImage" and then see something odd coming from its width/height. > > It looks like if we simply use getLayoutWH() internally then they would never ever see anything > odd from getWidthHeight() anyway. The only additional "gotcha" would be if they grab the image and > render it directly and it comes out an unexpected size to them (because, for instance, they didn't > check the layout dims like we do internally). That's a pretty minor issue, though, and I think we > could live with it. I've refactored the fix with this concern in mind. Here is what I've done: - eliminated the new OffscreenHiDPIImage class (as you suggested) and put all of its "scale" logic into the OffscreenImage. - made the scaled OffscreenImage return the physical size (like an ordinary BufferredImage does) by default . - renamed the "set/isHiDPIEnabled" method to "set/isReturnLayoutSize". - made the setReturnLayoutSize(true) be called internally (where we don't leak the OffscreenImage). In SG2D, the drawHiDPIImage, for instance, makes a call to op.filter(img, null); where the img is expected to return its layout size. That's why I still prefer to use the setReturnLayoutSize "switcher", in order not to go deep into the 2D rendering code, casting here and there to OffscreenImage and calling getLayoutWidth/Height. > > For 9.0 perhaps we could add the LayoutWH() as new API on BufferedImage and then most of this > would be public? I'd have to mull over if that makes sense and I'm not entirely sure of the > naming yet... That's a good idea, however we need a 8u working solution as well... As to the naming, I'm ready for any suggestions. Thanks, Anton. > > ...jim From artem.ananiev at oracle.com Mon Feb 3 07:47:25 2014 From: artem.ananiev at oracle.com (Artem Ananiev) Date: Mon, 03 Feb 2014 19:47:25 +0400 Subject: Setting a component orientation in JRSUI In-Reply-To: <52DFE254.7040408@oracle.com> References: <52DFE254.7040408@oracle.com> Message-ID: <52EFBA0D.9090409@oracle.com> Adding java-dev at apple alias to CC. Artem On 1/22/2014 7:23 PM, Alexander Scherbatiy wrote: > > Hello, > > Below is the code that shows that setting a component orientation for > the JProgressBar in Aqua L&F does not work. > > My assumption was that the Direction should be properly set to the > painter state in the AquaProgressBarUI like: > ----------------------------- > public void paint(final Graphics g, final JComponent c) { > ... > painter.state.set(c.getComponentOrientation().isLeftToRight() ? > Direction.RIGHT : Direction.LEFT); > } > ----------------------------- > but it does not work. > > The painter calls the JRSUI library to show components on Mac OS X. > > Is there any specification for the JRSUI library? > What is the right way to set the component direction in the JRSUI. > > Thanks, > Alexandr. > > > ------------------ Code Sample ---------- > import java.awt.*; > import java.awt.event.*; > import javax.swing.*; > > public class JProgressBarOrientationTest { > > static boolean leftToRight = true; > > public static void main(String[] args) throws Exception { > > SwingUtilities.invokeLater(new Runnable() { > > @Override > public void run() { > JFrame frame = new JFrame(); > frame.setSize(300, 200); > > final JProgressBar progressBar = new JProgressBar(0, 100); > progressBar.setValue(30); > progressBar.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); > > JButton button = new JButton("Change orientation"); > button.addActionListener(new ActionListener() { > > @Override > public void actionPerformed(ActionEvent e) { > leftToRight = !leftToRight; > progressBar.setComponentOrientation(leftToRight ? > ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT); > } > }); > > JPanel panel = new JPanel(new BorderLayout()); > panel.add(progressBar, BorderLayout.CENTER); > panel.add(button, BorderLayout.SOUTH); > frame.getContentPane().add(panel); > frame.setVisible(true); > } > }); > } > } > ------------------------------------- From omajid at redhat.com Mon Feb 3 09:43:27 2014 From: omajid at redhat.com (Omair Majid) Date: Mon, 3 Feb 2014 12:43:27 -0500 Subject: RFR: Allow using a system installed libpng Message-ID: <20140203174327.GA9174@redhat.com> Hi, The following webrevs modify the build system to allow building against the system-installed copy of libpng as well as using the bundled copy of libpng ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ A new configure option `--with-libpng` is introduced which defaults to `bundled` but can be set to `system` to use the system-installed copy of libpng. This patch (with minor differences) has been used in Fedora builds for a while now [1]. Thanks, Omair [1] http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/commit/system-libpng.patch?id=ff9254ee03799a98689692ee9ae060b3a31af213 -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From magnus.ihse.bursie at oracle.com Mon Feb 3 11:41:52 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Mon, 03 Feb 2014 20:41:52 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140203174327.GA9174@redhat.com> References: <20140203174327.GA9174@redhat.com> Message-ID: <52EFF100.8000004@oracle.com> On 2014-02-03 18:43, Omair Majid wrote: > Hi, > > The following webrevs modify the build system to allow building against > the system-installed copy of libpng as well as using the bundled copy of > libpng > > ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ > JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ > > A new configure option `--with-libpng` is introduced which defaults to > `bundled` but can be set to `system` to use the system-installed copy of > libpng. Thank you for the patch! Looks good to me (but I'm no formal reviewer), apart from this line in libraries.m4: with_libpng=${DEFAULT_libpng} which should be DEFAULT_LIBPNG, I assume, otherwise the default case will not work. Due to this, I'd like to ask you to please double check that --with-libpng=system | bundled | invalid-value | , and no flag at all, all work as expected. /Magnus From omajid at redhat.com Mon Feb 3 12:44:41 2014 From: omajid at redhat.com (Omair Majid) Date: Mon, 3 Feb 2014 15:44:41 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <52EFF100.8000004@oracle.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> Message-ID: <20140203204441.GC9174@redhat.com> * Magnus Ihse Bursie [2014-02-03 14:42]: > > On 2014-02-03 18:43, Omair Majid wrote: > >Hi, > > > >The following webrevs modify the build system to allow building against > >the system-installed copy of libpng as well as using the bundled copy of > >libpng > > > >ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ > >JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ > > > >A new configure option `--with-libpng` is introduced which defaults to > >`bundled` but can be set to `system` to use the system-installed copy of > >libpng. > > Thank you for the patch! > > Looks good to me (but I'm no formal reviewer), apart from this line > in libraries.m4: > with_libpng=${DEFAULT_libpng} > > which should be DEFAULT_LIBPNG, I assume, otherwise the default case > will not work. Whoops. Updated webrevs: root: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/02/ jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/02-jdk/ > Due to this, I'd like to ask you to please double check that > --with-libpng=system | bundled | invalid-value | , and no > flag at all, all work as expected. I re-ran all these 4 options. system builds with system, bundled and build a bundled copy and invalid-value fails during configure. Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From magnus.ihse.bursie at oracle.com Mon Feb 3 13:51:20 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Mon, 03 Feb 2014 22:51:20 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140203204441.GC9174@redhat.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <20140203204441.GC9174@redhat.com> Message-ID: <52F00F58.4060404@oracle.com> On 2014-02-03 21:44, Omair Majid wrote: > Whoops. Updated webrevs: > root: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/02/ > jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/02-jdk/ > >> Due to this, I'd like to ask you to please double check that >> --with-libpng=system | bundled | invalid-value | , and no >> flag at all, all work as expected. > I re-ran all these 4 options. system builds with system, bundled and > build a bundled copy and invalid-value fails during configure. Great, thank you. The fix looks good. /Magnus From swingler at apple.com Mon Feb 3 15:10:53 2014 From: swingler at apple.com (Mike Swingler) Date: Mon, 03 Feb 2014 15:10:53 -0800 Subject: Setting a component orientation in JRSUI In-Reply-To: <52DFE254.7040408@oracle.com> References: <52DFE254.7040408@oracle.com> Message-ID: <763D7A5E-FBD6-47C1-B5B0-E6E7DA8A7309@apple.com> On Jan 22, 2014, at 7:23 AM, Alexander Scherbatiy wrote: > Hello, > > Below is the code that shows that setting a component orientation for the JProgressBar in Aqua L&F does not work. > > My assumption was that the Direction should be properly set to the painter state in the AquaProgressBarUI like: > ----------------------------- > public void paint(final Graphics g, final JComponent c) { > ... > painter.state.set(c.getComponentOrientation().isLeftToRight() ? Direction.RIGHT : Direction.LEFT); > } > ----------------------------- > but it does not work. > > The painter calls the JRSUI library to show components on Mac OS X. > > Is there any specification for the JRSUI library? > What is the right way to set the component direction in the JRSUI. > > Thanks, > Alexandr. > > > ------------------ Code Sample ---------- > import java.awt.*; > import java.awt.event.*; > import javax.swing.*; > > public class JProgressBarOrientationTest { > > static boolean leftToRight = true; > > public static void main(String[] args) throws Exception { > > SwingUtilities.invokeLater(new Runnable() { > > @Override > public void run() { > JFrame frame = new JFrame(); > frame.setSize(300, 200); > > final JProgressBar progressBar = new JProgressBar(0, 100); > progressBar.setValue(30); > progressBar.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); > > JButton button = new JButton("Change orientation"); > button.addActionListener(new ActionListener() { > > @Override > public void actionPerformed(ActionEvent e) { > leftToRight = !leftToRight; > progressBar.setComponentOrientation(leftToRight ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT); > } > }); > > JPanel panel = new JPanel(new BorderLayout()); > panel.add(progressBar, BorderLayout.CENTER); > panel.add(button, BorderLayout.SOUTH); > frame.getContentPane().add(panel); > frame.setVisible(true); > } > }); > } > } > ------------------------------------- There is no spec for the JRSUI library, since it's generally a passthrough to underlying undocumented API. In this case, there is no right-to-left version of the progress bar in OS X. You can confirm this by building a sample app in Xcode, and running it in an RTL language like Hebrew or Arabic. The code above looks like it should do the right thing if/when the underlying OS does the right thing. Regards, Mike Swingler Apple Inc. From joe.darcy at oracle.com Mon Feb 3 21:25:10 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 03 Feb 2014 21:25:10 -0800 Subject: JDK 9 RFR of JDK-8033526: Fix serial lint warnings in java.awt.* Message-ID: <52F079B6.1010501@oracle.com> Hello, Please review the patch below to address JDK-8033526: Fix serial lint warnings in java.awt.* http://cr.openjdk.java.net/~darcy/8033526.0/ The patch just adds serialVersionUID values to various serializable classes that have long been in java.awt.*. I've verified the serialver computation matched on both JDK 6 and JDK 8. Thanks, -Joe --- old/src/share/classes/java/awt/color/CMMException.java 2014-02-03 21:21:08.000000000 -0800 +++ new/src/share/classes/java/awt/color/CMMException.java 2014-02-03 21:21:08.000000000 -0800 @@ -47,6 +47,7 @@ */ public class CMMException extends java.lang.RuntimeException { + private static final long serialVersionUID = 5775558044142994965L; /** * Constructs a CMMException with the specified detail message. --- old/src/share/classes/java/awt/color/ProfileDataException.java 2014-02-03 21:21:09.000000000 -0800 +++ new/src/share/classes/java/awt/color/ProfileDataException.java 2014-02-03 21:21:09.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -31,6 +31,7 @@ */ public class ProfileDataException extends java.lang.RuntimeException { + private static final long serialVersionUID = 7286140888240322498L; /** * Constructs a ProfileDataException with the specified detail message. --- old/src/share/classes/java/awt/datatransfer/FlavorEvent.java 2014-02-03 21:21:10.000000000 -0800 +++ new/src/share/classes/java/awt/datatransfer/FlavorEvent.java 2014-02-03 21:21:10.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -38,6 +38,8 @@ * @since 1.5 */ public class FlavorEvent extends EventObject { + private static final long serialVersionUID = -5842664112252414548L; + /** * Constructs a FlavorEvent object. * --- old/src/share/classes/java/awt/geom/IllegalPathStateException.java 2014-02-03 21:21:11.000000000 -0800 +++ new/src/share/classes/java/awt/geom/IllegalPathStateException.java 2014-02-03 21:21:10.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -35,6 +35,8 @@ */ public class IllegalPathStateException extends RuntimeException { + private static final long serialVersionUID = -5158084205220481094L; + /** * Constructs an IllegalPathStateException with no * detail message. --- old/src/share/classes/java/awt/geom/NoninvertibleTransformException.java 2014-02-03 21:21:11.000000000 -0800 +++ new/src/share/classes/java/awt/geom/NoninvertibleTransformException.java 2014-02-03 21:21:11.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -33,6 +33,8 @@ */ public class NoninvertibleTransformException extends java.lang.Exception { + private static final long serialVersionUID = 6137225240503990466L; + /** * Constructs an instance of * NoninvertibleTransformException --- old/src/share/classes/java/awt/image/ImagingOpException.java 2014-02-03 21:21:12.000000000 -0800 +++ new/src/share/classes/java/awt/image/ImagingOpException.java 2014-02-03 21:21:12.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -32,6 +32,7 @@ * process the image. */ public class ImagingOpException extends java.lang.RuntimeException { + private static final long serialVersionUID = 8026288481846276658L; /** * Constructs an ImagingOpException object with the --- old/src/share/classes/java/awt/image/RasterFormatException.java 2014-02-03 21:21:13.000000000 -0800 +++ new/src/share/classes/java/awt/image/RasterFormatException.java 2014-02-03 21:21:13.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -31,6 +31,7 @@ * invalid layout information in the {@link Raster}. */ public class RasterFormatException extends java.lang.RuntimeException { + private static final long serialVersionUID = 96598996116164315L; /** * Constructs a new RasterFormatException with the --- old/src/share/classes/java/awt/image/renderable/ParameterBlock.java 2014-02-03 21:21:13.000000000 -0800 +++ new/src/share/classes/java/awt/image/renderable/ParameterBlock.java 2014-02-03 21:21:13.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -93,6 +93,8 @@ * * */ public class ParameterBlock implements Cloneable, Serializable { + private static final long serialVersionUID = -7577115551785240750L; + /** A Vector of sources, stored as arbitrary Objects. */ protected Vector sources = new Vector(); --- old/src/share/classes/java/awt/print/PrinterAbortException.java 2014-02-03 21:21:14.000000000 -0800 +++ new/src/share/classes/java/awt/print/PrinterAbortException.java 2014-02-03 21:21:14.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -33,6 +33,7 @@ */ public class PrinterAbortException extends PrinterException { + private static final long serialVersionUID = 4725169026278854136L; /** * Constructs a new PrinterAbortException with no --- old/src/share/classes/java/awt/print/PrinterException.java 2014-02-03 21:21:15.000000000 -0800 +++ new/src/share/classes/java/awt/print/PrinterException.java 2014-02-03 21:21:15.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -32,6 +32,7 @@ */ public class PrinterException extends Exception { + private static final long serialVersionUID = -3757589981158265819L; /** * Constructs a new PrinterException object From oleg.pekhovskiy at oracle.com Mon Feb 3 22:26:20 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Tue, 04 Feb 2014 10:26:20 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52DE84D4.6030203@oracle.com> References: <52DE84D4.6030203@oracle.com> Message-ID: <52F0880C.2080602@oracle.com> Hi All, please review the second version of fix: http://cr.openjdk.java.net/~bagiras/8020443.2/ It turned out that struts must be checked and corrected from all sides to become the proper screen insets. Thanks, Oleg On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: > Hi all, > > please review the fix > http://cr.openjdk.java.net/~bagiras/8020443.1/ > for > https://bugs.openjdk.java.net/browse/JDK-8020443 > > Referring to the standards, we must calculate insets the special way > for Xinerama: > http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html > > _NET_WM_STRUT_PARTIAL > "The start and end values associated with each strut allow areas to be > reserved which do not span the entire width or height of the screen. > Struts MUST be specified in root window coordinates, that is, they are > /not/ relative to the edges of any view port or Xinerama monitor." > > So the fix checks if the insets have absolute values and if so makes > them relative to each screen. > The issue occurred when the Frame was created with the location by > default. > > Thanks, > Oleg > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140204/f47e2ca4/attachment.html From david.holmes at oracle.com Mon Feb 3 23:07:40 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 04 Feb 2014 17:07:40 +1000 Subject: RFR: Allow using a system installed libpng In-Reply-To: <52F00F58.4060404@oracle.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <20140203204441.GC9174@redhat.com> <52F00F58.4060404@oracle.com> Message-ID: <52F091BC.5050308@oracle.com> On 4/02/2014 7:51 AM, Magnus Ihse Bursie wrote: > > On 2014-02-03 21:44, Omair Majid wrote: >> Whoops. Updated webrevs: >> root: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/02/ >> jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/02-jdk/ >> >>> Due to this, I'd like to ask you to please double check that >>> --with-libpng=system | bundled | invalid-value | , and no >>> flag at all, all work as expected. >> I re-ran all these 4 options. system builds with system, bundled and >> build a bundled copy and invalid-value fails during configure. > Great, thank you. The fix looks good. Looks good to me too from a build perspective. Have no idea whether there may be any issues actually trying to use the system version of libpng. Someone from AWT also needs to sign-off. David > /Magnus From alexander.zvegintsev at oracle.com Tue Feb 4 03:28:56 2014 From: alexander.zvegintsev at oracle.com (Alexander Zvegintsev) Date: Tue, 04 Feb 2014 15:28:56 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F0880C.2080602@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> Message-ID: <52F0CEF8.7030805@oracle.com> Hi Oleg, I am just curious about adding rootBounds.x and rootBounds.y, it looks redundant to me. Is there a case when a root window have coordinates with non-zero values? MultiScreenInsetsTest.java: > 62 if ((bounds.x != 0 && insets.left >= bounds.x) > 63 || (bounds.y != 0 && insets.top >= bounds.y)) { This check will fail for screen with [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, but it is a valid case. I think we should check insets against screen width and height: if (insets.left >= bounds.width || insets.right >= bounds.width || insets.top >= bounds.height || insets.bottom >= bounds.height) { Otherwise fix looks good to me. Thanks, Alexander. On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: > Hi All, > > please review the second version of fix: > http://cr.openjdk.java.net/~bagiras/8020443.2/ > > It turned out that struts must be checked and corrected from all sides > to become the proper screen insets. > > Thanks, > Oleg > > On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >> Hi all, >> >> please review the fix >> http://cr.openjdk.java.net/~bagiras/8020443.1/ >> for >> https://bugs.openjdk.java.net/browse/JDK-8020443 >> >> Referring to the standards, we must calculate insets the special way >> for Xinerama: >> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >> >> _NET_WM_STRUT_PARTIAL >> "The start and end values associated with each strut allow areas to >> be reserved which do not span the entire width or height of the >> screen. Struts MUST be specified in root window coordinates, that is, >> they are /not/ relative to the edges of any view port or Xinerama >> monitor." >> >> So the fix checks if the insets have absolute values and if so makes >> them relative to each screen. >> The issue occurred when the Frame was created with the location by >> default. >> >> Thanks, >> Oleg >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140204/4318d4dc/attachment.html From Sergey.Bylokhov at oracle.com Tue Feb 4 03:52:31 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 04 Feb 2014 15:52:31 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked Message-ID: <52F0D47F.5090506@oracle.com> Hello. Please review the fix for jdk 9. - Initial fix for MACOSX_PORT-424 was reverted back. - delegate.addNotify(),because it was called from delegateContainer.addNotify(); - Testcase was updated to filter out events not from the Frame: 84 if (e.getSource() instanceof Frame) { 85 counter++; 86 notify(); 87 } Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 Webrev can be found at: http://cr.openjdk.java.net/~serb/8032187/webrev.00 -- Best regards, Sergey. From alexandr.scherbatiy at oracle.com Tue Feb 4 04:42:03 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Tue, 04 Feb 2014 16:42:03 +0400 Subject: [9] Review request for 8033534 Get MultiResolution image from native system Message-ID: <52F0E01B.3050004@oracle.com> Hello, Could you review the fix: bug: https://bugs.openjdk.java.net/browse/JDK-8033534 webrev: http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 - The method that gets a sorted array of NSImage representaion pixel sizes for the given image size is added - A MultiResolution image is created if an NSImage has several representations for the given image size Thanks, Alexandr. From Sergey.Bylokhov at oracle.com Tue Feb 4 05:00:22 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 04 Feb 2014 17:00:22 +0400 Subject: [9] Review request for 8033534 Get MultiResolution image from native system In-Reply-To: <52F0E01B.3050004@oracle.com> References: <52F0E01B.3050004@oracle.com> Message-ID: <52F0E466.6040002@oracle.com> Hi, Alexander. I think that getResolutionVariant should return an image which is close as much as possible to the requested size. On 04.02.2014 16:42, Alexander Scherbatiy wrote: > > Hello, > > Could you review the fix: > bug: https://bugs.openjdk.java.net/browse/JDK-8033534 > webrev: http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 > > - The method that gets a sorted array of NSImage representaion pixel > sizes for the given image size is added > - A MultiResolution image is created if an NSImage has several > representations for the given image size > > Thanks, > Alexandr. > -- Best regards, Sergey. From oleg.pekhovskiy at oracle.com Tue Feb 4 05:00:47 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Tue, 04 Feb 2014 17:00:47 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F0CEF8.7030805@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> <52F0CEF8.7030805@oracle.com> Message-ID: <52F0E47F.3070309@oracle.com> Hi Alexander, thank you for the review! 1. The problem is that I didn't find that root window ALWAYS starts with 0, 0 in X11 docs. Could you please point such statement out to avoid uncertainty? 2. Checking insets against screen width and height can fail too. Example: 1st screen (0, 0, 1024, 768) - x, y, width, height 2nd screen (1024, 0, 1920, 1080) Struts for the 2nd screen could be (1074, 0, 20, 0) - left, right, top, bottom. So left strut 1075 fits in 1920 but should be 50 as inset. PS: Just curious: you said that screen (1000, 50, 1000, 1000) is a valid case. Is it valid for testing environment? As I see screens are left-top aligned. It means that if two screens are located from left to right, they both have y == 0 regardless of their height. Usually insets are much less than dimensions of a screen and so strut minus screen edge should be less than summary dimension of neighbor screens. Please, correct me if I'm wrong. Thanks, Oleg 04.02.2014 15:28, Alexander Zvegintsev wrote: > Hi Oleg, > > I am just curious about adding rootBounds.x and rootBounds.y, it looks > redundant to me. > Is there a case when a root window have coordinates with non-zero values? > > MultiScreenInsetsTest.java: >> 62 if ((bounds.x != 0 && insets.left >= bounds.x) >> 63 || (bounds.y != 0 && insets.top >= bounds.y)) { > This check will fail for screen with > [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, > but it is a valid case. > > I think we should check insets against screen width and height: > if (insets.left >= bounds.width > || insets.right >= bounds.width > || insets.top >= bounds.height > || insets.bottom >= bounds.height) { > > > Otherwise fix looks good to me. > > Thanks, > > Alexander. > On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: >> Hi All, >> >> please review the second version of fix: >> http://cr.openjdk.java.net/~bagiras/8020443.2/ >> >> It turned out that struts must be checked and corrected from all sides >> to become the proper screen insets. >> >> Thanks, >> Oleg >> >> On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >>> Hi all, >>> >>> please review the fix >>> http://cr.openjdk.java.net/~bagiras/8020443.1/ >>> for >>> https://bugs.openjdk.java.net/browse/JDK-8020443 >>> >>> Referring to the standards, we must calculate insets the special way >>> for Xinerama: >>> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >>> >>> _NET_WM_STRUT_PARTIAL >>> "The start and end values associated with each strut allow areas to >>> be reserved which do not span the entire width or height of the >>> screen. Struts MUST be specified in root window coordinates, that >>> is, they are /not/ relative to the edges of any view port or >>> Xinerama monitor." >>> >>> So the fix checks if the insets have absolute values and if so makes >>> them relative to each screen. >>> The issue occurred when the Frame was created with the location by >>> default. >>> >>> Thanks, >>> Oleg >>> >> > From alexandr.scherbatiy at oracle.com Tue Feb 4 05:29:19 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Tue, 04 Feb 2014 17:29:19 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F0D47F.5090506@oracle.com> References: <52F0D47F.5090506@oracle.com> Message-ID: <52F0EB2F.4000405@oracle.com> The fix looks good for me. Thanks, Alexandr. On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: > Hello. > Please review the fix for jdk 9. > - Initial fix for MACOSX_PORT-424 was reverted back. > - delegate.addNotify(),because it was called from > delegateContainer.addNotify(); > - Testcase was updated to filter out events not from the Frame: > 84 if (e.getSource() instanceof Frame) { > 85 counter++; > 86 notify(); > 87 } > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 > Webrev can be found at: > http://cr.openjdk.java.net/~serb/8032187/webrev.00 > From alexander.zvegintsev at oracle.com Tue Feb 4 07:50:23 2014 From: alexander.zvegintsev at oracle.com (Alexander Zvegintsev) Date: Tue, 04 Feb 2014 19:50:23 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F0E47F.3070309@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> <52F0CEF8.7030805@oracle.com> <52F0E47F.3070309@oracle.com> Message-ID: <52F10C3F.3080202@oracle.com> Oleg, please see inline On 02/04/2014 05:00 PM, Oleg Pekhovskiy wrote: > Hi Alexander, > > thank you for the review! > > 1. The problem is that I didn't find that root window ALWAYS starts > with 0, 0 in X11 docs. > Could you please point such statement out to avoid uncertainty? Unfortunately, I cannot find any document which clearly specifies this. is the root of this hierarchy. On my understanding root window is the root of windows treehierarchy and all other windows are children or descendants of it. So root window is the origin for all other windows and and I assume that it has (0,0) coordinates always and I would be surprised if it not. > 2. Checking insets against screen width and height can fail too. Example: > 1st screen (0, 0, 1024, 768) - x, y, width, height > 2nd screen (1024, 0, 1920, 1080) > Struts for the 2nd screen could be (1074, 0, 20, 0) - left, right, > top, bottom. > So left strut 1075 fits in 1920 but should be 50 as inset. Yes, my check will fail on this case. > PS: Just curious: you said that screen (1000, 50, 1000, 1000) is a > valid case. > Is it valid for testing environment? As I see screens are left-top > aligned. > It means that if two screens are located from left to right, they both > have y == 0 regardless of their height. It is a valid case, screens can be arranged in any order, screens even can be overlapped, may have empty spaces between. (and we definitely will not support last 2 cases). My previous example was a little abstract, here is the real one with screens aligned on bottom edge: Screen #1 (0,0, 1920, 1080) Screen #2 (1920, 30, 1680, 1050) with top inset 35 It is unlikely that we will meet such configuration, but who knows. Since this test will run on machines with environment close to default I propose to made an assumption that insets are not greater that a quarter (or 1/3?) of width and height (and add a comment why we do that and why test may fail): if (insets.left >= bounds.width / 4 || insets.right >= bounds.width / 4 || insets.top >= bounds.height / 4 || insets.bottom >= bounds.height / 4) { Thanks, Alexander. > Usually insets are much less than dimensions of a screen and so strut > minus screen edge should be less > than summary dimension of neighbor screens. > Please, correct me if I'm wrong. > > Thanks, > Oleg > > 04.02.2014 15:28, Alexander Zvegintsev wrote: >> Hi Oleg, >> >> I am just curious about adding rootBounds.x and rootBounds.y, it >> looks redundant to me. >> Is there a case when a root window have coordinates with non-zero >> values? >> >> MultiScreenInsetsTest.java: >>> 62 if ((bounds.x != 0 && insets.left >= bounds.x) >>> 63 || (bounds.y != 0 && insets.top >= bounds.y)) { >> This check will fail for screen with >> [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, >> but it is a valid case. >> >> I think we should check insets against screen width and height: >> if (insets.left >= bounds.width >> || insets.right >= bounds.width >> || insets.top >= bounds.height >> || insets.bottom >= bounds.height) { >> >> >> Otherwise fix looks good to me. >> >> Thanks, >> >> Alexander. >> On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: >>> Hi All, >>> >>> please review the second version of fix: >>> http://cr.openjdk.java.net/~bagiras/8020443.2/ >>> >>> It turned out that struts must be checked and corrected from all sides >>> to become the proper screen insets. >>> >>> Thanks, >>> Oleg >>> >>> On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >>>> Hi all, >>>> >>>> please review the fix >>>> http://cr.openjdk.java.net/~bagiras/8020443.1/ >>>> for >>>> https://bugs.openjdk.java.net/browse/JDK-8020443 >>>> >>>> Referring to the standards, we must calculate insets the special >>>> way for Xinerama: >>>> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >>>> >>>> _NET_WM_STRUT_PARTIAL >>>> "The start and end values associated with each strut allow areas to >>>> be reserved which do not span the entire width or height of the >>>> screen. Struts MUST be specified in root window coordinates, that >>>> is, they are /not/ relative to the edges of any view port or >>>> Xinerama monitor." >>>> >>>> So the fix checks if the insets have absolute values and if so >>>> makes them relative to each screen. >>>> The issue occurred when the Frame was created with the location by >>>> default. >>>> >>>> Thanks, >>>> Oleg >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140204/fa11882c/attachment-0001.html From anthony.petrov at oracle.com Tue Feb 4 10:55:23 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Tue, 04 Feb 2014 22:55:23 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52EFA980.6000404@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> Message-ID: <52F1379B.7000004@oracle.com> Hi Anton, I skimmed through the code that I'm familiar with, and the changes look good to me. Someone from Swing and 2D should review their parts, too. -- best regards, Anthony On 2/3/2014 6:36 PM, Anton V. Tarasov wrote: > Hi Jim, > > Please look at the updated version: > > http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.4 > > On 01.02.2014 5:35, Jim Graham wrote: >> Hi Anton, >> >> On 1/31/14 6:37 AM, Anton V. Tarasov wrote: >>> My understanding is that, unless the fix is absolutely irrelevant (whic >>> I hope it isn't), we should integrate it into 9/8u20 to support >>> SwingNode in its current implementation on Retina displays. >>> >>> What do you think? >> >> I agree with this sentiment. My suggestion for reducing its footprint >> aside (which it looks like you are investigating), the main thing I >> will be looking for is whether or not we return an object to a >> developer (i.e. it isn't just managed internally to our own code) >> where they can do "instanceof BufferedImage" and then see something >> odd coming from its width/height. >> >> It looks like if we simply use getLayoutWH() internally then they >> would never ever see anything odd from getWidthHeight() anyway. The >> only additional "gotcha" would be if they grab the image and render it >> directly and it comes out an unexpected size to them (because, for >> instance, they didn't check the layout dims like we do internally). >> That's a pretty minor issue, though, and I think we could live with it. > > I've refactored the fix with this concern in mind. Here is what I've done: > > - eliminated the new OffscreenHiDPIImage class (as you suggested) and > put all of its "scale" logic into the OffscreenImage. > - made the scaled OffscreenImage return the physical size (like an > ordinary BufferredImage does) by default . > - renamed the "set/isHiDPIEnabled" method to "set/isReturnLayoutSize". > - made the setReturnLayoutSize(true) be called internally (where we > don't leak the OffscreenImage). > > In SG2D, the drawHiDPIImage, for instance, makes a call to > op.filter(img, null); where the img is expected to return its layout > size. That's why I still prefer to use the setReturnLayoutSize > "switcher", in order not to go deep into the 2D rendering code, casting > here and there to OffscreenImage and calling getLayoutWidth/Height. > >> >> For 9.0 perhaps we could add the LayoutWH() as new API on >> BufferedImage and then most of this would be public? I'd have to mull >> over if that makes sense and I'm not entirely sure of the naming yet... > > That's a good idea, however we need a 8u working solution as well... As > to the naming, I'm ready for any suggestions. > > Thanks, > Anton. > >> >> ...jim > From anthony.petrov at oracle.com Tue Feb 4 11:06:22 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Tue, 04 Feb 2014 23:06:22 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F0D47F.5090506@oracle.com> References: <52F0D47F.5090506@oracle.com> Message-ID: <52F13A2E.8030404@oracle.com> Hi Sergey, From the bug report: > After discussion, it was decided to accept MACOSX_PORT-424 as not a defect Are you saying that user code will start receiving hierarchy events related to the internal hierarchy of our LWAWT peers? Why would anyone want to process these events and why would we want to post them to user code? Is there any way to filter them out? While I agree that using reflection is a bad idea, but is there any other real problem with the original fix for MACOSX_PORT-424? I.e. does that fix break anything? If not, can we simply replace usages of reflection with AWTAccessor-like mechanism? -- best regards, Anthony On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: > Hello. > Please review the fix for jdk 9. > - Initial fix for MACOSX_PORT-424 was reverted back. > - delegate.addNotify(),because it was called from > delegateContainer.addNotify(); > - Testcase was updated to filter out events not from the Frame: > 84 if (e.getSource() instanceof Frame) { > 85 counter++; > 86 notify(); > 87 } > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 > Webrev can be found at: http://cr.openjdk.java.net/~serb/8032187/webrev.00 > From Sergey.Bylokhov at oracle.com Tue Feb 4 13:26:08 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Wed, 05 Feb 2014 01:26:08 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F13A2E.8030404@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> Message-ID: <52F15AF0.6040509@oracle.com> On 04.02.2014 23:06, Anthony Petrov wrote: > Hi Sergey, > > From the bug report: >> After discussion, it was decided to accept MACOSX_PORT-424 as not a >> defect > > Are you saying that user code will start receiving hierarchy events > related to the internal hierarchy of our LWAWT peers? Why would anyone > want to process these events and why would we want to post them to > user code? Is there any way to filter them out? Documentation of Toolkit.addAWTEventListener() states: * Adds an AWTEventListener to receive all AWTEvents dispatched * system-wide that conform to the given eventMask. .... * Note: event listener use is not recommended for normal * application use, but are intended solely to support special * purpose facilities including support for accessibility, * event record/playback, and diagnostic tracing. And components intentionally cannot filter them out. All our non trivial compound components posts lots of such events. > While I agree that using reflection is a bad idea, but is there any > other real problem with the original fix for MACOSX_PORT-424? I.e. > does that fix break anything? If not, can we simply replace usages of > reflection with AWTAccessor-like mechanism? The problem not in reflection but in replacing global list of listeners. > > -- > best regards, > Anthony > > On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >> Hello. >> Please review the fix for jdk 9. >> - Initial fix for MACOSX_PORT-424 was reverted back. >> - delegate.addNotify(),because it was called from >> delegateContainer.addNotify(); >> - Testcase was updated to filter out events not from the Frame: >> 84 if (e.getSource() instanceof Frame) { >> 85 counter++; >> 86 notify(); >> 87 } >> >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >> Webrev can be found at: >> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >> -- Best regards, Sergey. From gnu.andrew at redhat.com Tue Feb 4 16:26:00 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Tue, 4 Feb 2014 19:26:00 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <52EFF100.8000004@oracle.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> Message-ID: <246610961.4358603.1391559960875.JavaMail.root@redhat.com> ----- Original Message ----- > > On 2014-02-03 18:43, Omair Majid wrote: > > Hi, > > > > The following webrevs modify the build system to allow building against > > the system-installed copy of libpng as well as using the bundled copy of > > libpng > > > > ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ > > JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ > > > > A new configure option `--with-libpng` is introduced which defaults to > > `bundled` but can be set to `system` to use the system-installed copy of > > libpng. > > Thank you for the patch! > > Looks good to me (but I'm no formal reviewer), apart from this line in > libraries.m4: > with_libpng=${DEFAULT_libpng} > > which should be DEFAULT_LIBPNG, I assume, otherwise the default case > will not work. > > Due to this, I'd like to ask you to please double check that > --with-libpng=system | bundled | invalid-value | , and no flag at > all, all work as expected. > In this respect, why does this not just use AC_ARG_ENABLE as there are only two options here (system libpng or bundled libpng)? Also, this patch hardcodes the libpng cflags and ldflags when these should be obtained from pkg-config. This is how these values are obtained in IcedTea and using this patch would thus be a regression. > /Magnus > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From anthony.petrov at oracle.com Wed Feb 5 04:34:32 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Wed, 05 Feb 2014 16:34:32 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F15AF0.6040509@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> Message-ID: <52F22FD8.7060008@oracle.com> I agree that the listener should receive all the events for compound controls. They make sense because all the parts of compound controls are accessible via our public API, so the app could just assign listeners to specific sub-components if it needed to. However, this isn't true for our internal LWAWT components hierarchy. This hierarchy is hidden from users (they can't access the underlying Swing components via public API, and moreover, they shouldn't be able to do so even if they want to). It is an implementation detail of the LWAWT toolkit. And therefore, I don't see a reason to post events related to this hidden hierarchy to a listener that can be installed using the public API. Can we find another way to filter the events out? -- best regards, Anthony On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: > On 04.02.2014 23:06, Anthony Petrov wrote: >> Hi Sergey, >> >> From the bug report: >>> After discussion, it was decided to accept MACOSX_PORT-424 as not a >>> defect >> >> Are you saying that user code will start receiving hierarchy events >> related to the internal hierarchy of our LWAWT peers? Why would anyone >> want to process these events and why would we want to post them to >> user code? Is there any way to filter them out? > Documentation of Toolkit.addAWTEventListener() states: > * Adds an AWTEventListener to receive all AWTEvents dispatched > * system-wide that conform to the given eventMask. > .... > * Note: event listener use is not recommended for normal > * application use, but are intended solely to support special > * purpose facilities including support for accessibility, > * event record/playback, and diagnostic tracing. > > And components intentionally cannot filter them out. All our non trivial > compound components posts lots of such events. > >> While I agree that using reflection is a bad idea, but is there any >> other real problem with the original fix for MACOSX_PORT-424? I.e. >> does that fix break anything? If not, can we simply replace usages of >> reflection with AWTAccessor-like mechanism? > The problem not in reflection but in replacing global list of listeners. >> >> -- >> best regards, >> Anthony >> >> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>> Hello. >>> Please review the fix for jdk 9. >>> - Initial fix for MACOSX_PORT-424 was reverted back. >>> - delegate.addNotify(),because it was called from >>> delegateContainer.addNotify(); >>> - Testcase was updated to filter out events not from the Frame: >>> 84 if (e.getSource() instanceof Frame) { >>> 85 counter++; >>> 86 notify(); >>> 87 } >>> >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>> Webrev can be found at: >>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>> > > From omajid at redhat.com Wed Feb 5 07:15:19 2014 From: omajid at redhat.com (Omair Majid) Date: Wed, 5 Feb 2014 10:15:19 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <246610961.4358603.1391559960875.JavaMail.root@redhat.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> Message-ID: <20140205151517.GA9621@redhat.com> * Andrew Hughes [2014-02-04 19:26]: > > On 2014-02-03 18:43, Omair Majid wrote: > > > The following webrevs modify the build system to allow building against > > > the system-installed copy of libpng as well as using the bundled copy of > > > libpng > > > > > > ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ > > > JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ > > > > > > A new configure option `--with-libpng` is introduced which defaults to > > > `bundled` but can be set to `system` to use the system-installed copy of > > > libpng. > > In this respect, why does this not just use AC_ARG_ENABLE as there are only > two options here (system libpng or bundled libpng)? > > Also, this patch hardcodes the libpng cflags and ldflags when these should > be obtained from pkg-config. This is how these values are obtained in IcedTea > and using this patch would thus be a regression. The answer to both of these is the same: I followed how the existing code handles zlib. If this needs fixing, then it needs to be fixed in the other cases (zlib and giflib) too. Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From anton.tarasov at oracle.com Wed Feb 5 08:07:55 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Wed, 05 Feb 2014 20:07:55 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52F1379B.7000004@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F1379B.7000004@oracle.com> Message-ID: <52F261DB.3000806@oracle.com> Thanks for the review, Anthony! Regards, Anton. On 04.02.2014 22:55, Anthony Petrov wrote: > Hi Anton, > > I skimmed through the code that I'm familiar with, and the changes look good to me. Someone from > Swing and 2D should review their parts, too. > > -- > best regards, > Anthony > > On 2/3/2014 6:36 PM, Anton V. Tarasov wrote: >> Hi Jim, >> >> Please look at the updated version: >> >> http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.4 >> >> On 01.02.2014 5:35, Jim Graham wrote: >>> Hi Anton, >>> >>> On 1/31/14 6:37 AM, Anton V. Tarasov wrote: >>>> My understanding is that, unless the fix is absolutely irrelevant (whic >>>> I hope it isn't), we should integrate it into 9/8u20 to support >>>> SwingNode in its current implementation on Retina displays. >>>> >>>> What do you think? >>> >>> I agree with this sentiment. My suggestion for reducing its footprint >>> aside (which it looks like you are investigating), the main thing I >>> will be looking for is whether or not we return an object to a >>> developer (i.e. it isn't just managed internally to our own code) >>> where they can do "instanceof BufferedImage" and then see something >>> odd coming from its width/height. >>> >>> It looks like if we simply use getLayoutWH() internally then they >>> would never ever see anything odd from getWidthHeight() anyway. The >>> only additional "gotcha" would be if they grab the image and render it >>> directly and it comes out an unexpected size to them (because, for >>> instance, they didn't check the layout dims like we do internally). >>> That's a pretty minor issue, though, and I think we could live with it. >> >> I've refactored the fix with this concern in mind. Here is what I've done: >> >> - eliminated the new OffscreenHiDPIImage class (as you suggested) and >> put all of its "scale" logic into the OffscreenImage. >> - made the scaled OffscreenImage return the physical size (like an >> ordinary BufferredImage does) by default . >> - renamed the "set/isHiDPIEnabled" method to "set/isReturnLayoutSize". >> - made the setReturnLayoutSize(true) be called internally (where we >> don't leak the OffscreenImage). >> >> In SG2D, the drawHiDPIImage, for instance, makes a call to >> op.filter(img, null); where the img is expected to return its layout >> size. That's why I still prefer to use the setReturnLayoutSize >> "switcher", in order not to go deep into the 2D rendering code, casting >> here and there to OffscreenImage and calling getLayoutWidth/Height. >> >>> >>> For 9.0 perhaps we could add the LayoutWH() as new API on >>> BufferedImage and then most of this would be public? I'd have to mull >>> over if that makes sense and I'm not entirely sure of the naming yet... >> >> That's a good idea, however we need a 8u working solution as well... As >> to the naming, I'm ready for any suggestions. >> >> Thanks, >> Anton. >> >>> >>> ...jim >> From sergey.bylokhov at oracle.com Wed Feb 5 08:37:26 2014 From: sergey.bylokhov at oracle.com (sergey.bylokhov at oracle.com) Date: Wed, 05 Feb 2014 16:37:26 +0000 Subject: hg: jdk8/awt/jdk: 7155984: Security problems in regression test java/awt/PrintJob/Security/SecurityDialogTest.java Message-ID: <20140205163843.86A4362A19@hg.openjdk.java.net> Changeset: ab6e7bb8ff9f Author: pchelko Date: 2014-01-22 16:15 +0400 URL: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/ab6e7bb8ff9f 7155984: Security problems in regression test java/awt/PrintJob/Security/SecurityDialogTest.java Reviewed-by: anthony, serb ! src/macosx/classes/apple/laf/JRSUIUtils.java From joe.darcy at oracle.com Wed Feb 5 11:04:35 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 05 Feb 2014 11:04:35 -0800 Subject: JDK 9 RFR of JDK-8033712: Fix more serial lint warnings in sun.awt Message-ID: <52F28B43.4070005@oracle.com> Hello, Please review my patch to fix the serial warnings in platform-specific code in the sun.awt package: JDK-8033712: Fix more serial lint warnings in sun.awt http://cr.openjdk.java.net/~darcy/8033712.0/ Thanks, -Joe From anthony.petrov at oracle.com Wed Feb 5 13:26:44 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Thu, 06 Feb 2014 01:26:44 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F2427B.7090201@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> Message-ID: <52F2AC94.9050001@oracle.com> [ adding back the awt-dev@ mailing list ] Hi Sergey, This all boils down to whether we want to deliver events related to our internal components to the user code or not. The fact that the MACOSX_PORT-424 was filed by an external developer suggests that this behavior may be unwanted. Also, common sense suggests that such events are useless for external consumers, and hence sending them just doesn't make any sense. Could you please clarify again exactly what the problem is with the original fix for this issue? I do not quite like it myself (e.g. when I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the setting/unsetting the listener looks like a hack, I agree), but I don't see any serious consequences that that fix could cause. Could you please elaborate on that? If we see that there's some serious flows with the original solution, let's get rid of it. However, we'll need to file a new bug to deal with all the unwanted events, and implement it some other way then. -- best regards, Anthony On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: > On 05.02.2014 16:34, Anthony Petrov wrote: >> I agree that the listener should receive all the events for compound >> controls. They make sense because all the parts of compound controls >> are accessible via our public API, so the app could just assign >> listeners to specific sub-components if it needed to. > Not necessary, for example for our text component in xawt. The user > should filter out unnecessary events anyway, because they can belongs to > a different application or some internal components(like SharedOwnerFrame). >> >> However, this isn't true for our internal LWAWT components hierarchy. >> This hierarchy is hidden from users (they can't access the underlying >> Swing components via public API, and moreover, they shouldn't be able >> to do so even if they want to). It is an implementation detail of the >> LWAWT toolkit. And therefore, I don't see a reason to post events >> related to this hidden hierarchy to a listener that can be installed >> using the public API. >> >> Can we find another way to filter the events out? > Only if we will add additional checks to the places, where > Toolkit.enabledOnToolkit is used. >> >> -- >> best regards, >> Anthony >> >> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>> Hi Sergey, >>>> >>>> From the bug report: >>>>> After discussion, it was decided to accept MACOSX_PORT-424 as not a >>>>> defect >>>> >>>> Are you saying that user code will start receiving hierarchy events >>>> related to the internal hierarchy of our LWAWT peers? Why would anyone >>>> want to process these events and why would we want to post them to >>>> user code? Is there any way to filter them out? >>> Documentation of Toolkit.addAWTEventListener() states: >>> * Adds an AWTEventListener to receive all AWTEvents dispatched >>> * system-wide that conform to the given eventMask. >>> .... >>> * Note: event listener use is not recommended for normal >>> * application use, but are intended solely to support special >>> * purpose facilities including support for accessibility, >>> * event record/playback, and diagnostic tracing. >>> >>> And components intentionally cannot filter them out. All our non trivial >>> compound components posts lots of such events. >>> >>>> While I agree that using reflection is a bad idea, but is there any >>>> other real problem with the original fix for MACOSX_PORT-424? I.e. >>>> does that fix break anything? If not, can we simply replace usages of >>>> reflection with AWTAccessor-like mechanism? >>> The problem not in reflection but in replacing global list of listeners. >>>> >>>> -- >>>> best regards, >>>> Anthony >>>> >>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>> Hello. >>>>> Please review the fix for jdk 9. >>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>> - delegate.addNotify(),because it was called from >>>>> delegateContainer.addNotify(); >>>>> - Testcase was updated to filter out events not from the Frame: >>>>> 84 if (e.getSource() instanceof Frame) { >>>>> 85 counter++; >>>>> 86 notify(); >>>>> 87 } >>>>> >>>>> >>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>> Webrev can be found at: >>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>> >>> >>> > > From Sergey.Bylokhov at oracle.com Wed Feb 5 14:45:26 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 06 Feb 2014 02:45:26 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F2AC94.9050001@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> <52F2AC94.9050001@oracle.com> Message-ID: <52F2BF06.20107@oracle.com> On 06.02.2014 1:26, Anthony Petrov wrote: > [ adding back the awt-dev@ mailing list ] > > Hi Sergey, > > This all boils down to whether we want to deliver events related to > our internal components to the user code or not. The fact that the > MACOSX_PORT-424 was filed by an external developer suggests that this > behavior may be unwanted. Also, common sense suggests that such events > are useless for external consumers, and hence sending them just > doesn't make any sense. No, it is not an external developer. It was filed because some test, which was provided by Apple, failed. > > Could you please clarify again exactly what the problem is with the > original fix for this issue? I do not quite like it myself (e.g. when > I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the > setting/unsetting the listener looks like a hack, I agree), but I > don't see any serious consequences that that fix could cause. Could > you please elaborate on that? That's because this fix try to eliminate events during peers creation only. This was a hack and the goal was to fix one particular test. > > If we see that there's some serious flows with the original solution, > let's get rid of it. However, we'll need to file a new bug to deal > with all the unwanted events, and implement it some other way then. Why they are unwanted? AWT fires AWTEvents, and toolkit have an ability to catch all events, which are dispatched system-wide without any exceptions. As far as I understand toolkit listeners is kind of debug mechanism which can help to track all events. > > -- > best regards, > Anthony > > On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: >> On 05.02.2014 16:34, Anthony Petrov wrote: >>> I agree that the listener should receive all the events for compound >>> controls. They make sense because all the parts of compound controls >>> are accessible via our public API, so the app could just assign >>> listeners to specific sub-components if it needed to. >> Not necessary, for example for our text component in xawt. The user >> should filter out unnecessary events anyway, because they can belongs to >> a different application or some internal components(like >> SharedOwnerFrame). >>> >>> However, this isn't true for our internal LWAWT components hierarchy. >>> This hierarchy is hidden from users (they can't access the underlying >>> Swing components via public API, and moreover, they shouldn't be able >>> to do so even if they want to). It is an implementation detail of the >>> LWAWT toolkit. And therefore, I don't see a reason to post events >>> related to this hidden hierarchy to a listener that can be installed >>> using the public API. >>> >>> Can we find another way to filter the events out? >> Only if we will add additional checks to the places, where >> Toolkit.enabledOnToolkit is used. >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>>> Hi Sergey, >>>>> >>>>> From the bug report: >>>>>> After discussion, it was decided to accept MACOSX_PORT-424 as not a >>>>>> defect >>>>> >>>>> Are you saying that user code will start receiving hierarchy events >>>>> related to the internal hierarchy of our LWAWT peers? Why would >>>>> anyone >>>>> want to process these events and why would we want to post them to >>>>> user code? Is there any way to filter them out? >>>> Documentation of Toolkit.addAWTEventListener() states: >>>> * Adds an AWTEventListener to receive all AWTEvents dispatched >>>> * system-wide that conform to the given eventMask. >>>> .... >>>> * Note: event listener use is not recommended for normal >>>> * application use, but are intended solely to support special >>>> * purpose facilities including support for accessibility, >>>> * event record/playback, and diagnostic tracing. >>>> >>>> And components intentionally cannot filter them out. All our non >>>> trivial >>>> compound components posts lots of such events. >>>> >>>>> While I agree that using reflection is a bad idea, but is there any >>>>> other real problem with the original fix for MACOSX_PORT-424? I.e. >>>>> does that fix break anything? If not, can we simply replace usages of >>>>> reflection with AWTAccessor-like mechanism? >>>> The problem not in reflection but in replacing global list of >>>> listeners. >>>>> >>>>> -- >>>>> best regards, >>>>> Anthony >>>>> >>>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>>> Hello. >>>>>> Please review the fix for jdk 9. >>>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>>> - delegate.addNotify(),because it was called from >>>>>> delegateContainer.addNotify(); >>>>>> - Testcase was updated to filter out events not from the Frame: >>>>>> 84 if (e.getSource() instanceof Frame) { >>>>>> 85 counter++; >>>>>> 86 notify(); >>>>>> 87 } >>>>>> >>>>>> >>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>>> Webrev can be found at: >>>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>>> >>>> >>>> >> >> -- Best regards, Sergey. From oleg.pekhovskiy at oracle.com Wed Feb 5 22:21:49 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Thu, 06 Feb 2014 10:21:49 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F10C3F.3080202@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> <52F0CEF8.7030805@oracle.com> <52F0E47F.3070309@oracle.com> <52F10C3F.3080202@oracle.com> Message-ID: <52F329FD.4030804@oracle.com> Hi Alexander, thanks for the comments, please see the next version of fix: http://cr.openjdk.java.net/~bagiras/8020443.3/ Updates: 1. Left usage of root window coordinates because they passed to XToolkit.getScreenInsetsManually() in Rectangle, not just Dimension. Added comment for struts check. 2. Rewrote the test to make it accurate. Tested on Ubuntu 12.04, Solaris 11 and Oracle Linux 6.4. Thanks, Oleg On 02/04/2014 07:50 PM, Alexander Zvegintsev wrote: > Oleg, > > please see inline > > On 02/04/2014 05:00 PM, Oleg Pekhovskiy wrote: >> Hi Alexander, >> >> thank you for the review! >> >> 1. The problem is that I didn't find that root window ALWAYS starts >> with 0, 0 in X11 docs. >> Could you please point such statement out to avoid uncertainty? > Unfortunately, I cannot find any document which clearly specifies > this. is the root of this hierarchy. > On my understanding root window is the root of windows treehierarchy > and all other windows are children or descendants of it. > So root window is the origin for all other windows and and I assume > that it has (0,0) coordinates always and I would > be surprised if it not. > >> 2. Checking insets against screen width and height can fail too. >> Example: >> 1st screen (0, 0, 1024, 768) - x, y, width, height >> 2nd screen (1024, 0, 1920, 1080) >> Struts for the 2nd screen could be (1074, 0, 20, 0) - left, right, >> top, bottom. >> So left strut 1075 fits in 1920 but should be 50 as inset. > Yes, my check will fail on this case. >> PS: Just curious: you said that screen (1000, 50, 1000, 1000) is a >> valid case. >> Is it valid for testing environment? As I see screens are left-top >> aligned. >> It means that if two screens are located from left to right, they >> both have y == 0 regardless of their height. > It is a valid case, screens can be arranged in any order, screens even > can be overlapped, may have empty spaces between. > (and we definitely will not support last 2 cases). > > My previous example was a little abstract, here is the real one with > screens aligned on bottom edge: > Screen #1 (0,0, 1920, 1080) > Screen #2 (1920, 30, 1680, 1050) with top inset 35 > > It is unlikely that we will meet such configuration, but who knows. > > Since this test will run on machines with environment close to default > I propose to made an assumption > that insets are not greater that a quarter (or 1/3?) of width and > height (and add a comment why we do that > and why test may fail): > > if (insets.left >= bounds.width / 4 > || insets.right >= bounds.width / 4 > || insets.top >= bounds.height / 4 > || insets.bottom >= bounds.height / 4) { > > > Thanks, > > Alexander. > > >> Usually insets are much less than dimensions of a screen and so strut >> minus screen edge should be less >> than summary dimension of neighbor screens. >> Please, correct me if I'm wrong. >> >> Thanks, >> Oleg >> >> 04.02.2014 15:28, Alexander Zvegintsev wrote: >>> Hi Oleg, >>> >>> I am just curious about adding rootBounds.x and rootBounds.y, it >>> looks redundant to me. >>> Is there a case when a root window have coordinates with non-zero >>> values? >>> >>> MultiScreenInsetsTest.java: >>>> 62 if ((bounds.x != 0 && insets.left >= bounds.x) >>>> 63 || (bounds.y != 0 && insets.top >= bounds.y)) { >>> This check will fail for screen with >>> [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, >>> but it is a valid case. >>> >>> I think we should check insets against screen width and height: >>> if (insets.left >= bounds.width >>> || insets.right >= bounds.width >>> || insets.top >= bounds.height >>> || insets.bottom >= bounds.height) { >>> >>> >>> Otherwise fix looks good to me. >>> >>> Thanks, >>> >>> Alexander. >>> On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: >>>> Hi All, >>>> >>>> please review the second version of fix: >>>> http://cr.openjdk.java.net/~bagiras/8020443.2/ >>>> >>>> It turned out that struts must be checked and corrected from all sides >>>> to become the proper screen insets. >>>> >>>> Thanks, >>>> Oleg >>>> >>>> On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >>>>> Hi all, >>>>> >>>>> please review the fix >>>>> http://cr.openjdk.java.net/~bagiras/8020443.1/ >>>>> for >>>>> https://bugs.openjdk.java.net/browse/JDK-8020443 >>>>> >>>>> Referring to the standards, we must calculate insets the special >>>>> way for Xinerama: >>>>> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >>>>> >>>>> _NET_WM_STRUT_PARTIAL >>>>> "The start and end values associated with each strut allow areas >>>>> to be reserved which do not span the entire width or height of the >>>>> screen. Struts MUST be specified in root window coordinates, that >>>>> is, they are /not/ relative to the edges of any view port or >>>>> Xinerama monitor." >>>>> >>>>> So the fix checks if the insets have absolute values and if so >>>>> makes them relative to each screen. >>>>> The issue occurred when the Frame was created with the location by >>>>> default. >>>>> >>>>> Thanks, >>>>> Oleg >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140206/96ba28bf/attachment-0001.html From Alan.Bateman at oracle.com Thu Feb 6 00:54:30 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Feb 2014 08:54:30 +0000 Subject: JDK 9 RFR of JDK-8033712: Fix more serial lint warnings in sun.awt In-Reply-To: <52F28B43.4070005@oracle.com> References: <52F28B43.4070005@oracle.com> Message-ID: <52F34DC6.3090404@oracle.com> On 05/02/2014 19:04, Joe Darcy wrote: > Hello, > > Please review my patch to fix the serial warnings in platform-specific > code in the sun.awt package: > > JDK-8033712: Fix more serial lint warnings in sun.awt > http://cr.openjdk.java.net/~darcy/8033712.0/ This looks good to me. -Alan From alexander.zvegintsev at oracle.com Thu Feb 6 02:34:22 2014 From: alexander.zvegintsev at oracle.com (Alexander Zvegintsev) Date: Thu, 06 Feb 2014 14:34:22 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F329FD.4030804@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> <52F0CEF8.7030805@oracle.com> <52F0E47F.3070309@oracle.com> <52F10C3F.3080202@oracle.com> <52F329FD.4030804@oracle.com> Message-ID: <52F3652E.6080205@oracle.com> Hi Oleg, I am a little concerned about this comment: > * struts*could be*relative to root window bounds, so but specification[1] clearly says: > All coordinates are root window coordinates. so I think "could be" should be replaced by "are" (there is no need for a new webrev) Otherwise, the fix looks good to me. BTW, I like your idea with frame maximization to check insets. [1] http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idp6337880 Thanks, Alexander. On 02/06/2014 10:21 AM, Oleg Pekhovskiy wrote: > Hi Alexander, > > thanks for the comments, > please see the next version of fix: > http://cr.openjdk.java.net/~bagiras/8020443.3/ > > Updates: > 1. Left usage of root window coordinates because they passed to > XToolkit.getScreenInsetsManually() in Rectangle, not just Dimension. > Added comment for struts check. > > 2. Rewrote the test to make it accurate. > Tested on Ubuntu 12.04, Solaris 11 and Oracle Linux 6.4. > > Thanks, > Oleg > > On 02/04/2014 07:50 PM, Alexander Zvegintsev wrote: >> Oleg, >> >> please see inline >> >> On 02/04/2014 05:00 PM, Oleg Pekhovskiy wrote: >>> Hi Alexander, >>> >>> thank you for the review! >>> >>> 1. The problem is that I didn't find that root window ALWAYS starts >>> with 0, 0 in X11 docs. >>> Could you please point such statement out to avoid uncertainty? >> Unfortunately, I cannot find any document which clearly specifies >> this. is the root of this hierarchy. >> On my understanding root window is the root of windows treehierarchy >> and all other windows are children or descendants of it. >> So root window is the origin for all other windows and and I assume >> that it has (0,0) coordinates always and I would >> be surprised if it not. >> >>> 2. Checking insets against screen width and height can fail too. >>> Example: >>> 1st screen (0, 0, 1024, 768) - x, y, width, height >>> 2nd screen (1024, 0, 1920, 1080) >>> Struts for the 2nd screen could be (1074, 0, 20, 0) - left, right, >>> top, bottom. >>> So left strut 1075 fits in 1920 but should be 50 as inset. >> Yes, my check will fail on this case. >>> PS: Just curious: you said that screen (1000, 50, 1000, 1000) is a >>> valid case. >>> Is it valid for testing environment? As I see screens are left-top >>> aligned. >>> It means that if two screens are located from left to right, they >>> both have y == 0 regardless of their height. >> It is a valid case, screens can be arranged in any order, screens >> even can be overlapped, may have empty spaces between. >> (and we definitely will not support last 2 cases). >> >> My previous example was a little abstract, here is the real one with >> screens aligned on bottom edge: >> Screen #1 (0,0, 1920, 1080) >> Screen #2 (1920, 30, 1680, 1050) with top inset 35 >> >> It is unlikely that we will meet such configuration, but who knows. >> >> Since this test will run on machines with environment close to >> default I propose to made an assumption >> that insets are not greater that a quarter (or 1/3?) of width and >> height (and add a comment why we do that >> and why test may fail): >> >> if (insets.left >= bounds.width / 4 >> || insets.right >= bounds.width / 4 >> || insets.top >= bounds.height / 4 >> || insets.bottom >= bounds.height / 4) { >> >> >> Thanks, >> >> Alexander. >> >> >>> Usually insets are much less than dimensions of a screen and so >>> strut minus screen edge should be less >>> than summary dimension of neighbor screens. >>> Please, correct me if I'm wrong. >>> >>> Thanks, >>> Oleg >>> >>> 04.02.2014 15:28, Alexander Zvegintsev wrote: >>>> Hi Oleg, >>>> >>>> I am just curious about adding rootBounds.x and rootBounds.y, it >>>> looks redundant to me. >>>> Is there a case when a root window have coordinates with non-zero >>>> values? >>>> >>>> MultiScreenInsetsTest.java: >>>>> 62 if ((bounds.x != 0 && insets.left >= bounds.x) >>>>> 63 || (bounds.y != 0 && insets.top >= bounds.y)) { >>>> This check will fail for screen with >>>> [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, >>>> but it is a valid case. >>>> >>>> I think we should check insets against screen width and height: >>>> if (insets.left >= bounds.width >>>> || insets.right >= bounds.width >>>> || insets.top >= bounds.height >>>> || insets.bottom >= bounds.height) { >>>> >>>> >>>> Otherwise fix looks good to me. >>>> >>>> Thanks, >>>> >>>> Alexander. >>>> On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: >>>>> Hi All, >>>>> >>>>> please review the second version of fix: >>>>> http://cr.openjdk.java.net/~bagiras/8020443.2/ >>>>> >>>>> It turned out that struts must be checked and corrected from all >>>>> sides >>>>> to become the proper screen insets. >>>>> >>>>> Thanks, >>>>> Oleg >>>>> >>>>> On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >>>>>> Hi all, >>>>>> >>>>>> please review the fix >>>>>> http://cr.openjdk.java.net/~bagiras/8020443.1/ >>>>>> for >>>>>> https://bugs.openjdk.java.net/browse/JDK-8020443 >>>>>> >>>>>> Referring to the standards, we must calculate insets the special >>>>>> way for Xinerama: >>>>>> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >>>>>> >>>>>> _NET_WM_STRUT_PARTIAL >>>>>> "The start and end values associated with each strut allow areas >>>>>> to be reserved which do not span the entire width or height of >>>>>> the screen. Struts MUST be specified in root window coordinates, >>>>>> that is, they are /not/ relative to the edges of any view port or >>>>>> Xinerama monitor." >>>>>> >>>>>> So the fix checks if the insets have absolute values and if so >>>>>> makes them relative to each screen. >>>>>> The issue occurred when the Frame was created with the location >>>>>> by default. >>>>>> >>>>>> Thanks, >>>>>> Oleg >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140206/a2f99f2d/attachment.html From anthony.petrov at oracle.com Thu Feb 6 03:41:34 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Thu, 06 Feb 2014 15:41:34 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F2BF06.20107@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> <52F2AC94.9050001@oracle.com> <52F2BF06.20107@oracle.com> Message-ID: <52F374EE.8050600@oracle.com> Indeed, it wasn't an external developer who filed the original bug. Thanks for the clarification. Still, I don't see any reason to post events for components that belong to our peers' implementations and shouldn't be accessible via public API. I'd like to ask you again: does the original fix really break anyone? Or is the only reason to back it out is the fact that we don't like the implementation of the filtering mechanism (and I admit, I don't like it too)? If it's the latter, I'd suggest you to actually _rework_ that fix as the synopsis of 8032187 suggests, rather than simply remove it. Or leave it as is and keep the 8032187 bug open for now. -- best regards, Anthony On 2/6/2014 2:45 AM, Sergey Bylokhov wrote: > On 06.02.2014 1:26, Anthony Petrov wrote: >> [ adding back the awt-dev@ mailing list ] >> >> Hi Sergey, >> >> This all boils down to whether we want to deliver events related to >> our internal components to the user code or not. The fact that the >> MACOSX_PORT-424 was filed by an external developer suggests that this >> behavior may be unwanted. Also, common sense suggests that such events >> are useless for external consumers, and hence sending them just >> doesn't make any sense. > No, it is not an external developer. It was filed because some test, > which was provided by Apple, failed. >> >> Could you please clarify again exactly what the problem is with the >> original fix for this issue? I do not quite like it myself (e.g. when >> I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the >> setting/unsetting the listener looks like a hack, I agree), but I >> don't see any serious consequences that that fix could cause. Could >> you please elaborate on that? > That's because this fix try to eliminate events during peers creation > only. This was a hack and the goal was to fix one particular test. >> >> If we see that there's some serious flows with the original solution, >> let's get rid of it. However, we'll need to file a new bug to deal >> with all the unwanted events, and implement it some other way then. > Why they are unwanted? AWT fires AWTEvents, and toolkit have an ability > to catch all events, which are dispatched system-wide without any > exceptions. As far as I understand toolkit listeners is kind of debug > mechanism which can help to track all events. >> >> -- >> best regards, >> Anthony >> >> On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: >>> On 05.02.2014 16:34, Anthony Petrov wrote: >>>> I agree that the listener should receive all the events for compound >>>> controls. They make sense because all the parts of compound controls >>>> are accessible via our public API, so the app could just assign >>>> listeners to specific sub-components if it needed to. >>> Not necessary, for example for our text component in xawt. The user >>> should filter out unnecessary events anyway, because they can belongs to >>> a different application or some internal components(like >>> SharedOwnerFrame). >>>> >>>> However, this isn't true for our internal LWAWT components hierarchy. >>>> This hierarchy is hidden from users (they can't access the underlying >>>> Swing components via public API, and moreover, they shouldn't be able >>>> to do so even if they want to). It is an implementation detail of the >>>> LWAWT toolkit. And therefore, I don't see a reason to post events >>>> related to this hidden hierarchy to a listener that can be installed >>>> using the public API. >>>> >>>> Can we find another way to filter the events out? >>> Only if we will add additional checks to the places, where >>> Toolkit.enabledOnToolkit is used. >>>> >>>> -- >>>> best regards, >>>> Anthony >>>> >>>> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>>>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>>>> Hi Sergey, >>>>>> >>>>>> From the bug report: >>>>>>> After discussion, it was decided to accept MACOSX_PORT-424 as not a >>>>>>> defect >>>>>> >>>>>> Are you saying that user code will start receiving hierarchy events >>>>>> related to the internal hierarchy of our LWAWT peers? Why would >>>>>> anyone >>>>>> want to process these events and why would we want to post them to >>>>>> user code? Is there any way to filter them out? >>>>> Documentation of Toolkit.addAWTEventListener() states: >>>>> * Adds an AWTEventListener to receive all AWTEvents dispatched >>>>> * system-wide that conform to the given eventMask. >>>>> .... >>>>> * Note: event listener use is not recommended for normal >>>>> * application use, but are intended solely to support special >>>>> * purpose facilities including support for accessibility, >>>>> * event record/playback, and diagnostic tracing. >>>>> >>>>> And components intentionally cannot filter them out. All our non >>>>> trivial >>>>> compound components posts lots of such events. >>>>> >>>>>> While I agree that using reflection is a bad idea, but is there any >>>>>> other real problem with the original fix for MACOSX_PORT-424? I.e. >>>>>> does that fix break anything? If not, can we simply replace usages of >>>>>> reflection with AWTAccessor-like mechanism? >>>>> The problem not in reflection but in replacing global list of >>>>> listeners. >>>>>> >>>>>> -- >>>>>> best regards, >>>>>> Anthony >>>>>> >>>>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>>>> Hello. >>>>>>> Please review the fix for jdk 9. >>>>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>>>> - delegate.addNotify(),because it was called from >>>>>>> delegateContainer.addNotify(); >>>>>>> - Testcase was updated to filter out events not from the Frame: >>>>>>> 84 if (e.getSource() instanceof Frame) { >>>>>>> 85 counter++; >>>>>>> 86 notify(); >>>>>>> 87 } >>>>>>> >>>>>>> >>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>>>> Webrev can be found at: >>>>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>>>> >>>>> >>>>> >>> >>> > > From Sergey.Bylokhov at oracle.com Thu Feb 6 03:57:42 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 06 Feb 2014 15:57:42 +0400 Subject: JDK 9 RFR of JDK-8033712: Fix more serial lint warnings in sun.awt In-Reply-To: <52F28B43.4070005@oracle.com> References: <52F28B43.4070005@oracle.com> Message-ID: <52F378B6.4030100@oracle.com> Hi, Joe. In WScrollPanePeer.java @SuppressWarnings("serial") should be applied to ScrollEvent. In WPrinterJob.java it should be applied to PrintToFileErrorDialog. On 05.02.2014 23:04, Joe Darcy wrote: > Hello, > > Please review my patch to fix the serial warnings in platform-specific > code in the sun.awt package: > > JDK-8033712: Fix more serial lint warnings in sun.awt > http://cr.openjdk.java.net/~darcy/8033712.0/ > > Thanks, > > -Joe -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Thu Feb 6 04:24:16 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 06 Feb 2014 16:24:16 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F374EE.8050600@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> <52F2AC94.9050001@oracle.com> <52F2BF06.20107@oracle.com> <52F374EE.8050600@oracle.com> Message-ID: <52F37EF0.7080503@oracle.com> On 06.02.2014 15:41, Anthony Petrov wrote: > Indeed, it wasn't an external developer who filed the original bug. > Thanks for the clarification. > > Still, I don't see any reason to post events for components that > belong to our peers' implementations and shouldn't be accessible via > public API. The reason is that we easily can check if someone flood the system. And it is not contradict the specification. > > I'd like to ask you again: does the original fix really break anyone? > Or is the only reason to back it out is the fact that we don't like > the implementation of the filtering mechanism (and I admit, I don't > like it too)? If it's the latter, I'd suggest you to actually _rework_ > that fix as the synopsis of 8032187 suggests, rather than simply > remove it. Or leave it as is and keep the 8032187 bug open for now. My point is that the previous fix is incorrect, because there was no bug in jdk and the test should be updated instead. > > -- > best regards, > Anthony > > On 2/6/2014 2:45 AM, Sergey Bylokhov wrote: >> On 06.02.2014 1:26, Anthony Petrov wrote: >>> [ adding back the awt-dev@ mailing list ] >>> >>> Hi Sergey, >>> >>> This all boils down to whether we want to deliver events related to >>> our internal components to the user code or not. The fact that the >>> MACOSX_PORT-424 was filed by an external developer suggests that this >>> behavior may be unwanted. Also, common sense suggests that such events >>> are useless for external consumers, and hence sending them just >>> doesn't make any sense. >> No, it is not an external developer. It was filed because some test, >> which was provided by Apple, failed. >>> >>> Could you please clarify again exactly what the problem is with the >>> original fix for this issue? I do not quite like it myself (e.g. when >>> I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the >>> setting/unsetting the listener looks like a hack, I agree), but I >>> don't see any serious consequences that that fix could cause. Could >>> you please elaborate on that? >> That's because this fix try to eliminate events during peers creation >> only. This was a hack and the goal was to fix one particular test. >>> >>> If we see that there's some serious flows with the original solution, >>> let's get rid of it. However, we'll need to file a new bug to deal >>> with all the unwanted events, and implement it some other way then. >> Why they are unwanted? AWT fires AWTEvents, and toolkit have an ability >> to catch all events, which are dispatched system-wide without any >> exceptions. As far as I understand toolkit listeners is kind of debug >> mechanism which can help to track all events. >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: >>>> On 05.02.2014 16:34, Anthony Petrov wrote: >>>>> I agree that the listener should receive all the events for compound >>>>> controls. They make sense because all the parts of compound controls >>>>> are accessible via our public API, so the app could just assign >>>>> listeners to specific sub-components if it needed to. >>>> Not necessary, for example for our text component in xawt. The user >>>> should filter out unnecessary events anyway, because they can >>>> belongs to >>>> a different application or some internal components(like >>>> SharedOwnerFrame). >>>>> >>>>> However, this isn't true for our internal LWAWT components hierarchy. >>>>> This hierarchy is hidden from users (they can't access the underlying >>>>> Swing components via public API, and moreover, they shouldn't be able >>>>> to do so even if they want to). It is an implementation detail of the >>>>> LWAWT toolkit. And therefore, I don't see a reason to post events >>>>> related to this hidden hierarchy to a listener that can be installed >>>>> using the public API. >>>>> >>>>> Can we find another way to filter the events out? >>>> Only if we will add additional checks to the places, where >>>> Toolkit.enabledOnToolkit is used. >>>>> >>>>> -- >>>>> best regards, >>>>> Anthony >>>>> >>>>> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>>>>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>>>>> Hi Sergey, >>>>>>> >>>>>>> From the bug report: >>>>>>>> After discussion, it was decided to accept MACOSX_PORT-424 as >>>>>>>> not a >>>>>>>> defect >>>>>>> >>>>>>> Are you saying that user code will start receiving hierarchy events >>>>>>> related to the internal hierarchy of our LWAWT peers? Why would >>>>>>> anyone >>>>>>> want to process these events and why would we want to post them to >>>>>>> user code? Is there any way to filter them out? >>>>>> Documentation of Toolkit.addAWTEventListener() states: >>>>>> * Adds an AWTEventListener to receive all AWTEvents dispatched >>>>>> * system-wide that conform to the given >>>>>> eventMask. >>>>>> .... >>>>>> * Note: event listener use is not recommended for normal >>>>>> * application use, but are intended solely to support special >>>>>> * purpose facilities including support for accessibility, >>>>>> * event record/playback, and diagnostic tracing. >>>>>> >>>>>> And components intentionally cannot filter them out. All our non >>>>>> trivial >>>>>> compound components posts lots of such events. >>>>>> >>>>>>> While I agree that using reflection is a bad idea, but is there any >>>>>>> other real problem with the original fix for MACOSX_PORT-424? I.e. >>>>>>> does that fix break anything? If not, can we simply replace >>>>>>> usages of >>>>>>> reflection with AWTAccessor-like mechanism? >>>>>> The problem not in reflection but in replacing global list of >>>>>> listeners. >>>>>>> >>>>>>> -- >>>>>>> best regards, >>>>>>> Anthony >>>>>>> >>>>>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>>>>> Hello. >>>>>>>> Please review the fix for jdk 9. >>>>>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>>>>> - delegate.addNotify(),because it was called from >>>>>>>> delegateContainer.addNotify(); >>>>>>>> - Testcase was updated to filter out events not from the Frame: >>>>>>>> 84 if (e.getSource() instanceof Frame) { >>>>>>>> 85 counter++; >>>>>>>> 86 notify(); >>>>>>>> 87 } >>>>>>>> >>>>>>>> >>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>>>>> Webrev can be found at: >>>>>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>>>>> >>>>>> >>>>>> >>>> >>>> >> >> -- Best regards, Sergey. From oleg.pekhovskiy at oracle.com Thu Feb 6 04:49:38 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Thu, 06 Feb 2014 16:49:38 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F3652E.6080205@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> <52F0CEF8.7030805@oracle.com> <52F0E47F.3070309@oracle.com> <52F10C3F.3080202@oracle.com> <52F329FD.4030804@oracle.com> <52F3652E.6080205@oracle.com> Message-ID: <52F384E2.30003@oracle.com> Hi Alexander, thank you for your comments, and let me pay attention to the wording: I wrote "struts" but not "coordinates of the struts". I did it intentionally: here is the dump of XToolkit.getScreenInsetsManually() method on the second screen: Root bounds: java.awt.Rectangle[x=0,y=0,width=2048,height=768] Screen bounds: java.awt.Rectangle[x=1024,y=0,width=1024,height=768] Window #33554540 bounds[x=1024, y=24, width=1024, height=744] struts[left=1089, right=0, top=0, bottom=0] Window #31457297 bounds[x=1024, y=0, width=1024, height=24] struts[left=0, right=0, top=24, bottom=0] As we see struts could be 0, even if their edge is not the same as the root window edge. So if we are talking about: left_start_y, left_end_y, right_start_y, right_end_y, top_start_x, top_end_x, bottom_start_x of _NET_WM_STRUT_PARTIAL I agree with you, but if we are talking about: left, right, top, bottom which is the case, I don't, and treat my comments as correct. Thanks, Oleg On 02/06/2014 02:34 PM, Alexander Zvegintsev wrote: > Hi Oleg, > > I am a little concerned about this comment: >> * struts*could be*relative to root window bounds, so > > but specification[1] clearly says: >> All coordinates are root window coordinates. > so I think "could be" should be replaced by "are" (there is no need > for a new webrev) > > Otherwise, the fix looks good to me. > BTW, I like your idea with frame maximization to check insets. > > [1] > http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idp6337880 > Thanks, > > Alexander. > On 02/06/2014 10:21 AM, Oleg Pekhovskiy wrote: >> Hi Alexander, >> >> thanks for the comments, >> please see the next version of fix: >> http://cr.openjdk.java.net/~bagiras/8020443.3/ >> >> Updates: >> 1. Left usage of root window coordinates because they passed to >> XToolkit.getScreenInsetsManually() in Rectangle, not just Dimension. >> Added comment for struts check. >> >> 2. Rewrote the test to make it accurate. >> Tested on Ubuntu 12.04, Solaris 11 and Oracle Linux 6.4. >> >> Thanks, >> Oleg >> >> On 02/04/2014 07:50 PM, Alexander Zvegintsev wrote: >>> Oleg, >>> >>> please see inline >>> >>> On 02/04/2014 05:00 PM, Oleg Pekhovskiy wrote: >>>> Hi Alexander, >>>> >>>> thank you for the review! >>>> >>>> 1. The problem is that I didn't find that root window ALWAYS starts >>>> with 0, 0 in X11 docs. >>>> Could you please point such statement out to avoid uncertainty? >>> Unfortunately, I cannot find any document which clearly specifies >>> this. is the root of this hierarchy. >>> On my understanding root window is the root of windows treehierarchy >>> and all other windows are children or descendants of it. >>> So root window is the origin for all other windows and and I assume >>> that it has (0,0) coordinates always and I would >>> be surprised if it not. >>> >>>> 2. Checking insets against screen width and height can fail too. >>>> Example: >>>> 1st screen (0, 0, 1024, 768) - x, y, width, height >>>> 2nd screen (1024, 0, 1920, 1080) >>>> Struts for the 2nd screen could be (1074, 0, 20, 0) - left, right, >>>> top, bottom. >>>> So left strut 1075 fits in 1920 but should be 50 as inset. >>> Yes, my check will fail on this case. >>>> PS: Just curious: you said that screen (1000, 50, 1000, 1000) is a >>>> valid case. >>>> Is it valid for testing environment? As I see screens are left-top >>>> aligned. >>>> It means that if two screens are located from left to right, they >>>> both have y == 0 regardless of their height. >>> It is a valid case, screens can be arranged in any order, screens >>> even can be overlapped, may have empty spaces between. >>> (and we definitely will not support last 2 cases). >>> >>> My previous example was a little abstract, here is the real one with >>> screens aligned on bottom edge: >>> Screen #1 (0,0, 1920, 1080) >>> Screen #2 (1920, 30, 1680, 1050) with top inset 35 >>> >>> It is unlikely that we will meet such configuration, but who knows. >>> >>> Since this test will run on machines with environment close to >>> default I propose to made an assumption >>> that insets are not greater that a quarter (or 1/3?) of width and >>> height (and add a comment why we do that >>> and why test may fail): >>> >>> if (insets.left >= bounds.width / 4 >>> || insets.right >= bounds.width / 4 >>> || insets.top >= bounds.height / 4 >>> || insets.bottom >= bounds.height / 4) { >>> >>> >>> Thanks, >>> >>> Alexander. >>> >>> >>>> Usually insets are much less than dimensions of a screen and so >>>> strut minus screen edge should be less >>>> than summary dimension of neighbor screens. >>>> Please, correct me if I'm wrong. >>>> >>>> Thanks, >>>> Oleg >>>> >>>> 04.02.2014 15:28, Alexander Zvegintsev wrote: >>>>> Hi Oleg, >>>>> >>>>> I am just curious about adding rootBounds.x and rootBounds.y, it >>>>> looks redundant to me. >>>>> Is there a case when a root window have coordinates with non-zero >>>>> values? >>>>> >>>>> MultiScreenInsetsTest.java: >>>>>> 62 if ((bounds.x != 0 && insets.left >= bounds.x) >>>>>> 63 || (bounds.y != 0 && insets.top >= >>>>>> bounds.y)) { >>>>> This check will fail for screen with >>>>> [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, >>>>> but it is a valid case. >>>>> >>>>> I think we should check insets against screen width and height: >>>>> if (insets.left >= bounds.width >>>>> || insets.right >= bounds.width >>>>> || insets.top >= bounds.height >>>>> || insets.bottom >= bounds.height) { >>>>> >>>>> >>>>> Otherwise fix looks good to me. >>>>> >>>>> Thanks, >>>>> >>>>> Alexander. >>>>> On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: >>>>>> Hi All, >>>>>> >>>>>> please review the second version of fix: >>>>>> http://cr.openjdk.java.net/~bagiras/8020443.2/ >>>>>> >>>>>> It turned out that struts must be checked and corrected from all >>>>>> sides >>>>>> to become the proper screen insets. >>>>>> >>>>>> Thanks, >>>>>> Oleg >>>>>> >>>>>> On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> please review the fix >>>>>>> http://cr.openjdk.java.net/~bagiras/8020443.1/ >>>>>>> for >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8020443 >>>>>>> >>>>>>> Referring to the standards, we must calculate insets the special >>>>>>> way for Xinerama: >>>>>>> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >>>>>>> >>>>>>> _NET_WM_STRUT_PARTIAL >>>>>>> "The start and end values associated with each strut allow areas >>>>>>> to be reserved which do not span the entire width or height of >>>>>>> the screen. Struts MUST be specified in root window coordinates, >>>>>>> that is, they are /not/ relative to the edges of any view port >>>>>>> or Xinerama monitor." >>>>>>> >>>>>>> So the fix checks if the insets have absolute values and if so >>>>>>> makes them relative to each screen. >>>>>>> The issue occurred when the Frame was created with the location >>>>>>> by default. >>>>>>> >>>>>>> Thanks, >>>>>>> Oleg >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140206/13d537e4/attachment-0001.html From konstantin.shefov at oracle.com Thu Feb 6 05:03:51 2014 From: konstantin.shefov at oracle.com (Konstantin Shefov) Date: Thu, 06 Feb 2014 17:03:51 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution Message-ID: <52F38837.9090805@oracle.com> Hi all, please review the fix http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 for https://bugs.openjdk.java.net/browse/JDK-8017456 Test hangs on windows if test frames are covered by a window of some other app. Thanks, Konstantin From Sergey.Bylokhov at oracle.com Thu Feb 6 05:21:18 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 06 Feb 2014 17:21:18 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52F38837.9090805@oracle.com> References: <52F38837.9090805@oracle.com> Message-ID: <52F38C4E.6020402@oracle.com> Hi, Konstantin. The tests should not use System.exit() , it can be forbidden in some modes of jtreg. On 06.02.2014 17:03, Konstantin Shefov wrote: > Hi all, > > please review the fix > http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 > for > https://bugs.openjdk.java.net/browse/JDK-8017456 > > Test hangs on windows if test frames are covered by a window of some > other app. > > Thanks, > Konstantin -- Best regards, Sergey. From konstantin.shefov at oracle.com Thu Feb 6 05:49:56 2014 From: konstantin.shefov at oracle.com (Konstantin Shefov) Date: Thu, 06 Feb 2014 17:49:56 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52F38C4E.6020402@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> Message-ID: <52F39304.1060304@oracle.com> Sergey, This System.exit will never be seen by jtreg, more than that, this test already has system.exit and will not work without it. Konstantin On 06-Feb-14 17:21, Sergey Bylokhov wrote: > Hi, Konstantin. > The tests should not use System.exit() , it can be forbidden in some > modes of jtreg. > > On 06.02.2014 17:03, Konstantin Shefov wrote: >> Hi all, >> >> please review the fix >> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >> for >> https://bugs.openjdk.java.net/browse/JDK-8017456 >> >> Test hangs on windows if test frames are covered by a window of some >> other app. >> >> Thanks, >> Konstantin > > From konstantin.shefov at oracle.com Thu Feb 6 05:53:05 2014 From: konstantin.shefov at oracle.com (Konstantin Shefov) Date: Thu, 06 Feb 2014 17:53:05 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52F39304.1060304@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> Message-ID: <52F393C1.7080702@oracle.com> On 06-Feb-14 17:49, Konstantin Shefov wrote: > Sergey, > This System.exit will never be seen by jtreg, more than that, this > test already has system.exit and will not work without it. System.exit is invoked by child vm, child vm is NOT controlled by JTREG at all. > > Konstantin > > On 06-Feb-14 17:21, Sergey Bylokhov wrote: >> Hi, Konstantin. >> The tests should not use System.exit() , it can be forbidden in some >> modes of jtreg. >> >> On 06.02.2014 17:03, Konstantin Shefov wrote: >>> Hi all, >>> >>> please review the fix >>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>> for >>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>> >>> Test hangs on windows if test frames are covered by a window of some >>> other app. >>> >>> Thanks, >>> Konstantin >> >> > From Sergey.Bylokhov at oracle.com Thu Feb 6 05:55:03 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 06 Feb 2014 17:55:03 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52F393C1.7080702@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> <52F393C1.7080702@oracle.com> Message-ID: <52F39437.6010307@oracle.com> Thanks. Then the fix looks good. On 06.02.2014 17:53, Konstantin Shefov wrote: > > On 06-Feb-14 17:49, Konstantin Shefov wrote: >> Sergey, >> This System.exit will never be seen by jtreg, more than that, this >> test already has system.exit and will not work without it. > System.exit is invoked by child vm, child vm is NOT controlled by > JTREG at all. >> >> Konstantin >> >> On 06-Feb-14 17:21, Sergey Bylokhov wrote: >>> Hi, Konstantin. >>> The tests should not use System.exit() , it can be forbidden in some >>> modes of jtreg. >>> >>> On 06.02.2014 17:03, Konstantin Shefov wrote: >>>> Hi all, >>>> >>>> please review the fix >>>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>>> for >>>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>>> >>>> Test hangs on windows if test frames are covered by a window of >>>> some other app. >>>> >>>> Thanks, >>>> Konstantin >>> >>> >> > -- Best regards, Sergey. From alexander.zvegintsev at oracle.com Thu Feb 6 06:24:06 2014 From: alexander.zvegintsev at oracle.com (Alexander Zvegintsev) Date: Thu, 06 Feb 2014 18:24:06 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F384E2.30003@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> <52F0CEF8.7030805@oracle.com> <52F0E47F.3070309@oracle.com> <52F10C3F.3080202@oracle.com> <52F329FD.4030804@oracle.com> <52F3652E.6080205@oracle.com> <52F384E2.30003@oracle.com> Message-ID: <52F39B06.1000407@oracle.com> Oleg, my bad, and you are absolutely right then. Thanks, Alexander. On 02/06/2014 04:49 PM, Oleg Pekhovskiy wrote: > Hi Alexander, > > thank you for your comments, and let me pay attention to the wording: > > I wrote "struts" but not "coordinates of the struts". > I did it intentionally: here is the dump of > XToolkit.getScreenInsetsManually() > method on the second screen: > > Root bounds: java.awt.Rectangle[x=0,y=0,width=2048,height=768] > Screen bounds: java.awt.Rectangle[x=1024,y=0,width=1024,height=768] > Window #33554540 bounds[x=1024, y=24, width=1024, height=744] > struts[left=1089, right=0, top=0, bottom=0] > Window #31457297 bounds[x=1024, y=0, width=1024, height=24] > struts[left=0, right=0, top=24, bottom=0] > > As we see struts could be 0, even if their edge is not the same as the > root window edge. > So if we are talking about: > left_start_y, left_end_y, right_start_y, right_end_y, top_start_x, > top_end_x, bottom_start_x > of _NET_WM_STRUT_PARTIAL > I agree with you, but if we are talking about: > left, right, top, bottom > which is the case, I don't, and treat my comments as correct. > > Thanks, > Oleg > > On 02/06/2014 02:34 PM, Alexander Zvegintsev wrote: >> Hi Oleg, >> >> I am a little concerned about this comment: >>> * struts*could be*relative to root window bounds, so >> >> but specification[1] clearly says: >>> All coordinates are root window coordinates. >> so I think "could be" should be replaced by "are" (there is no need >> for a new webrev) >> >> Otherwise, the fix looks good to me. >> BTW, I like your idea with frame maximization to check insets. >> >> [1] >> http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idp6337880 >> Thanks, >> >> Alexander. >> On 02/06/2014 10:21 AM, Oleg Pekhovskiy wrote: >>> Hi Alexander, >>> >>> thanks for the comments, >>> please see the next version of fix: >>> http://cr.openjdk.java.net/~bagiras/8020443.3/ >>> >>> Updates: >>> 1. Left usage of root window coordinates because they passed to >>> XToolkit.getScreenInsetsManually() in Rectangle, not just Dimension. >>> Added comment for struts check. >>> >>> 2. Rewrote the test to make it accurate. >>> Tested on Ubuntu 12.04, Solaris 11 and Oracle Linux 6.4. >>> >>> Thanks, >>> Oleg >>> >>> On 02/04/2014 07:50 PM, Alexander Zvegintsev wrote: >>>> Oleg, >>>> >>>> please see inline >>>> >>>> On 02/04/2014 05:00 PM, Oleg Pekhovskiy wrote: >>>>> Hi Alexander, >>>>> >>>>> thank you for the review! >>>>> >>>>> 1. The problem is that I didn't find that root window ALWAYS >>>>> starts with 0, 0 in X11 docs. >>>>> Could you please point such statement out to avoid uncertainty? >>>> Unfortunately, I cannot find any document which clearly specifies >>>> this. is the root of this hierarchy. >>>> On my understanding root window is the root of windows >>>> treehierarchy and all other windows are children or descendants of it. >>>> So root window is the origin for all other windows and and I assume >>>> that it has (0,0) coordinates always and I would >>>> be surprised if it not. >>>> >>>>> 2. Checking insets against screen width and height can fail too. >>>>> Example: >>>>> 1st screen (0, 0, 1024, 768) - x, y, width, height >>>>> 2nd screen (1024, 0, 1920, 1080) >>>>> Struts for the 2nd screen could be (1074, 0, 20, 0) - left, right, >>>>> top, bottom. >>>>> So left strut 1075 fits in 1920 but should be 50 as inset. >>>> Yes, my check will fail on this case. >>>>> PS: Just curious: you said that screen (1000, 50, 1000, 1000) is a >>>>> valid case. >>>>> Is it valid for testing environment? As I see screens are left-top >>>>> aligned. >>>>> It means that if two screens are located from left to right, they >>>>> both have y == 0 regardless of their height. >>>> It is a valid case, screens can be arranged in any order, screens >>>> even can be overlapped, may have empty spaces between. >>>> (and we definitely will not support last 2 cases). >>>> >>>> My previous example was a little abstract, here is the real one >>>> with screens aligned on bottom edge: >>>> Screen #1 (0,0, 1920, 1080) >>>> Screen #2 (1920, 30, 1680, 1050) with top inset 35 >>>> >>>> It is unlikely that we will meet such configuration, but who knows. >>>> >>>> Since this test will run on machines with environment close to >>>> default I propose to made an assumption >>>> that insets are not greater that a quarter (or 1/3?) of width and >>>> height (and add a comment why we do that >>>> and why test may fail): >>>> >>>> if (insets.left >= bounds.width / 4 >>>> || insets.right >= bounds.width / 4 >>>> || insets.top >= bounds.height / 4 >>>> || insets.bottom >= bounds.height / 4) { >>>> >>>> >>>> Thanks, >>>> >>>> Alexander. >>>> >>>> >>>>> Usually insets are much less than dimensions of a screen and so >>>>> strut minus screen edge should be less >>>>> than summary dimension of neighbor screens. >>>>> Please, correct me if I'm wrong. >>>>> >>>>> Thanks, >>>>> Oleg >>>>> >>>>> 04.02.2014 15:28, Alexander Zvegintsev wrote: >>>>>> Hi Oleg, >>>>>> >>>>>> I am just curious about adding rootBounds.x and rootBounds.y, it >>>>>> looks redundant to me. >>>>>> Is there a case when a root window have coordinates with non-zero >>>>>> values? >>>>>> >>>>>> MultiScreenInsetsTest.java: >>>>>>> 62 if ((bounds.x != 0 && insets.left >= bounds.x) >>>>>>> 63 || (bounds.y != 0 && insets.top >= >>>>>>> bounds.y)) { >>>>>> This check will fail for screen with >>>>>> [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, >>>>>> but it is a valid case. >>>>>> >>>>>> I think we should check insets against screen width and height: >>>>>> if (insets.left >= bounds.width >>>>>> || insets.right >= bounds.width >>>>>> || insets.top >= bounds.height >>>>>> || insets.bottom >= bounds.height) { >>>>>> >>>>>> >>>>>> Otherwise fix looks good to me. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Alexander. >>>>>> On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: >>>>>>> Hi All, >>>>>>> >>>>>>> please review the second version of fix: >>>>>>> http://cr.openjdk.java.net/~bagiras/8020443.2/ >>>>>>> >>>>>>> It turned out that struts must be checked and corrected from all >>>>>>> sides >>>>>>> to become the proper screen insets. >>>>>>> >>>>>>> Thanks, >>>>>>> Oleg >>>>>>> >>>>>>> On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >>>>>>>> Hi all, >>>>>>>> >>>>>>>> please review the fix >>>>>>>> http://cr.openjdk.java.net/~bagiras/8020443.1/ >>>>>>>> for >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8020443 >>>>>>>> >>>>>>>> Referring to the standards, we must calculate insets the >>>>>>>> special way for Xinerama: >>>>>>>> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >>>>>>>> >>>>>>>> _NET_WM_STRUT_PARTIAL >>>>>>>> "The start and end values associated with each strut allow >>>>>>>> areas to be reserved which do not span the entire width or >>>>>>>> height of the screen. Struts MUST be specified in root window >>>>>>>> coordinates, that is, they are /not/ relative to the edges of >>>>>>>> any view port or Xinerama monitor." >>>>>>>> >>>>>>>> So the fix checks if the insets have absolute values and if so >>>>>>>> makes them relative to each screen. >>>>>>>> The issue occurred when the Frame was created with the location >>>>>>>> by default. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Oleg >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140206/e2281a4d/attachment-0001.html From Sergey.Bylokhov at oracle.com Thu Feb 6 06:35:14 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 06 Feb 2014 18:35:14 +0400 Subject: [9] Review request for 8020443: Frame is not created on the specified GraphicsDevice with two monitors In-Reply-To: <52F39B06.1000407@oracle.com> References: <52DE84D4.6030203@oracle.com> <52F0880C.2080602@oracle.com> <52F0CEF8.7030805@oracle.com> <52F0E47F.3070309@oracle.com> <52F10C3F.3080202@oracle.com> <52F329FD.4030804@oracle.com> <52F3652E.6080205@oracle.com> <52F384E2.30003@oracle.com> <52F39B06.1000407@oracle.com> Message-ID: <52F39DA2.6010109@oracle.com> The fix looks good to me too. On 06.02.2014 18:24, Alexander Zvegintsev wrote: > Oleg, > > my bad, and you are absolutely right then. > Thanks, > > Alexander. > On 02/06/2014 04:49 PM, Oleg Pekhovskiy wrote: >> Hi Alexander, >> >> thank you for your comments, and let me pay attention to the wording: >> >> I wrote "struts" but not "coordinates of the struts". >> I did it intentionally: here is the dump of >> XToolkit.getScreenInsetsManually() >> method on the second screen: >> >> Root bounds: java.awt.Rectangle[x=0,y=0,width=2048,height=768] >> Screen bounds: java.awt.Rectangle[x=1024,y=0,width=1024,height=768] >> Window #33554540 bounds[x=1024, y=24, width=1024, height=744] >> struts[left=1089, right=0, top=0, bottom=0] >> Window #31457297 bounds[x=1024, y=0, width=1024, height=24] >> struts[left=0, right=0, top=24, bottom=0] >> >> As we see struts could be 0, even if their edge is not the same as >> the root window edge. >> So if we are talking about: >> left_start_y, left_end_y, right_start_y, right_end_y, top_start_x, >> top_end_x, bottom_start_x >> of _NET_WM_STRUT_PARTIAL >> I agree with you, but if we are talking about: >> left, right, top, bottom >> which is the case, I don't, and treat my comments as correct. >> >> Thanks, >> Oleg >> >> On 02/06/2014 02:34 PM, Alexander Zvegintsev wrote: >>> Hi Oleg, >>> >>> I am a little concerned about this comment: >>>> * struts*could be*relative to root window bounds, so >>> >>> but specification[1] clearly says: >>>> All coordinates are root window coordinates. >>> so I think "could be" should be replaced by "are" (there is no need >>> for a new webrev) >>> >>> Otherwise, the fix looks good to me. >>> BTW, I like your idea with frame maximization to check insets. >>> >>> [1] >>> http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idp6337880 >>> Thanks, >>> >>> Alexander. >>> On 02/06/2014 10:21 AM, Oleg Pekhovskiy wrote: >>>> Hi Alexander, >>>> >>>> thanks for the comments, >>>> please see the next version of fix: >>>> http://cr.openjdk.java.net/~bagiras/8020443.3/ >>>> >>>> Updates: >>>> 1. Left usage of root window coordinates because they passed to >>>> XToolkit.getScreenInsetsManually() in Rectangle, not just Dimension. >>>> Added comment for struts check. >>>> >>>> 2. Rewrote the test to make it accurate. >>>> Tested on Ubuntu 12.04, Solaris 11 and Oracle Linux 6.4. >>>> >>>> Thanks, >>>> Oleg >>>> >>>> On 02/04/2014 07:50 PM, Alexander Zvegintsev wrote: >>>>> Oleg, >>>>> >>>>> please see inline >>>>> >>>>> On 02/04/2014 05:00 PM, Oleg Pekhovskiy wrote: >>>>>> Hi Alexander, >>>>>> >>>>>> thank you for the review! >>>>>> >>>>>> 1. The problem is that I didn't find that root window ALWAYS >>>>>> starts with 0, 0 in X11 docs. >>>>>> Could you please point such statement out to avoid uncertainty? >>>>> Unfortunately, I cannot find any document which clearly specifies >>>>> this. is the root of this hierarchy. >>>>> On my understanding root window is the root of windows >>>>> treehierarchy and all other windows are children or descendants of it. >>>>> So root window is the origin for all other windows and and I >>>>> assume that it has (0,0) coordinates always and I would >>>>> be surprised if it not. >>>>> >>>>>> 2. Checking insets against screen width and height can fail too. >>>>>> Example: >>>>>> 1st screen (0, 0, 1024, 768) - x, y, width, height >>>>>> 2nd screen (1024, 0, 1920, 1080) >>>>>> Struts for the 2nd screen could be (1074, 0, 20, 0) - left, >>>>>> right, top, bottom. >>>>>> So left strut 1075 fits in 1920 but should be 50 as inset. >>>>> Yes, my check will fail on this case. >>>>>> PS: Just curious: you said that screen (1000, 50, 1000, 1000) is >>>>>> a valid case. >>>>>> Is it valid for testing environment? As I see screens are >>>>>> left-top aligned. >>>>>> It means that if two screens are located from left to right, they >>>>>> both have y == 0 regardless of their height. >>>>> It is a valid case, screens can be arranged in any order, screens >>>>> even can be overlapped, may have empty spaces between. >>>>> (and we definitely will not support last 2 cases). >>>>> >>>>> My previous example was a little abstract, here is the real one >>>>> with screens aligned on bottom edge: >>>>> Screen #1 (0,0, 1920, 1080) >>>>> Screen #2 (1920, 30, 1680, 1050) with top inset 35 >>>>> >>>>> It is unlikely that we will meet such configuration, but who knows. >>>>> >>>>> Since this test will run on machines with environment close to >>>>> default I propose to made an assumption >>>>> that insets are not greater that a quarter (or 1/3?) of width and >>>>> height (and add a comment why we do that >>>>> and why test may fail): >>>>> >>>>> if (insets.left >= bounds.width / 4 >>>>> || insets.right >= bounds.width / 4 >>>>> || insets.top >= bounds.height / 4 >>>>> || insets.bottom >= bounds.height / 4) { >>>>> >>>>> >>>>> Thanks, >>>>> >>>>> Alexander. >>>>> >>>>> >>>>>> Usually insets are much less than dimensions of a screen and so >>>>>> strut minus screen edge should be less >>>>>> than summary dimension of neighbor screens. >>>>>> Please, correct me if I'm wrong. >>>>>> >>>>>> Thanks, >>>>>> Oleg >>>>>> >>>>>> 04.02.2014 15:28, Alexander Zvegintsev wrote: >>>>>>> Hi Oleg, >>>>>>> >>>>>>> I am just curious about adding rootBounds.x and rootBounds.y, it >>>>>>> looks redundant to me. >>>>>>> Is there a case when a root window have coordinates with >>>>>>> non-zero values? >>>>>>> >>>>>>> MultiScreenInsetsTest.java: >>>>>>>> 62 if ((bounds.x != 0 && insets.left >= bounds.x) >>>>>>>> 63 || (bounds.y != 0 && insets.top >= >>>>>>>> bounds.y)) { >>>>>>> This check will fail for screen with >>>>>>> [x=1000,y=50,width=1000,height=1000] bounds and top inset 100, >>>>>>> but it is a valid case. >>>>>>> >>>>>>> I think we should check insets against screen width and height: >>>>>>> if (insets.left >= bounds.width >>>>>>> || insets.right >= bounds.width >>>>>>> || insets.top >= bounds.height >>>>>>> || insets.bottom >= bounds.height) { >>>>>>> >>>>>>> >>>>>>> Otherwise fix looks good to me. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Alexander. >>>>>>> On 02/04/2014 10:26 AM, Oleg Pekhovskiy wrote: >>>>>>>> Hi All, >>>>>>>> >>>>>>>> please review the second version of fix: >>>>>>>> http://cr.openjdk.java.net/~bagiras/8020443.2/ >>>>>>>> >>>>>>>> It turned out that struts must be checked and corrected from >>>>>>>> all sides >>>>>>>> to become the proper screen insets. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Oleg >>>>>>>> >>>>>>>> On 01/21/2014 06:31 PM, Oleg Pekhovskiy wrote: >>>>>>>>> Hi all, >>>>>>>>> >>>>>>>>> please review the fix >>>>>>>>> http://cr.openjdk.java.net/~bagiras/8020443.1/ >>>>>>>>> for >>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8020443 >>>>>>>>> >>>>>>>>> Referring to the standards, we must calculate insets the >>>>>>>>> special way for Xinerama: >>>>>>>>> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html >>>>>>>>> >>>>>>>>> _NET_WM_STRUT_PARTIAL >>>>>>>>> "The start and end values associated with each strut allow >>>>>>>>> areas to be reserved which do not span the entire width or >>>>>>>>> height of the screen. Struts MUST be specified in root window >>>>>>>>> coordinates, that is, they are /not/ relative to the edges of >>>>>>>>> any view port or Xinerama monitor." >>>>>>>>> >>>>>>>>> So the fix checks if the insets have absolute values and if so >>>>>>>>> makes them relative to each screen. >>>>>>>>> The issue occurred when the Frame was created with the >>>>>>>>> location by default. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Oleg >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -- Best regards, Sergey. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140206/304a1a97/attachment.html From gnu.andrew at redhat.com Thu Feb 6 08:09:08 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Thu, 6 Feb 2014 11:09:08 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140205151517.GA9621@redhat.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> Message-ID: <1109732625.5574662.1391702948203.JavaMail.root@redhat.com> ----- Original Message ----- > * Andrew Hughes [2014-02-04 19:26]: > > > On 2014-02-03 18:43, Omair Majid wrote: > > > > The following webrevs modify the build system to allow building against > > > > the system-installed copy of libpng as well as using the bundled copy > > > > of > > > > libpng > > > > > > > > ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ > > > > JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ > > > > > > > > A new configure option `--with-libpng` is introduced which defaults to > > > > `bundled` but can be set to `system` to use the system-installed copy > > > > of > > > > libpng. > > > > In this respect, why does this not just use AC_ARG_ENABLE as there are only > > two options here (system libpng or bundled libpng)? > > > > Also, this patch hardcodes the libpng cflags and ldflags when these should > > be obtained from pkg-config. This is how these values are obtained in > > IcedTea > > and using this patch would thus be a regression. > > The answer to both of these is the same: I followed how the existing code > handles zlib. If this needs fixing, then it needs to be fixed in the > other cases (zlib and giflib) too. > Yes (well, giflib doesn't have pkg-config but otherwise...). We said this last time this work was discussed, so I'm a little surprised to see this patch being posted in the same form again. > Thanks, > Omair > > -- > PGP Key: 66484681 (http://pgp.mit.edu/) > Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From anthony.petrov at oracle.com Thu Feb 6 12:37:40 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Fri, 07 Feb 2014 00:37:40 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F37EF0.7080503@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> <52F2AC94.9050001@oracle.com> <52F2BF06.20107@oracle.com> <52F374EE.8050600@oracle.com> <52F37EF0.7080503@oracle.com> Message-ID: <52F3F294.8050303@oracle.com> Well, I disagree. My point is that AWTEvents for internal components should not be delivered to listeners that can be installed via public API. If JDK developers need to trace those events, they could use some logging facilities. Application developers do not need to handle those events. -- best regards, Anthony On 2/6/2014 4:24 PM, Sergey Bylokhov wrote: > On 06.02.2014 15:41, Anthony Petrov wrote: >> Indeed, it wasn't an external developer who filed the original bug. >> Thanks for the clarification. >> >> Still, I don't see any reason to post events for components that >> belong to our peers' implementations and shouldn't be accessible via >> public API. > The reason is that we easily can check if someone flood the system. And > it is not contradict the specification. >> >> I'd like to ask you again: does the original fix really break anyone? >> Or is the only reason to back it out is the fact that we don't like >> the implementation of the filtering mechanism (and I admit, I don't >> like it too)? If it's the latter, I'd suggest you to actually _rework_ >> that fix as the synopsis of 8032187 suggests, rather than simply >> remove it. Or leave it as is and keep the 8032187 bug open for now. > My point is that the previous fix is incorrect, because there was no bug > in jdk and the test should be updated instead. >> >> -- >> best regards, >> Anthony >> >> On 2/6/2014 2:45 AM, Sergey Bylokhov wrote: >>> On 06.02.2014 1:26, Anthony Petrov wrote: >>>> [ adding back the awt-dev@ mailing list ] >>>> >>>> Hi Sergey, >>>> >>>> This all boils down to whether we want to deliver events related to >>>> our internal components to the user code or not. The fact that the >>>> MACOSX_PORT-424 was filed by an external developer suggests that this >>>> behavior may be unwanted. Also, common sense suggests that such events >>>> are useless for external consumers, and hence sending them just >>>> doesn't make any sense. >>> No, it is not an external developer. It was filed because some test, >>> which was provided by Apple, failed. >>>> >>>> Could you please clarify again exactly what the problem is with the >>>> original fix for this issue? I do not quite like it myself (e.g. when >>>> I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the >>>> setting/unsetting the listener looks like a hack, I agree), but I >>>> don't see any serious consequences that that fix could cause. Could >>>> you please elaborate on that? >>> That's because this fix try to eliminate events during peers creation >>> only. This was a hack and the goal was to fix one particular test. >>>> >>>> If we see that there's some serious flows with the original solution, >>>> let's get rid of it. However, we'll need to file a new bug to deal >>>> with all the unwanted events, and implement it some other way then. >>> Why they are unwanted? AWT fires AWTEvents, and toolkit have an ability >>> to catch all events, which are dispatched system-wide without any >>> exceptions. As far as I understand toolkit listeners is kind of debug >>> mechanism which can help to track all events. >>>> >>>> -- >>>> best regards, >>>> Anthony >>>> >>>> On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: >>>>> On 05.02.2014 16:34, Anthony Petrov wrote: >>>>>> I agree that the listener should receive all the events for compound >>>>>> controls. They make sense because all the parts of compound controls >>>>>> are accessible via our public API, so the app could just assign >>>>>> listeners to specific sub-components if it needed to. >>>>> Not necessary, for example for our text component in xawt. The user >>>>> should filter out unnecessary events anyway, because they can >>>>> belongs to >>>>> a different application or some internal components(like >>>>> SharedOwnerFrame). >>>>>> >>>>>> However, this isn't true for our internal LWAWT components hierarchy. >>>>>> This hierarchy is hidden from users (they can't access the underlying >>>>>> Swing components via public API, and moreover, they shouldn't be able >>>>>> to do so even if they want to). It is an implementation detail of the >>>>>> LWAWT toolkit. And therefore, I don't see a reason to post events >>>>>> related to this hidden hierarchy to a listener that can be installed >>>>>> using the public API. >>>>>> >>>>>> Can we find another way to filter the events out? >>>>> Only if we will add additional checks to the places, where >>>>> Toolkit.enabledOnToolkit is used. >>>>>> >>>>>> -- >>>>>> best regards, >>>>>> Anthony >>>>>> >>>>>> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>>>>>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>>>>>> Hi Sergey, >>>>>>>> >>>>>>>> From the bug report: >>>>>>>>> After discussion, it was decided to accept MACOSX_PORT-424 as >>>>>>>>> not a >>>>>>>>> defect >>>>>>>> >>>>>>>> Are you saying that user code will start receiving hierarchy events >>>>>>>> related to the internal hierarchy of our LWAWT peers? Why would >>>>>>>> anyone >>>>>>>> want to process these events and why would we want to post them to >>>>>>>> user code? Is there any way to filter them out? >>>>>>> Documentation of Toolkit.addAWTEventListener() states: >>>>>>> * Adds an AWTEventListener to receive all AWTEvents dispatched >>>>>>> * system-wide that conform to the given >>>>>>> eventMask. >>>>>>> .... >>>>>>> * Note: event listener use is not recommended for normal >>>>>>> * application use, but are intended solely to support special >>>>>>> * purpose facilities including support for accessibility, >>>>>>> * event record/playback, and diagnostic tracing. >>>>>>> >>>>>>> And components intentionally cannot filter them out. All our non >>>>>>> trivial >>>>>>> compound components posts lots of such events. >>>>>>> >>>>>>>> While I agree that using reflection is a bad idea, but is there any >>>>>>>> other real problem with the original fix for MACOSX_PORT-424? I.e. >>>>>>>> does that fix break anything? If not, can we simply replace >>>>>>>> usages of >>>>>>>> reflection with AWTAccessor-like mechanism? >>>>>>> The problem not in reflection but in replacing global list of >>>>>>> listeners. >>>>>>>> >>>>>>>> -- >>>>>>>> best regards, >>>>>>>> Anthony >>>>>>>> >>>>>>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>>>>>> Hello. >>>>>>>>> Please review the fix for jdk 9. >>>>>>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>>>>>> - delegate.addNotify(),because it was called from >>>>>>>>> delegateContainer.addNotify(); >>>>>>>>> - Testcase was updated to filter out events not from the Frame: >>>>>>>>> 84 if (e.getSource() instanceof Frame) { >>>>>>>>> 85 counter++; >>>>>>>>> 86 notify(); >>>>>>>>> 87 } >>>>>>>>> >>>>>>>>> >>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>>>>>> Webrev can be found at: >>>>>>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>>>>>> >>>>>>> >>>>>>> >>>>> >>>>> >>> >>> > > From Sergey.Bylokhov at oracle.com Thu Feb 6 13:39:48 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 07 Feb 2014 01:39:48 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F3F294.8050303@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> <52F2AC94.9050001@oracle.com> <52F2BF06.20107@oracle.com> <52F374EE.8050600@oracle.com> <52F37EF0.7080503@oracle.com> <52F3F294.8050303@oracle.com> Message-ID: <52F40124.5090103@oracle.com> Hmm, we need someone else, who will solve a problem. Artem, what do you think? On 07.02.2014 0:37, Anthony Petrov wrote: > Well, I disagree. My point is that AWTEvents for internal components > should not be delivered to listeners that can be installed via public > API. If JDK developers need to trace those events, they could use some > logging facilities. Application developers do not need to handle those > events. > > -- > best regards, > Anthony > > On 2/6/2014 4:24 PM, Sergey Bylokhov wrote: >> On 06.02.2014 15:41, Anthony Petrov wrote: >>> Indeed, it wasn't an external developer who filed the original bug. >>> Thanks for the clarification. >>> >>> Still, I don't see any reason to post events for components that >>> belong to our peers' implementations and shouldn't be accessible via >>> public API. >> The reason is that we easily can check if someone flood the system. And >> it is not contradict the specification. >>> >>> I'd like to ask you again: does the original fix really break anyone? >>> Or is the only reason to back it out is the fact that we don't like >>> the implementation of the filtering mechanism (and I admit, I don't >>> like it too)? If it's the latter, I'd suggest you to actually _rework_ >>> that fix as the synopsis of 8032187 suggests, rather than simply >>> remove it. Or leave it as is and keep the 8032187 bug open for now. >> My point is that the previous fix is incorrect, because there was no bug >> in jdk and the test should be updated instead. >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/6/2014 2:45 AM, Sergey Bylokhov wrote: >>>> On 06.02.2014 1:26, Anthony Petrov wrote: >>>>> [ adding back the awt-dev@ mailing list ] >>>>> >>>>> Hi Sergey, >>>>> >>>>> This all boils down to whether we want to deliver events related to >>>>> our internal components to the user code or not. The fact that the >>>>> MACOSX_PORT-424 was filed by an external developer suggests that this >>>>> behavior may be unwanted. Also, common sense suggests that such >>>>> events >>>>> are useless for external consumers, and hence sending them just >>>>> doesn't make any sense. >>>> No, it is not an external developer. It was filed because some test, >>>> which was provided by Apple, failed. >>>>> >>>>> Could you please clarify again exactly what the problem is with the >>>>> original fix for this issue? I do not quite like it myself (e.g. when >>>>> I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the >>>>> setting/unsetting the listener looks like a hack, I agree), but I >>>>> don't see any serious consequences that that fix could cause. Could >>>>> you please elaborate on that? >>>> That's because this fix try to eliminate events during peers creation >>>> only. This was a hack and the goal was to fix one particular test. >>>>> >>>>> If we see that there's some serious flows with the original solution, >>>>> let's get rid of it. However, we'll need to file a new bug to deal >>>>> with all the unwanted events, and implement it some other way then. >>>> Why they are unwanted? AWT fires AWTEvents, and toolkit have an >>>> ability >>>> to catch all events, which are dispatched system-wide without any >>>> exceptions. As far as I understand toolkit listeners is kind of debug >>>> mechanism which can help to track all events. >>>>> >>>>> -- >>>>> best regards, >>>>> Anthony >>>>> >>>>> On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: >>>>>> On 05.02.2014 16:34, Anthony Petrov wrote: >>>>>>> I agree that the listener should receive all the events for >>>>>>> compound >>>>>>> controls. They make sense because all the parts of compound >>>>>>> controls >>>>>>> are accessible via our public API, so the app could just assign >>>>>>> listeners to specific sub-components if it needed to. >>>>>> Not necessary, for example for our text component in xawt. The user >>>>>> should filter out unnecessary events anyway, because they can >>>>>> belongs to >>>>>> a different application or some internal components(like >>>>>> SharedOwnerFrame). >>>>>>> >>>>>>> However, this isn't true for our internal LWAWT components >>>>>>> hierarchy. >>>>>>> This hierarchy is hidden from users (they can't access the >>>>>>> underlying >>>>>>> Swing components via public API, and moreover, they shouldn't be >>>>>>> able >>>>>>> to do so even if they want to). It is an implementation detail >>>>>>> of the >>>>>>> LWAWT toolkit. And therefore, I don't see a reason to post events >>>>>>> related to this hidden hierarchy to a listener that can be >>>>>>> installed >>>>>>> using the public API. >>>>>>> >>>>>>> Can we find another way to filter the events out? >>>>>> Only if we will add additional checks to the places, where >>>>>> Toolkit.enabledOnToolkit is used. >>>>>>> >>>>>>> -- >>>>>>> best regards, >>>>>>> Anthony >>>>>>> >>>>>>> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>>>>>>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>>>>>>> Hi Sergey, >>>>>>>>> >>>>>>>>> From the bug report: >>>>>>>>>> After discussion, it was decided to accept MACOSX_PORT-424 as >>>>>>>>>> not a >>>>>>>>>> defect >>>>>>>>> >>>>>>>>> Are you saying that user code will start receiving hierarchy >>>>>>>>> events >>>>>>>>> related to the internal hierarchy of our LWAWT peers? Why would >>>>>>>>> anyone >>>>>>>>> want to process these events and why would we want to post >>>>>>>>> them to >>>>>>>>> user code? Is there any way to filter them out? >>>>>>>> Documentation of Toolkit.addAWTEventListener() states: >>>>>>>> * Adds an AWTEventListener to receive all AWTEvents >>>>>>>> dispatched >>>>>>>> * system-wide that conform to the given >>>>>>>> eventMask. >>>>>>>> .... >>>>>>>> * Note: event listener use is not recommended for normal >>>>>>>> * application use, but are intended solely to support >>>>>>>> special >>>>>>>> * purpose facilities including support for accessibility, >>>>>>>> * event record/playback, and diagnostic tracing. >>>>>>>> >>>>>>>> And components intentionally cannot filter them out. All our non >>>>>>>> trivial >>>>>>>> compound components posts lots of such events. >>>>>>>> >>>>>>>>> While I agree that using reflection is a bad idea, but is >>>>>>>>> there any >>>>>>>>> other real problem with the original fix for MACOSX_PORT-424? >>>>>>>>> I.e. >>>>>>>>> does that fix break anything? If not, can we simply replace >>>>>>>>> usages of >>>>>>>>> reflection with AWTAccessor-like mechanism? >>>>>>>> The problem not in reflection but in replacing global list of >>>>>>>> listeners. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> best regards, >>>>>>>>> Anthony >>>>>>>>> >>>>>>>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>>>>>>> Hello. >>>>>>>>>> Please review the fix for jdk 9. >>>>>>>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>>>>>>> - delegate.addNotify(),because it was called from >>>>>>>>>> delegateContainer.addNotify(); >>>>>>>>>> - Testcase was updated to filter out events not from the >>>>>>>>>> Frame: >>>>>>>>>> 84 if (e.getSource() instanceof Frame) { >>>>>>>>>> 85 counter++; >>>>>>>>>> 86 notify(); >>>>>>>>>> 87 } >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>>>>>>> Webrev can be found at: >>>>>>>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>>>>>>> >>>>>>>> >>>>>>>> >>>>>> >>>>>> >>>> >>>> >> >> -- Best regards, Sergey. From oleg.pekhovskiy at oracle.com Thu Feb 6 16:31:14 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Fri, 07 Feb 2014 04:31:14 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52E708C3.4070803@oracle.com> References: <52E708C3.4070803@oracle.com> Message-ID: <52F42952.3080303@oracle.com> Hi all, please review the next version of fix: http://cr.openjdk.java.net/~bagiras/8031694.2/ We with Artem Ananiev had off-line discussion and he offered let the dying EDT to die and process unhandled events by forcing another EDT start. Thanks, Oleg On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: > Hi all, > > please review the fix > http://cr.openjdk.java.net/~bagiras/8031694.1/ > for > https://bugs.openjdk.java.net/browse/JDK-8031694 > > During forward-port of JDK-7189350 EDT.doDispatch was not taken into > account when calling EventQueue.detachDispatchThread(). > As a result harmful optimization of this method occurred. > So when doDispatch became false, no more events in QventQueue were > handled before EDT shutdown. > I kept the optimization but added the check to > EDT.pumpEventsForFilter() that EventQueue is not empty to keep pumping. > > Thanks, > Oleg From alexandr.scherbatiy at oracle.com Fri Feb 7 03:00:59 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 07 Feb 2014 15:00:59 +0400 Subject: [9] Review request for 8029339 Custom MultiResolution image support on HiDPI displays In-Reply-To: <52DF2F98.3030503@oracle.com> References: <52D51764.8020103@oracle.com> <52DF2F98.3030503@oracle.com> Message-ID: <52F4BCEB.9040702@oracle.com> On 1/22/2014 6:40 AM, Jim Graham wrote: > Hi Alexander, > > Before we get too far down the road on this API, I think we understand > the way in which MacOS processes multi-resolution images for HiDPI > screens, but have we investigated the processes that Windows uses > under Windows 8? My impression is that Windows 8 has included a > number of new techniques for dealing with the high resolution displays > that it will run on in the Windows tablet and mobile industries and > that these will also come into play as 4K displays (already available) > become more common on the desktop. We should make sure that what we > come up with here can provide native compatibility with either > platform's policies and standard practices. > > If you've investigated the MS policies I'd like to see a summary so > that we can consider them as we review this API... There is the Windows Guidelines for scaling to pixel density: http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx which says that Windows has automatic resource loading that supports three version of images scaling (100%, 140%, and 180%) -------------------------------- Without scaling, as the pixel density of a display device increases, the physical sizes of objects on screen get smaller. When UI would otherwise be too small to touch and when text gets too small to read, Windows scales the system and app UI to one of the following scaling plateaus: 1.0 (100%, no scaling is applied) 1.4 (140% scaling) 1.8 (180% scaling) Windows determines which scaling plateau to use based on the physical screen size, the screen resolution, the DPI of the screen, and form factor. Use resource loading for bitmap images in the app package For bitmap images stored in the app package, provide a separate image for each scaling factor(100%, 140%, and 180%), and name your image files using the "scale" naming convention described below. Windows loads the right image for the current scale automatically. -------------------------------- The image name convention for the various scales is: images/logo.scale-100.png images/logo.scale-140.png images/logo.scale-180.png The 'ms-appx:///images/logo.png' uri is used to load the image in an application. If we want to support this in the same way as it is done for Mac OS X the WToolkit should return MultiResolution image in case if the loaded image has .scale-* qualifiers. The Graphics class can request an image with necessary resolution from the MultiResolution image. It seems that nothing should be changed in the MultiResolution interface in this case. Thanks, Alexandr. > > ...jim > > On 1/14/14 2:54 AM, Alexander Scherbatiy wrote: >> >> Hello, >> >> Could you review the fix: >> bug: https://bugs.openjdk.java.net/browse/JDK-8029339 >> webrev: http://cr.openjdk.java.net/~alexsch/8029339/webrev.00 >> >> This is a proposal to introduce an API that allows to create a custom >> multi resolution image. >> >> I. It seems reasonable that the API should provide two basic operations: >> >> 1. Get the resolution variant based on the requested image width and >> height: >> - Image getResolutionVariant(int width, int height) >> >> Usually the system provides the scale factor which represents the >> number of pixels corresponding to each linear unit on the display. >> However, it has sense to combine the scale factor and the current >> transformations to get the actual image size to be displayed. >> >> 2. Get all provided resolution variants: >> - List getResolutionVariants() >> >> There are several uses cases: >> - Create a new multi-resolution image based on the given >> multi-resolution image. >> - Pass to the native system the multi-resolution image. For example, >> a use can set to the system the custom multi-resolution cursor. >> >> II. There are some possible ways where the new API can be added >> >> 1. java.awt.Image. >> >> The 2 new methods can be added to the Image class. A user can >> override >> the getResolutionVariant() and getResolutionVariants() methods to >> provide the resolution variants >> or there can be default implementations of these methods if a user >> puts resolution variants >> to the list in the sorted order. >> >> To check that the image has resolution variants the following >> statement can be used: image.getResolutionVariants().size() != 1 >> >> The disadvantage is that there is an overhead that the Image class >> should contain the List object and not all >> images can have resolution variants. >> >> 2. Introduce new MultiResolutionImage interface. >> >> A user should extend Image class and implement the >> MultiResolutionImage interface. >> >> For example: >> --------------------- >> public class CustomMultiResolutionImage extends BufferedImage >> implements MultiResolutionImage { >> >> Image highResolutionImage; >> >> public CustomMultiResolutionImage(BufferedImage baseImage, >> BufferedImage highResolutionImage) { >> super(baseImage.getWidth(), baseImage.getHeight(), >> baseImage.getType()); >> this.highResolutionImage = highResolutionImage; >> Graphics g = getGraphics(); >> g.drawImage(baseImage, 0, 0, null); >> g.dispose(); >> } >> >> @Override >> public Image getResolutionVariant(int width, int height) { >> return ((width <= getWidth() && height <= getHeight())) >> ? this : highResolutionImage; >> } >> >> @Override >> public List getResolutionVariants() { >> return Arrays.asList(this, highResolutionImage); >> } >> } >> --------------------- >> >> The current fix adds the MultiResolutionImage interface and public >> resolution variant rendering hints. >> >> Thanks, >> Alexandr. >> From magnus.ihse.bursie at oracle.com Fri Feb 7 04:49:20 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 07 Feb 2014 13:49:20 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140205151517.GA9621@redhat.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> Message-ID: <52F4D650.8020301@oracle.com> On 2014-02-05 16:15, Omair Majid wrote: > * Andrew Hughes [2014-02-04 19:26]: >>> On 2014-02-03 18:43, Omair Majid wrote: >>>> The following webrevs modify the build system to allow building against >>>> the system-installed copy of libpng as well as using the bundled copy of >>>> libpng >>>> >>>> ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ >>>> JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ >>>> >>>> A new configure option `--with-libpng` is introduced which defaults to >>>> `bundled` but can be set to `system` to use the system-installed copy of >>>> libpng. >> In this respect, why does this not just use AC_ARG_ENABLE as there are only >> two options here (system libpng or bundled libpng)? >> >> Also, this patch hardcodes the libpng cflags and ldflags when these should >> be obtained from pkg-config. This is how these values are obtained in IcedTea >> and using this patch would thus be a regression. > The answer to both of these is the same: I followed how the existing code > handles zlib. If this needs fixing, then it needs to be fixed in the > other cases (zlib and giflib) too. I agree with your thinking here. Following the existing patterns is good. If they should be extended with using pkg-config (which probably is a good idea), then that should extend to all these libraries. As an answer to Andrew as to why --with-libX=system/bundle instead of enable/disable: * First, the semantics of enable/disable inherited from autoconf is that enable/disable is about "features", but with is for external "packages". While this difference is not always applicable, I do think that external libraries should indeed be specified using --with-X. * Second, I believe the original intention was to allow for a third option, --with-libX=, which would point to an location in which the library is installed, similar to how e.g. --with-alsa works. So, once again, from a build perspective I believe this is a sound patch. /Magnus From artem.ananiev at oracle.com Fri Feb 7 05:53:24 2014 From: artem.ananiev at oracle.com (Artem Ananiev) Date: Fri, 07 Feb 2014 17:53:24 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F40124.5090103@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> <52F2AC94.9050001@oracle.com> <52F2BF06.20107@oracle.com> <52F374EE.8050600@oracle.com> <52F37EF0.7080503@oracle.com> <52F3F294.8050303@oracle.com> <52F40124.5090103@oracle.com> Message-ID: <52F4E554.1010500@oracle.com> On 2/7/2014 1:39 AM, Sergey Bylokhov wrote: > Hmm, we need someone else, who will solve a problem. > Artem, what do you think? I would suggest to suppress all the AWT events from our internal components. That is, if a component is accessible from application (e.g. JScrollPane's viewport), its events should be sent to toolkit listeners, otherwise not. As an application developer I would be surprised, if my application with a Frame and a Button will fire any events for JButton, right? Thanks, Artem > On 07.02.2014 0:37, Anthony Petrov wrote: >> Well, I disagree. My point is that AWTEvents for internal components >> should not be delivered to listeners that can be installed via public >> API. If JDK developers need to trace those events, they could use some >> logging facilities. Application developers do not need to handle those >> events. >> >> -- >> best regards, >> Anthony >> >> On 2/6/2014 4:24 PM, Sergey Bylokhov wrote: >>> On 06.02.2014 15:41, Anthony Petrov wrote: >>>> Indeed, it wasn't an external developer who filed the original bug. >>>> Thanks for the clarification. >>>> >>>> Still, I don't see any reason to post events for components that >>>> belong to our peers' implementations and shouldn't be accessible via >>>> public API. >>> The reason is that we easily can check if someone flood the system. And >>> it is not contradict the specification. >>>> >>>> I'd like to ask you again: does the original fix really break anyone? >>>> Or is the only reason to back it out is the fact that we don't like >>>> the implementation of the filtering mechanism (and I admit, I don't >>>> like it too)? If it's the latter, I'd suggest you to actually _rework_ >>>> that fix as the synopsis of 8032187 suggests, rather than simply >>>> remove it. Or leave it as is and keep the 8032187 bug open for now. >>> My point is that the previous fix is incorrect, because there was no bug >>> in jdk and the test should be updated instead. >>>> >>>> -- >>>> best regards, >>>> Anthony >>>> >>>> On 2/6/2014 2:45 AM, Sergey Bylokhov wrote: >>>>> On 06.02.2014 1:26, Anthony Petrov wrote: >>>>>> [ adding back the awt-dev@ mailing list ] >>>>>> >>>>>> Hi Sergey, >>>>>> >>>>>> This all boils down to whether we want to deliver events related to >>>>>> our internal components to the user code or not. The fact that the >>>>>> MACOSX_PORT-424 was filed by an external developer suggests that this >>>>>> behavior may be unwanted. Also, common sense suggests that such >>>>>> events >>>>>> are useless for external consumers, and hence sending them just >>>>>> doesn't make any sense. >>>>> No, it is not an external developer. It was filed because some test, >>>>> which was provided by Apple, failed. >>>>>> >>>>>> Could you please clarify again exactly what the problem is with the >>>>>> original fix for this issue? I do not quite like it myself (e.g. when >>>>>> I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the >>>>>> setting/unsetting the listener looks like a hack, I agree), but I >>>>>> don't see any serious consequences that that fix could cause. Could >>>>>> you please elaborate on that? >>>>> That's because this fix try to eliminate events during peers creation >>>>> only. This was a hack and the goal was to fix one particular test. >>>>>> >>>>>> If we see that there's some serious flows with the original solution, >>>>>> let's get rid of it. However, we'll need to file a new bug to deal >>>>>> with all the unwanted events, and implement it some other way then. >>>>> Why they are unwanted? AWT fires AWTEvents, and toolkit have an >>>>> ability >>>>> to catch all events, which are dispatched system-wide without any >>>>> exceptions. As far as I understand toolkit listeners is kind of debug >>>>> mechanism which can help to track all events. >>>>>> >>>>>> -- >>>>>> best regards, >>>>>> Anthony >>>>>> >>>>>> On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: >>>>>>> On 05.02.2014 16:34, Anthony Petrov wrote: >>>>>>>> I agree that the listener should receive all the events for >>>>>>>> compound >>>>>>>> controls. They make sense because all the parts of compound >>>>>>>> controls >>>>>>>> are accessible via our public API, so the app could just assign >>>>>>>> listeners to specific sub-components if it needed to. >>>>>>> Not necessary, for example for our text component in xawt. The user >>>>>>> should filter out unnecessary events anyway, because they can >>>>>>> belongs to >>>>>>> a different application or some internal components(like >>>>>>> SharedOwnerFrame). >>>>>>>> >>>>>>>> However, this isn't true for our internal LWAWT components >>>>>>>> hierarchy. >>>>>>>> This hierarchy is hidden from users (they can't access the >>>>>>>> underlying >>>>>>>> Swing components via public API, and moreover, they shouldn't be >>>>>>>> able >>>>>>>> to do so even if they want to). It is an implementation detail >>>>>>>> of the >>>>>>>> LWAWT toolkit. And therefore, I don't see a reason to post events >>>>>>>> related to this hidden hierarchy to a listener that can be >>>>>>>> installed >>>>>>>> using the public API. >>>>>>>> >>>>>>>> Can we find another way to filter the events out? >>>>>>> Only if we will add additional checks to the places, where >>>>>>> Toolkit.enabledOnToolkit is used. >>>>>>>> >>>>>>>> -- >>>>>>>> best regards, >>>>>>>> Anthony >>>>>>>> >>>>>>>> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>>>>>>>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>>>>>>>> Hi Sergey, >>>>>>>>>> >>>>>>>>>> From the bug report: >>>>>>>>>>> After discussion, it was decided to accept MACOSX_PORT-424 as >>>>>>>>>>> not a >>>>>>>>>>> defect >>>>>>>>>> >>>>>>>>>> Are you saying that user code will start receiving hierarchy >>>>>>>>>> events >>>>>>>>>> related to the internal hierarchy of our LWAWT peers? Why would >>>>>>>>>> anyone >>>>>>>>>> want to process these events and why would we want to post >>>>>>>>>> them to >>>>>>>>>> user code? Is there any way to filter them out? >>>>>>>>> Documentation of Toolkit.addAWTEventListener() states: >>>>>>>>> * Adds an AWTEventListener to receive all AWTEvents >>>>>>>>> dispatched >>>>>>>>> * system-wide that conform to the given >>>>>>>>> eventMask. >>>>>>>>> .... >>>>>>>>> * Note: event listener use is not recommended for normal >>>>>>>>> * application use, but are intended solely to support >>>>>>>>> special >>>>>>>>> * purpose facilities including support for accessibility, >>>>>>>>> * event record/playback, and diagnostic tracing. >>>>>>>>> >>>>>>>>> And components intentionally cannot filter them out. All our non >>>>>>>>> trivial >>>>>>>>> compound components posts lots of such events. >>>>>>>>> >>>>>>>>>> While I agree that using reflection is a bad idea, but is >>>>>>>>>> there any >>>>>>>>>> other real problem with the original fix for MACOSX_PORT-424? >>>>>>>>>> I.e. >>>>>>>>>> does that fix break anything? If not, can we simply replace >>>>>>>>>> usages of >>>>>>>>>> reflection with AWTAccessor-like mechanism? >>>>>>>>> The problem not in reflection but in replacing global list of >>>>>>>>> listeners. >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> best regards, >>>>>>>>>> Anthony >>>>>>>>>> >>>>>>>>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>>>>>>>> Hello. >>>>>>>>>>> Please review the fix for jdk 9. >>>>>>>>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>>>>>>>> - delegate.addNotify(),because it was called from >>>>>>>>>>> delegateContainer.addNotify(); >>>>>>>>>>> - Testcase was updated to filter out events not from the >>>>>>>>>>> Frame: >>>>>>>>>>> 84 if (e.getSource() instanceof Frame) { >>>>>>>>>>> 85 counter++; >>>>>>>>>>> 86 notify(); >>>>>>>>>>> 87 } >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>>>>>>>> Webrev can be found at: >>>>>>>>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>> >>>>>>> >>>>> >>>>> >>> >>> > > From Sergey.Bylokhov at oracle.com Fri Feb 7 06:14:17 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 07 Feb 2014 18:14:17 +0400 Subject: [9] Review Request: 8032187 [macosx] The fix for MACOSX_PORT-424 should be reworked In-Reply-To: <52F4E554.1010500@oracle.com> References: <52F0D47F.5090506@oracle.com> <52F13A2E.8030404@oracle.com> <52F15AF0.6040509@oracle.com> <52F22FD8.7060008@oracle.com> <52F2427B.7090201@oracle.com> <52F2AC94.9050001@oracle.com> <52F2BF06.20107@oracle.com> <52F374EE.8050600@oracle.com> <52F37EF0.7080503@oracle.com> <52F3F294.8050303@oracle.com> <52F40124.5090103@oracle.com> <52F4E554.1010500@oracle.com> Message-ID: <52F4EA39.1050500@oracle.com> On 07.02.2014 17:53, Artem Ananiev wrote: > > On 2/7/2014 1:39 AM, Sergey Bylokhov wrote: >> Hmm, we need someone else, who will solve a problem. >> Artem, what do you think? > > I would suggest to suppress all the AWT events from our internal > components. That is, if a component is accessible from application > (e.g. JScrollPane's viewport), its events should be sent to toolkit > listeners, otherwise not. As an application developer I would be > surprised, if my application with a Frame and a Button will fire any > events for JButton, right? Ok. I'll prepare the new version of the fix. > > Thanks, > > Artem > >> On 07.02.2014 0:37, Anthony Petrov wrote: >>> Well, I disagree. My point is that AWTEvents for internal components >>> should not be delivered to listeners that can be installed via public >>> API. If JDK developers need to trace those events, they could use some >>> logging facilities. Application developers do not need to handle those >>> events. >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/6/2014 4:24 PM, Sergey Bylokhov wrote: >>>> On 06.02.2014 15:41, Anthony Petrov wrote: >>>>> Indeed, it wasn't an external developer who filed the original bug. >>>>> Thanks for the clarification. >>>>> >>>>> Still, I don't see any reason to post events for components that >>>>> belong to our peers' implementations and shouldn't be accessible via >>>>> public API. >>>> The reason is that we easily can check if someone flood the system. >>>> And >>>> it is not contradict the specification. >>>>> >>>>> I'd like to ask you again: does the original fix really break anyone? >>>>> Or is the only reason to back it out is the fact that we don't like >>>>> the implementation of the filtering mechanism (and I admit, I don't >>>>> like it too)? If it's the latter, I'd suggest you to actually >>>>> _rework_ >>>>> that fix as the synopsis of 8032187 suggests, rather than simply >>>>> remove it. Or leave it as is and keep the 8032187 bug open for now. >>>> My point is that the previous fix is incorrect, because there was >>>> no bug >>>> in jdk and the test should be updated instead. >>>>> >>>>> -- >>>>> best regards, >>>>> Anthony >>>>> >>>>> On 2/6/2014 2:45 AM, Sergey Bylokhov wrote: >>>>>> On 06.02.2014 1:26, Anthony Petrov wrote: >>>>>>> [ adding back the awt-dev@ mailing list ] >>>>>>> >>>>>>> Hi Sergey, >>>>>>> >>>>>>> This all boils down to whether we want to deliver events related to >>>>>>> our internal components to the user code or not. The fact that the >>>>>>> MACOSX_PORT-424 was filed by an external developer suggests that >>>>>>> this >>>>>>> behavior may be unwanted. Also, common sense suggests that such >>>>>>> events >>>>>>> are useless for external consumers, and hence sending them just >>>>>>> doesn't make any sense. >>>>>> No, it is not an external developer. It was filed because some test, >>>>>> which was provided by Apple, failed. >>>>>>> >>>>>>> Could you please clarify again exactly what the problem is with the >>>>>>> original fix for this issue? I do not quite like it myself (e.g. >>>>>>> when >>>>>>> I see "enableEvents(0xFFFFFFFF)" - this just looks fishy, and the >>>>>>> setting/unsetting the listener looks like a hack, I agree), but I >>>>>>> don't see any serious consequences that that fix could cause. Could >>>>>>> you please elaborate on that? >>>>>> That's because this fix try to eliminate events during peers >>>>>> creation >>>>>> only. This was a hack and the goal was to fix one particular test. >>>>>>> >>>>>>> If we see that there's some serious flows with the original >>>>>>> solution, >>>>>>> let's get rid of it. However, we'll need to file a new bug to deal >>>>>>> with all the unwanted events, and implement it some other way then. >>>>>> Why they are unwanted? AWT fires AWTEvents, and toolkit have an >>>>>> ability >>>>>> to catch all events, which are dispatched system-wide without any >>>>>> exceptions. As far as I understand toolkit listeners is kind of >>>>>> debug >>>>>> mechanism which can help to track all events. >>>>>>> >>>>>>> -- >>>>>>> best regards, >>>>>>> Anthony >>>>>>> >>>>>>> On 2/5/2014 5:54 PM, Sergey Bylokhov wrote: >>>>>>>> On 05.02.2014 16:34, Anthony Petrov wrote: >>>>>>>>> I agree that the listener should receive all the events for >>>>>>>>> compound >>>>>>>>> controls. They make sense because all the parts of compound >>>>>>>>> controls >>>>>>>>> are accessible via our public API, so the app could just assign >>>>>>>>> listeners to specific sub-components if it needed to. >>>>>>>> Not necessary, for example for our text component in xawt. The >>>>>>>> user >>>>>>>> should filter out unnecessary events anyway, because they can >>>>>>>> belongs to >>>>>>>> a different application or some internal components(like >>>>>>>> SharedOwnerFrame). >>>>>>>>> >>>>>>>>> However, this isn't true for our internal LWAWT components >>>>>>>>> hierarchy. >>>>>>>>> This hierarchy is hidden from users (they can't access the >>>>>>>>> underlying >>>>>>>>> Swing components via public API, and moreover, they shouldn't be >>>>>>>>> able >>>>>>>>> to do so even if they want to). It is an implementation detail >>>>>>>>> of the >>>>>>>>> LWAWT toolkit. And therefore, I don't see a reason to post events >>>>>>>>> related to this hidden hierarchy to a listener that can be >>>>>>>>> installed >>>>>>>>> using the public API. >>>>>>>>> >>>>>>>>> Can we find another way to filter the events out? >>>>>>>> Only if we will add additional checks to the places, where >>>>>>>> Toolkit.enabledOnToolkit is used. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> best regards, >>>>>>>>> Anthony >>>>>>>>> >>>>>>>>> On 2/5/2014 1:26 AM, Sergey Bylokhov wrote: >>>>>>>>>> On 04.02.2014 23:06, Anthony Petrov wrote: >>>>>>>>>>> Hi Sergey, >>>>>>>>>>> >>>>>>>>>>> From the bug report: >>>>>>>>>>>> After discussion, it was decided to accept MACOSX_PORT-424 as >>>>>>>>>>>> not a >>>>>>>>>>>> defect >>>>>>>>>>> >>>>>>>>>>> Are you saying that user code will start receiving hierarchy >>>>>>>>>>> events >>>>>>>>>>> related to the internal hierarchy of our LWAWT peers? Why would >>>>>>>>>>> anyone >>>>>>>>>>> want to process these events and why would we want to post >>>>>>>>>>> them to >>>>>>>>>>> user code? Is there any way to filter them out? >>>>>>>>>> Documentation of Toolkit.addAWTEventListener() states: >>>>>>>>>> * Adds an AWTEventListener to receive all AWTEvents >>>>>>>>>> dispatched >>>>>>>>>> * system-wide that conform to the given >>>>>>>>>> eventMask. >>>>>>>>>> .... >>>>>>>>>> * Note: event listener use is not recommended for normal >>>>>>>>>> * application use, but are intended solely to support >>>>>>>>>> special >>>>>>>>>> * purpose facilities including support for accessibility, >>>>>>>>>> * event record/playback, and diagnostic tracing. >>>>>>>>>> >>>>>>>>>> And components intentionally cannot filter them out. All our non >>>>>>>>>> trivial >>>>>>>>>> compound components posts lots of such events. >>>>>>>>>> >>>>>>>>>>> While I agree that using reflection is a bad idea, but is >>>>>>>>>>> there any >>>>>>>>>>> other real problem with the original fix for MACOSX_PORT-424? >>>>>>>>>>> I.e. >>>>>>>>>>> does that fix break anything? If not, can we simply replace >>>>>>>>>>> usages of >>>>>>>>>>> reflection with AWTAccessor-like mechanism? >>>>>>>>>> The problem not in reflection but in replacing global list of >>>>>>>>>> listeners. >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> best regards, >>>>>>>>>>> Anthony >>>>>>>>>>> >>>>>>>>>>> On 2/4/2014 3:52 PM, Sergey Bylokhov wrote: >>>>>>>>>>>> Hello. >>>>>>>>>>>> Please review the fix for jdk 9. >>>>>>>>>>>> - Initial fix for MACOSX_PORT-424 was reverted back. >>>>>>>>>>>> - delegate.addNotify(),because it was called from >>>>>>>>>>>> delegateContainer.addNotify(); >>>>>>>>>>>> - Testcase was updated to filter out events not from the >>>>>>>>>>>> Frame: >>>>>>>>>>>> 84 if (e.getSource() instanceof Frame) { >>>>>>>>>>>> 85 counter++; >>>>>>>>>>>> 86 notify(); >>>>>>>>>>>> 87 } >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8032187 >>>>>>>>>>>> Webrev can be found at: >>>>>>>>>>>> http://cr.openjdk.java.net/~serb/8032187/webrev.00 >>>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>> >>>>>>>> >>>>>> >>>>>> >>>> >>>> >> >> -- Best regards, Sergey. From anthony.petrov at oracle.com Fri Feb 7 06:48:27 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Fri, 07 Feb 2014 18:48:27 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52F42952.3080303@oracle.com> References: <52E708C3.4070803@oracle.com> <52F42952.3080303@oracle.com> Message-ID: <52F4F23B.6060604@oracle.com> Hi Oleg, This code is very tricky. I like it that we process any events that might be posted to the queue after the current EDT dies. However, could you please clarify how initializing a new EDT is any different from not letting the old one die? I.e. could we just not kill the old EDT if we see there are more events in the queue? If not, what exact difference does you solution bring? It's not that I'm against your fix, it looks good actually. I'd just like to understand the difference. Please elaborate. Also, I recall we've fixed a number of bugs in this area. Are we sure we don't regress after this fix? -- best regards, Anthony On 2/7/2014 4:31 AM, Oleg Pekhovskiy wrote: > Hi all, > > please review the next version of fix: > http://cr.openjdk.java.net/~bagiras/8031694.2/ > > We with Artem Ananiev had off-line discussion and he offered let the > dying EDT to die > and process unhandled events by forcing another EDT start. > > Thanks, > Oleg > > On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: >> Hi all, >> >> please review the fix >> http://cr.openjdk.java.net/~bagiras/8031694.1/ >> for >> https://bugs.openjdk.java.net/browse/JDK-8031694 >> >> During forward-port of JDK-7189350 EDT.doDispatch was not taken into >> account when calling EventQueue.detachDispatchThread(). >> As a result harmful optimization of this method occurred. >> So when doDispatch became false, no more events in QventQueue were >> handled before EDT shutdown. >> I kept the optimization but added the check to >> EDT.pumpEventsForFilter() that EventQueue is not empty to keep pumping. >> >> Thanks, >> Oleg > From oleg.pekhovskiy at oracle.com Fri Feb 7 08:18:01 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Fri, 07 Feb 2014 20:18:01 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52F4F23B.6060604@oracle.com> References: <52E708C3.4070803@oracle.com> <52F42952.3080303@oracle.com> <52F4F23B.6060604@oracle.com> Message-ID: <52F50739.7090003@oracle.com> Hi Anthony, there are two points for choosing this solution: 1. If something makes EDT to die, there is a serious reason to do so. It's a forced action. So it should be done ASAP. Dying EDT usage for pumping followed events looks strange because we expect him to die. Moreover it could happen that events are posted quite frequently to keep dying EDT alive for some period of time. 2. Synchronization object for posting events from different threads is EventQueue.pushPopLock. it is used in EventQueue. postEventPrivate(), EventQueue.getNextEvent() and EventQueue. detachDispatchThread(). When dying EDT returns from EventDispatchThread.pumpEventsForFilter() to EventDispatchThread.run() and then goes to getEventQueue().detachDispatchThread(), EventQueue.pushPopLock is not used, so any other thread could post events. So if we don't call peekEvent() to recreate a new EDT, we'll just loose these events as it currently happens. So the main idea is to make EDT life cycle phases obvious. Thanks, Oleg On 02/07/2014 06:48 PM, Anthony Petrov wrote: > Hi Oleg, > > This code is very tricky. I like it that we process any events that > might be posted to the queue after the current EDT dies. However, > could you please clarify how initializing a new EDT is any different > from not letting the old one die? I.e. could we just not kill the old > EDT if we see there are more events in the queue? If not, what exact > difference does you solution bring? > > It's not that I'm against your fix, it looks good actually. I'd just > like to understand the difference. Please elaborate. > Also, I recall we've fixed a number of bugs in this area. Are we sure > we don't regress after this fix? > > -- > best regards, > Anthony > > On 2/7/2014 4:31 AM, Oleg Pekhovskiy wrote: >> Hi all, >> >> please review the next version of fix: >> http://cr.openjdk.java.net/~bagiras/8031694.2/ >> >> We with Artem Ananiev had off-line discussion and he offered let the >> dying EDT to die >> and process unhandled events by forcing another EDT start. >> >> Thanks, >> Oleg >> >> On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: >>> Hi all, >>> >>> please review the fix >>> http://cr.openjdk.java.net/~bagiras/8031694.1/ >>> for >>> https://bugs.openjdk.java.net/browse/JDK-8031694 >>> >>> During forward-port of JDK-7189350 EDT.doDispatch was not taken into >>> account when calling EventQueue.detachDispatchThread(). >>> As a result harmful optimization of this method occurred. >>> So when doDispatch became false, no more events in QventQueue were >>> handled before EDT shutdown. >>> I kept the optimization but added the check to >>> EDT.pumpEventsForFilter() that EventQueue is not empty to keep pumping. >>> >>> Thanks, >>> Oleg >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140207/3b8e6c4c/attachment.html From james.graham at oracle.com Fri Feb 7 16:19:54 2014 From: james.graham at oracle.com (Jim Graham) Date: Fri, 07 Feb 2014 16:19:54 -0800 Subject: [9] Review request for 8029339 Custom MultiResolution image support on HiDPI displays In-Reply-To: <52F4BCEB.9040702@oracle.com> References: <52D51764.8020103@oracle.com> <52DF2F98.3030503@oracle.com> <52F4BCEB.9040702@oracle.com> Message-ID: <52F5782A.9060300@oracle.com> The primary thing that I was concerned about was the presence of integers in the API when Windows uses non-integer multiples and also what policy they use for choosing scaled images. I don't see a mention of taking the current transform into account, just physical issues like screen DPI and form factor. They talk about resolution plateaus and in their recommendations section they tell the developer to use a particular property that tells them the screen resolution to figure out which image to load if they are loading manually. There is no discussion about dynamically loading multiple versions of the image based on a dynamic program-applied transform factor as is done on MacOS. Also, they tell developers to draw images to a specific size rather than using auto-sizing. That begs the question as to how they interpret a call to draw an image just using a location in the presence of various DPI factors. ...jim On 2/7/14 3:00 AM, Alexander Scherbatiy wrote: > On 1/22/2014 6:40 AM, Jim Graham wrote: >> Hi Alexander, >> >> Before we get too far down the road on this API, I think we understand >> the way in which MacOS processes multi-resolution images for HiDPI >> screens, but have we investigated the processes that Windows uses >> under Windows 8? My impression is that Windows 8 has included a >> number of new techniques for dealing with the high resolution displays >> that it will run on in the Windows tablet and mobile industries and >> that these will also come into play as 4K displays (already available) >> become more common on the desktop. We should make sure that what we >> come up with here can provide native compatibility with either >> platform's policies and standard practices. >> >> If you've investigated the MS policies I'd like to see a summary so >> that we can consider them as we review this API... > There is the Windows Guidelines for scaling to pixel density: > http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx > which says that Windows has automatic resource loading that supports > three version of images scaling (100%, 140%, and 180%) > -------------------------------- > Without scaling, as the pixel density of a display device increases, the > physical sizes of objects on screen get smaller. > When UI would otherwise be too small to touch and when text gets too > small to read, > Windows scales the system and app UI to one of the following scaling > plateaus: > > 1.0 (100%, no scaling is applied) > 1.4 (140% scaling) > 1.8 (180% scaling) > > Windows determines which scaling plateau to use based on the physical > screen size, the screen resolution, the DPI of the screen, and form factor. > > Use resource loading for bitmap images in the app package For bitmap > images stored > in the app package, provide a separate image for each scaling > factor(100%, 140%, and 180%), > and name your image files using the "scale" naming convention described > below. > Windows loads the right image for the current scale automatically. > -------------------------------- > > The image name convention for the various scales is: > images/logo.scale-100.png > images/logo.scale-140.png > images/logo.scale-180.png > > The 'ms-appx:///images/logo.png' uri is used to load the image in an > application. > > If we want to support this in the same way as it is done for Mac OS X > the WToolkit should return MultiResolution image in case if the > loaded image has .scale-* qualifiers. > The Graphics class can request an image with necessary resolution > from the MultiResolution image. > > It seems that nothing should be changed in the MultiResolution > interface in this case. > > Thanks, > Alexandr. >> >> ...jim >> >> On 1/14/14 2:54 AM, Alexander Scherbatiy wrote: >>> >>> Hello, >>> >>> Could you review the fix: >>> bug: https://bugs.openjdk.java.net/browse/JDK-8029339 >>> webrev: http://cr.openjdk.java.net/~alexsch/8029339/webrev.00 >>> >>> This is a proposal to introduce an API that allows to create a custom >>> multi resolution image. >>> >>> I. It seems reasonable that the API should provide two basic operations: >>> >>> 1. Get the resolution variant based on the requested image width and >>> height: >>> - Image getResolutionVariant(int width, int height) >>> >>> Usually the system provides the scale factor which represents the >>> number of pixels corresponding to each linear unit on the display. >>> However, it has sense to combine the scale factor and the current >>> transformations to get the actual image size to be displayed. >>> >>> 2. Get all provided resolution variants: >>> - List getResolutionVariants() >>> >>> There are several uses cases: >>> - Create a new multi-resolution image based on the given >>> multi-resolution image. >>> - Pass to the native system the multi-resolution image. For example, >>> a use can set to the system the custom multi-resolution cursor. >>> >>> II. There are some possible ways where the new API can be added >>> >>> 1. java.awt.Image. >>> >>> The 2 new methods can be added to the Image class. A user can >>> override >>> the getResolutionVariant() and getResolutionVariants() methods to >>> provide the resolution variants >>> or there can be default implementations of these methods if a user >>> puts resolution variants >>> to the list in the sorted order. >>> >>> To check that the image has resolution variants the following >>> statement can be used: image.getResolutionVariants().size() != 1 >>> >>> The disadvantage is that there is an overhead that the Image class >>> should contain the List object and not all >>> images can have resolution variants. >>> >>> 2. Introduce new MultiResolutionImage interface. >>> >>> A user should extend Image class and implement the >>> MultiResolutionImage interface. >>> >>> For example: >>> --------------------- >>> public class CustomMultiResolutionImage extends BufferedImage >>> implements MultiResolutionImage { >>> >>> Image highResolutionImage; >>> >>> public CustomMultiResolutionImage(BufferedImage baseImage, >>> BufferedImage highResolutionImage) { >>> super(baseImage.getWidth(), baseImage.getHeight(), >>> baseImage.getType()); >>> this.highResolutionImage = highResolutionImage; >>> Graphics g = getGraphics(); >>> g.drawImage(baseImage, 0, 0, null); >>> g.dispose(); >>> } >>> >>> @Override >>> public Image getResolutionVariant(int width, int height) { >>> return ((width <= getWidth() && height <= getHeight())) >>> ? this : highResolutionImage; >>> } >>> >>> @Override >>> public List getResolutionVariants() { >>> return Arrays.asList(this, highResolutionImage); >>> } >>> } >>> --------------------- >>> >>> The current fix adds the MultiResolutionImage interface and public >>> resolution variant rendering hints. >>> >>> Thanks, >>> Alexandr. >>> > From james.graham at oracle.com Fri Feb 7 16:56:33 2014 From: james.graham at oracle.com (Jim Graham) Date: Fri, 07 Feb 2014 16:56:33 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52EFA980.6000404@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> Message-ID: <52F580C1.3020906@oracle.com> Hi Anton, In CPlatformLWWindow.java, why does it have to search for the right device when it was created with/from a Window object that should already know the right device? SG2D, line 2114 - I think TRANSFORM_SCALE allows negative scale factors so I think you need a little more protection from the transform call reversing the rectangle. Otherwise, I didn't spot any other issues... On 2/3/14 6:36 AM, Anton V. Tarasov wrote: > In SG2D, the drawHiDPIImage, for instance, makes a call to > op.filter(img, null); where the img is expected to return its layout > size. That's why I still prefer to use the setReturnLayoutSize > "switcher", in order not to go deep into the 2D rendering code, casting > here and there to OffscreenImage and calling getLayoutWidth/Height. Would we expect one of these images to have the BufferedImageOp version of drawImage be used on it? (It could happen if we ever leak the object into developers hands, but I'm not sure if that can happen or not - I'm pretty sure we don't use those Ops internally ourselves, do we?) ...jim From konstantin.shefov at oracle.com Sun Feb 9 23:33:43 2014 From: konstantin.shefov at oracle.com (Konstantin Shefov) Date: Mon, 10 Feb 2014 11:33:43 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52F39437.6010307@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> <52F393C1.7080702@oracle.com> <52F39437.6010307@oracle.com> Message-ID: <52F880D7.3080804@oracle.com> Please, review this test fix. The test blocks automated test execution, so should be fixed. Thanks -Konstantin On 06-Feb-14 17:55, Sergey Bylokhov wrote: > Thanks. > Then the fix looks good. > > On 06.02.2014 17:53, Konstantin Shefov wrote: >> >> On 06-Feb-14 17:49, Konstantin Shefov wrote: >>> Sergey, >>> This System.exit will never be seen by jtreg, more than that, this >>> test already has system.exit and will not work without it. >> System.exit is invoked by child vm, child vm is NOT controlled by >> JTREG at all. >>> >>> Konstantin >>> >>> On 06-Feb-14 17:21, Sergey Bylokhov wrote: >>>> Hi, Konstantin. >>>> The tests should not use System.exit() , it can be forbidden in >>>> some modes of jtreg. >>>> >>>> On 06.02.2014 17:03, Konstantin Shefov wrote: >>>>> Hi all, >>>>> >>>>> please review the fix >>>>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>>>> for >>>>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>>>> >>>>> Test hangs on windows if test frames are covered by a window of >>>>> some other app. >>>>> >>>>> Thanks, >>>>> Konstantin >>>> >>>> >>> >> > > From alexander.zvegintsev at oracle.com Mon Feb 10 00:26:32 2014 From: alexander.zvegintsev at oracle.com (Alexander Zvegintsev) Date: Mon, 10 Feb 2014 12:26:32 +0400 Subject: [9] Review request for JDK-8017472 [macosx] Transparency demo is not correctly dragged on the second monitor Message-ID: <52F88D38.80903@oracle.com> Hello AWT team, please review fix http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/00/ for https://bugs.openjdk.java.net/browse/JDK-8017472 Another issue was closed as a duplicate of this one, but it has a better self-explaining title: MouseEvent has wrong coordinates when using multiple monitors From mainScreen documentation[1]: > The main screen is not necessarily the same screen that contains the > menu bar or has its origin at (0, 0). > The main screen refers to the screen containing the window that is > currently receiving keyboard events. absY should be calculated relative to a primary screen According to documentation[2] primary screen can be obtained by call [[NSScreen screens] objectAtIndex:0]: The screen at index 0 in the returned array corresponds to the primary screen of the user?s system. [1]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/mainScreen [2]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/screens -- Thanks, Alexander. From Alan.Bateman at oracle.com Mon Feb 10 01:36:22 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 10 Feb 2014 09:36:22 +0000 Subject: RFR for JDK-8028711: TEST_BUG: Tests should pass through VM options: corelibs tests In-Reply-To: <52F87906.5040702@oracle.com> References: <52E4C2E8.1060605@oracle.com> <52E4D1F2.4030406@oracle.com> <52E5B4C3.6080405@oracle.com> <52F455FC.3020009@oracle.com> <52F4BD7B.8080006@oracle.com> <52F87906.5040702@oracle.com> Message-ID: <52F89D96.7000601@oracle.com> On 10/02/2014 07:00, michael cui wrote: > : > > Please review the newest version at : > http://cr.openjdk.java.net/~tyan/michael/JDK-8028711/webrev.03/ This looks good to me. There are a couple of places where javac wasn't updated. A few that I noticed are: test/com/sun/corba/5036554/TestCorbaBug.sh test/sun/tools/jconsole/ResourceCheckTest.sh test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh A minor comment on test/java/net/URLPermission/nstest/lookup.sh is that the resulting line length is 182 characters and this will likely be annoying for future side-by-side views. So I think I'd split this while you are there. -Alan. From Sergey.Bylokhov at oracle.com Mon Feb 10 02:16:50 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 10 Feb 2014 14:16:50 +0400 Subject: [9] Review request for JDK-8017472 [macosx] Transparency demo is not correctly dragged on the second monitor In-Reply-To: <52F88D38.80903@oracle.com> References: <52F88D38.80903@oracle.com> Message-ID: <52F8A712.1010304@oracle.com> Hi, Alexander. The fix looks good. A few notes about the test: - You should use realSync+sleep after setVisible(). - The native system can change the size of the frame after setVisble(); On 10.02.2014 12:26, Alexander Zvegintsev wrote: > Hello AWT team, > > please review fix > http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/00/ > for > https://bugs.openjdk.java.net/browse/JDK-8017472 > > Another issue was closed as a duplicate of this one, but it has a > better self-explaining title: > MouseEvent has wrong coordinates when using multiple monitors > > From mainScreen documentation[1]: >> The main screen is not necessarily the same screen that contains the >> menu bar or has its origin at (0, 0). >> The main screen refers to the screen containing the window that is >> currently receiving keyboard events. > > absY should be calculated relative to a primary screen > > According to documentation[2] primary screen can be obtained by call > [[NSScreen screens] objectAtIndex:0]: > The screen at index 0 in the returned array corresponds to the primary > screen of the user?s system. > [1]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/mainScreen > > [2]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/screens > > -- Best regards, Sergey. From alexander.zvegintsev at oracle.com Mon Feb 10 02:35:27 2014 From: alexander.zvegintsev at oracle.com (Alexander Zvegintsev) Date: Mon, 10 Feb 2014 14:35:27 +0400 Subject: [9] Review request for JDK-8017472 [macosx] Transparency demo is not correctly dragged on the second monitor In-Reply-To: <52F8A712.1010304@oracle.com> References: <52F88D38.80903@oracle.com> <52F8A712.1010304@oracle.com> Message-ID: <52F8AB6F.9050301@oracle.com> Hi Sergey, thanks for the review, updated test is located here: http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/01 Thanks, Alexander. On 02/10/2014 02:16 PM, Sergey Bylokhov wrote: > Hi, Alexander. > The fix looks good. > A few notes about the test: > - You should use realSync+sleep after setVisible(). > - The native system can change the size of the frame after setVisble(); > > On 10.02.2014 12:26, Alexander Zvegintsev wrote: >> Hello AWT team, >> >> please review fix >> http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/00/ >> for >> https://bugs.openjdk.java.net/browse/JDK-8017472 >> >> Another issue was closed as a duplicate of this one, but it has a >> better self-explaining title: >> MouseEvent has wrong coordinates when using multiple monitors >> >> From mainScreen documentation[1]: >>> The main screen is not necessarily the same screen that contains the >>> menu bar or has its origin at (0, 0). >>> The main screen refers to the screen containing the window that is >>> currently receiving keyboard events. >> >> absY should be calculated relative to a primary screen >> >> According to documentation[2] primary screen can be obtained by call >> [[NSScreen screens] objectAtIndex:0]: >> The screen at index 0 in the returned array corresponds to the >> primary screen of the user?s system. >> [1]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/mainScreen >> >> [2]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/screens >> >> > > From Sergey.Bylokhov at oracle.com Mon Feb 10 02:48:15 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 10 Feb 2014 14:48:15 +0400 Subject: [9] Review request for JDK-8017472 [macosx] Transparency demo is not correctly dragged on the second monitor In-Reply-To: <52F8AB6F.9050301@oracle.com> References: <52F88D38.80903@oracle.com> <52F8A712.1010304@oracle.com> <52F8AB6F.9050301@oracle.com> Message-ID: <52F8AE6F.6090203@oracle.com> Hi, Alexander. The fix looks good. On 10.02.2014 14:35, Alexander Zvegintsev wrote: > Hi Sergey, > > thanks for the review, updated test is located here: > http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/01 > > Thanks, > > Alexander. > > On 02/10/2014 02:16 PM, Sergey Bylokhov wrote: >> Hi, Alexander. >> The fix looks good. >> A few notes about the test: >> - You should use realSync+sleep after setVisible(). >> - The native system can change the size of the frame after setVisble(); >> >> On 10.02.2014 12:26, Alexander Zvegintsev wrote: >>> Hello AWT team, >>> >>> please review fix >>> http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/00/ >>> for >>> https://bugs.openjdk.java.net/browse/JDK-8017472 >>> >>> Another issue was closed as a duplicate of this one, but it has a >>> better self-explaining title: >>> MouseEvent has wrong coordinates when using multiple monitors >>> >>> From mainScreen documentation[1]: >>>> The main screen is not necessarily the same screen that contains >>>> the menu bar or has its origin at (0, 0). >>>> The main screen refers to the screen containing the window that is >>>> currently receiving keyboard events. >>> >>> absY should be calculated relative to a primary screen >>> >>> According to documentation[2] primary screen can be obtained by call >>> [[NSScreen screens] objectAtIndex:0]: >>> The screen at index 0 in the returned array corresponds to the >>> primary screen of the user?s system. >>> [1]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/mainScreen >>> >>> [2]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/screens >>> >>> >> >> > -- Best regards, Sergey. From michael.cui at oracle.com Mon Feb 10 04:12:14 2014 From: michael.cui at oracle.com (michael cui) Date: Mon, 10 Feb 2014 20:12:14 +0800 Subject: RFR for JDK-8028711: TEST_BUG: Tests should pass through VM options: corelibs tests In-Reply-To: <52F89D96.7000601@oracle.com> References: <52E4C2E8.1060605@oracle.com> <52E4D1F2.4030406@oracle.com> <52E5B4C3.6080405@oracle.com> <52F455FC.3020009@oracle.com> <52F4BD7B.8080006@oracle.com> <52F87906.5040702@oracle.com> <52F89D96.7000601@oracle.com> Message-ID: <52F8C21E.10503@oracle.com> On 02/10/2014 05:36 PM, Alan Bateman wrote: > On 10/02/2014 07:00, michael cui wrote: >> : >> >> Please review the newest version at : >> http://cr.openjdk.java.net/~tyan/michael/JDK-8028711/webrev.03/ > This looks good to me. > > There are a couple of places where javac wasn't updated. A few that I > noticed are: > > test/com/sun/corba/5036554/TestCorbaBug.sh > test/sun/tools/jconsole/ResourceCheckTest.sh > test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh > The original code change did adding ${TESTTOOLVMOPTS} to javac, but I dropped it from new proposal. My understanding is that vmoption for javac would not change the compiler's behaviour. I could be wrong. Do you think we really need to pass such vm options to javac? And if it is needed, than how about other java tools such as jar, rmiregistry, ... etc. > A minor comment on test/java/net/URLPermission/nstest/lookup.sh is > that the resulting line length is 182 characters and this will likely > be annoying for future side-by-side views. So I think I'd split this > while you are there. I will split it after finalize the changes that we want to make. > > -Alan. -Michael Cui From alexandr.scherbatiy at oracle.com Mon Feb 10 05:53:06 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 10 Feb 2014 17:53:06 +0400 Subject: [9] Review request for 8033534 Get MultiResolution image from native system In-Reply-To: <52F0E466.6040002@oracle.com> References: <52F0E01B.3050004@oracle.com> <52F0E466.6040002@oracle.com> Message-ID: <52F8D9C2.70600@oracle.com> Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8033534/webrev.01 - The image representations are chosen to be closest to the requested size. Thanks, Alexandr. On 2/4/2014 5:00 PM, Sergey Bylokhov wrote: > Hi, Alexander. > I think that getResolutionVariant should return an image which is > close as much as possible to the requested size. > > On 04.02.2014 16:42, Alexander Scherbatiy wrote: >> >> Hello, >> >> Could you review the fix: >> bug: https://bugs.openjdk.java.net/browse/JDK-8033534 >> webrev: http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 >> >> - The method that gets a sorted array of NSImage representaion pixel >> sizes for the given image size is added >> - A MultiResolution image is created if an NSImage has several >> representations for the given image size >> >> Thanks, >> Alexandr. >> > > From Sergey.Bylokhov at oracle.com Mon Feb 10 05:53:53 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 10 Feb 2014 17:53:53 +0400 Subject: [9] Review Request: 8034068 Label.toString performance improvement Message-ID: <52F8D9F1.6070805@oracle.com> Hello. Please review the quick fix for jdk 9. The code in Label was changed to be a faster and a readable. + small cleanup in Component. Actual change is from: String str = ",align="; switch(alignment) { case 0: str = (new StringBuilder()).append(s).append("left").toString(); break; case 1: str = (new StringBuilder()).append(s).append("center").toString(); break; case 2: str = (new StringBuilder()).append(s).append("right").toString(); break; } return (new StringBuilder()).append(super.paramString()).append(str).append(",text=").append(text).toString(); to String str = ""; switch(alignment) { case 0: str = "left"; break; case 1: str = "center"; break; case 2: str = "right"; break; } return (new StringBuilder()).append(super.paramString()).append(",align=").append(str).append(",text=").append(text).toString(); Bug: https://bugs.openjdk.java.net/browse/JDK-8034068 Webrev can be found at: http://cr.openjdk.java.net/~serb/8034068/webrev.00 -- Best regards, Sergey. From anton.tarasov at oracle.com Mon Feb 10 06:11:54 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Mon, 10 Feb 2014 18:11:54 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52F580C1.3020906@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> Message-ID: <52F8DE2A.4080304@oracle.com> Hi Jim! On 08.02.2014 4:56, Jim Graham wrote: > Hi Anton, > > In CPlatformLWWindow.java, why does it have to search for the right device when it was created > with/from a Window object that should already know the right device? As I wrote before, JLF doesn't have any platform window behind (it's a trully lightweight frame). That's why we can't simply get an associated device and need some heuristic... > > SG2D, line 2114 - I think TRANSFORM_SCALE allows negative scale factors so I think you need a > little more protection from the transform call reversing the rectangle. Ok, I'll elaborate on it. > > Otherwise, I didn't spot any other issues... Glad to hear that :) > > On 2/3/14 6:36 AM, Anton V. Tarasov wrote: >> In SG2D, the drawHiDPIImage, for instance, makes a call to >> op.filter(img, null); where the img is expected to return its layout >> size. That's why I still prefer to use the setReturnLayoutSize >> "switcher", in order not to go deep into the 2D rendering code, casting >> here and there to OffscreenImage and calling getLayoutWidth/Height. > > Would we expect one of these images to have the BufferedImageOp version of drawImage be used on > it? (It could happen if we ever leak the object into developers hands, but I'm not sure if that > can happen or not - I'm pretty sure we don't use those Ops internally ourselves, do we?) We don't use it internally. Originally, I had an option in the fix with which a developer could create a HiDPI BufferedImage. Then, I implemented the last SG2D.drawImage method which didn't have hidpi support, and created a 2D test for it. In the test I drew some 2D primitives into a HiDPI image, using a BufferedImageOp transform. So, I just tested the ability to use it externally. In the current version of the fix there's no option to get a HiDPI image from the outside, so this code is not really used. I can eliminate it if we think we don't need it in the nearest future. Thanks, Anton. > > ...jim From swpalmer at gmail.com Mon Feb 10 07:05:51 2014 From: swpalmer at gmail.com (Scott Palmer) Date: Mon, 10 Feb 2014 10:05:51 -0500 Subject: [9] Review request for 8033534 Get MultiResolution image from native system In-Reply-To: <52F8D9C2.70600@oracle.com> References: <52F0E01B.3050004@oracle.com> <52F0E466.6040002@oracle.com> <52F8D9C2.70600@oracle.com> Message-ID: Just to be clear, "the image representations are chosen to be closest to the requested size" is not accurate. This change returns the smallest image representation that is greater than or equal to the requested size. (Which I believe is the correct thing to do.) A smaller image representation may be closer to the requested size, but it makes more sense to return a larger image since scaling down to size should produce better results than scaling up. Scott On Mon, Feb 10, 2014 at 8:53 AM, Alexander Scherbatiy < alexandr.scherbatiy at oracle.com> wrote: > > Could you review the updated fix: > http://cr.openjdk.java.net/~alexsch/8033534/webrev.01 > > - The image representations are chosen to be closest to the requested > size. > > Thanks, > Alexandr. > > > On 2/4/2014 5:00 PM, Sergey Bylokhov wrote: > >> Hi, Alexander. >> I think that getResolutionVariant should return an image which is close >> as much as possible to the requested size. >> >> On 04.02.2014 16:42, Alexander Scherbatiy wrote: >> >>> >>> Hello, >>> >>> Could you review the fix: >>> bug: https://bugs.openjdk.java.net/browse/JDK-8033534 >>> webrev: http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 >>> >>> - The method that gets a sorted array of NSImage representaion pixel >>> sizes for the given image size is added >>> - A MultiResolution image is created if an NSImage has several >>> representations for the given image size >>> >>> Thanks, >>> Alexandr. >>> >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140210/a8359c3b/attachment.html From anthony.petrov at oracle.com Mon Feb 10 09:17:10 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Mon, 10 Feb 2014 21:17:10 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52F50739.7090003@oracle.com> References: <52E708C3.4070803@oracle.com> <52F42952.3080303@oracle.com> <52F4F23B.6060604@oracle.com> <52F50739.7090003@oracle.com> Message-ID: <52F90996.4050800@oracle.com> Thanks for the clarifications. Note that given that we re-create the EDT if there are more events in the queue, I'm still unsure whether we regress or not. I recall there was a patch submitted on this mailing list a few years ago that made the EDT die unconditionally and never be resurrected if it's requested to die. So I'm afraid the code that relies on this behavior will stop working correctly after your fix because you will re-create the EDT for all remaining events. What tests did you run with your fix? -- best regards, Anthony On 2/7/2014 8:18 PM, Oleg Pekhovskiy wrote: > Hi Anthony, > > there are two points for choosing this solution: > 1. If something makes EDT to die, there is a serious reason to do so. > It's a forced action. > So it should be done ASAP. Dying EDT usage for pumping followed events > looks strange because we expect him to die. > Moreover it could happen that events are posted quite frequently to keep > dying EDT alive for some period of time. > > 2. Synchronization object for posting events from different threads is > EventQueue.pushPopLock. > it is used in EventQueue. postEventPrivate(), EventQueue.getNextEvent() > and EventQueue. detachDispatchThread(). > When dying EDT returns from EventDispatchThread.pumpEventsForFilter() to > EventDispatchThread.run() and then goes to > getEventQueue().detachDispatchThread(), EventQueue.pushPopLock is not > used, so any other thread could post events. > So if we don't call peekEvent() to recreate a new EDT, we'll just loose > these events as it currently happens. > > So the main idea is to make EDT life cycle phases obvious. > > Thanks, > Oleg > > On 02/07/2014 06:48 PM, Anthony Petrov wrote: >> Hi Oleg, >> >> This code is very tricky. I like it that we process any events that >> might be posted to the queue after the current EDT dies. However, >> could you please clarify how initializing a new EDT is any different >> from not letting the old one die? I.e. could we just not kill the old >> EDT if we see there are more events in the queue? If not, what exact >> difference does you solution bring? >> >> It's not that I'm against your fix, it looks good actually. I'd just >> like to understand the difference. Please elaborate. >> Also, I recall we've fixed a number of bugs in this area. Are we sure >> we don't regress after this fix? >> >> -- >> best regards, >> Anthony >> >> On 2/7/2014 4:31 AM, Oleg Pekhovskiy wrote: >>> Hi all, >>> >>> please review the next version of fix: >>> http://cr.openjdk.java.net/~bagiras/8031694.2/ >>> >>> We with Artem Ananiev had off-line discussion and he offered let the >>> dying EDT to die >>> and process unhandled events by forcing another EDT start. >>> >>> Thanks, >>> Oleg >>> >>> On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: >>>> Hi all, >>>> >>>> please review the fix >>>> http://cr.openjdk.java.net/~bagiras/8031694.1/ >>>> for >>>> https://bugs.openjdk.java.net/browse/JDK-8031694 >>>> >>>> During forward-port of JDK-7189350 EDT.doDispatch was not taken into >>>> account when calling EventQueue.detachDispatchThread(). >>>> As a result harmful optimization of this method occurred. >>>> So when doDispatch became false, no more events in QventQueue were >>>> handled before EDT shutdown. >>>> I kept the optimization but added the check to >>>> EDT.pumpEventsForFilter() that EventQueue is not empty to keep pumping. >>>> >>>> Thanks, >>>> Oleg >>> > From anthony.petrov at oracle.com Mon Feb 10 09:25:12 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Mon, 10 Feb 2014 21:25:12 +0400 Subject: [9] Review Request: 8034068 Label.toString performance improvement In-Reply-To: <52F8D9F1.6070805@oracle.com> References: <52F8D9F1.6070805@oracle.com> Message-ID: <52F90B78.8030702@oracle.com> Looks okay. How faster does the Label work now, btw? :) -- best regards, Anthony On 2/10/2014 5:53 PM, Sergey Bylokhov wrote: > Hello. > Please review the quick fix for jdk 9. > The code in Label was changed to be a faster and a readable. + small > cleanup in Component. > > Actual change is from: > String str = ",align="; > switch(alignment) { > case 0: str = (new > StringBuilder()).append(s).append("left").toString(); break; > case 1: str = (new > StringBuilder()).append(s).append("center").toString(); break; > case 2: str = (new > StringBuilder()).append(s).append("right").toString(); break; > } > return (new > StringBuilder()).append(super.paramString()).append(str).append(",text=").append(text).toString(); > > to > String str = ""; > switch(alignment) { > case 0: str = "left"; break; > case 1: str = "center"; break; > case 2: str = "right"; break; > } > return (new > StringBuilder()).append(super.paramString()).append(",align=").append(str).append(",text=").append(text).toString(); > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8034068 > Webrev can be found at: http://cr.openjdk.java.net/~serb/8034068/webrev.00 > From joe.darcy at oracle.com Mon Feb 10 09:40:46 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 10 Feb 2014 09:40:46 -0800 Subject: JDK 9 RFR of JDK-8033712: Fix more serial lint warnings in sun.awt In-Reply-To: <52F378B6.4030100@oracle.com> References: <52F28B43.4070005@oracle.com> <52F378B6.4030100@oracle.com> Message-ID: <52F90F1E.1030702@oracle.com> Hi Sergey, Some of the files I've modified have changed in the client repo since I generated my initial patch; I'll send out a revised webrev shortly. Thanks, -Joe On 02/06/2014 03:57 AM, Sergey Bylokhov wrote: > Hi, Joe. > In WScrollPanePeer.java @SuppressWarnings("serial") should be applied > to ScrollEvent. > In WPrinterJob.java it should be applied to PrintToFileErrorDialog. > > On 05.02.2014 23:04, Joe Darcy wrote: >> Hello, >> >> Please review my patch to fix the serial warnings in >> platform-specific code in the sun.awt package: >> >> JDK-8033712: Fix more serial lint warnings in sun.awt >> http://cr.openjdk.java.net/~darcy/8033712.0/ >> >> Thanks, >> >> -Joe > > From gnu.andrew at redhat.com Mon Feb 10 09:43:38 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Mon, 10 Feb 2014 12:43:38 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <52F4D650.8020301@oracle.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> Message-ID: <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> ----- Original Message ----- > On 2014-02-05 16:15, Omair Majid wrote: > > * Andrew Hughes [2014-02-04 19:26]: > >>> On 2014-02-03 18:43, Omair Majid wrote: > >>>> The following webrevs modify the build system to allow building against > >>>> the system-installed copy of libpng as well as using the bundled copy of > >>>> libpng > >>>> > >>>> ROOT: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01/ > >>>> JDK: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/01-jdk/ > >>>> > >>>> A new configure option `--with-libpng` is introduced which defaults to > >>>> `bundled` but can be set to `system` to use the system-installed copy of > >>>> libpng. > >> In this respect, why does this not just use AC_ARG_ENABLE as there are > >> only > >> two options here (system libpng or bundled libpng)? > >> > >> Also, this patch hardcodes the libpng cflags and ldflags when these should > >> be obtained from pkg-config. This is how these values are obtained in > >> IcedTea > >> and using this patch would thus be a regression. > > The answer to both of these is the same: I followed how the existing code > > handles zlib. If this needs fixing, then it needs to be fixed in the > > other cases (zlib and giflib) too. > > I agree with your thinking here. Following the existing patterns is > good. If they should be extended with using pkg-config (which probably > is a good idea), then that should extend to all these libraries. You're already using it: PKG_CHECK_MODULES([LIBFFI], [libffi]) Why that's in LIB_SETUP_STATIC_LINK_LIBSTDCPP, I have no idea. > > As an answer to Andrew as to why --with-libX=system/bundle instead of > enable/disable: > * First, the semantics of enable/disable inherited from autoconf is > that enable/disable is about "features", but with is for external > "packages". While this difference is not always applicable, I do think > that external libraries should indeed be specified using --with-X. > * Second, I believe the original intention was to allow for a third > option, --with-libX=, which would point to an location in which the > library is installed, similar to how e.g. --with-alsa works. > Yes, but you don't allow that: AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) so using --with-x is confusing if someone does specify a directory. > So, once again, from a build perspective I believe this is a sound patch. > > /Magnus > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From artem.ananiev at oracle.com Mon Feb 10 12:13:31 2014 From: artem.ananiev at oracle.com (Artem Ananiev) Date: Tue, 11 Feb 2014 00:13:31 +0400 Subject: [9] Review Request: 8034068 Label.toString performance improvement In-Reply-To: <52F90B78.8030702@oracle.com> References: <52F8D9F1.6070805@oracle.com> <52F90B78.8030702@oracle.com> Message-ID: <52F932EB.3040908@oracle.com> On 2/10/2014 9:25 PM, Anthony Petrov wrote: > Looks okay. How faster does the Label work now, btw? :) Earlier today Sergey told it would be about ~20% - AWT Label should be very fast now :) A minor comment from my side. Since we already use ?: in Component.paramString(), we can also use it for !isValid(), visible, and !enabled later in the same method. The resulting line of code won't be very nice (but shouldn't be ugly too), but it will be fast. Thanks, Artem > -- > best regards, > Anthony > > On 2/10/2014 5:53 PM, Sergey Bylokhov wrote: >> Hello. >> Please review the quick fix for jdk 9. >> The code in Label was changed to be a faster and a readable. + small >> cleanup in Component. >> >> Actual change is from: >> String str = ",align="; >> switch(alignment) { >> case 0: str = (new >> StringBuilder()).append(s).append("left").toString(); break; >> case 1: str = (new >> StringBuilder()).append(s).append("center").toString(); break; >> case 2: str = (new >> StringBuilder()).append(s).append("right").toString(); break; >> } >> return (new >> StringBuilder()).append(super.paramString()).append(str).append(",text=").append(text).toString(); >> >> >> to >> String str = ""; >> switch(alignment) { >> case 0: str = "left"; break; >> case 1: str = "center"; break; >> case 2: str = "right"; break; >> } >> return (new >> StringBuilder()).append(super.paramString()).append(",align=").append(str).append(",text=").append(text).toString(); >> >> >> >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8034068 >> Webrev can be found at: >> http://cr.openjdk.java.net/~serb/8034068/webrev.00 >> From Sergey.Bylokhov at oracle.com Mon Feb 10 13:14:32 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 11 Feb 2014 01:14:32 +0400 Subject: [9] Review Request: 8034068 Label.toString performance improvement In-Reply-To: <52F932EB.3040908@oracle.com> References: <52F8D9F1.6070805@oracle.com> <52F90B78.8030702@oracle.com> <52F932EB.3040908@oracle.com> Message-ID: <52F94138.3070303@oracle.com> On 11.02.2014 0:13, Artem Ananiev wrote: > > On 2/10/2014 9:25 PM, Anthony Petrov wrote: >> Looks okay. How faster does the Label work now, btw? :) > > Earlier today Sergey told it would be about ~20% - AWT Label should be > very fast now :) > > A minor comment from my side. Since we already use ?: in > Component.paramString(), we can also use it for !isValid(), visible, > and !enabled later in the same method. The resulting line of code > won't be very nice (but shouldn't be ugly too), but it will be fast. Then it will be simpler to rewrite this method to use StringBuilder directly, it will be 5% additional improvement. > > Thanks, > > Artem > >> -- >> best regards, >> Anthony >> >> On 2/10/2014 5:53 PM, Sergey Bylokhov wrote: >>> Hello. >>> Please review the quick fix for jdk 9. >>> The code in Label was changed to be a faster and a readable. + small >>> cleanup in Component. >>> >>> Actual change is from: >>> String str = ",align="; >>> switch(alignment) { >>> case 0: str = (new >>> StringBuilder()).append(s).append("left").toString(); break; >>> case 1: str = (new >>> StringBuilder()).append(s).append("center").toString(); break; >>> case 2: str = (new >>> StringBuilder()).append(s).append("right").toString(); break; >>> } >>> return (new >>> StringBuilder()).append(super.paramString()).append(str).append(",text=").append(text).toString(); >>> >>> >>> >>> to >>> String str = ""; >>> switch(alignment) { >>> case 0: str = "left"; break; >>> case 1: str = "center"; break; >>> case 2: str = "right"; break; >>> } >>> return (new >>> StringBuilder()).append(super.paramString()).append(",align=").append(str).append(",text=").append(text).toString(); >>> >>> >>> >>> >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8034068 >>> Webrev can be found at: >>> http://cr.openjdk.java.net/~serb/8034068/webrev.00 >>> -- Best regards, Sergey. From james.graham at oracle.com Mon Feb 10 15:37:49 2014 From: james.graham at oracle.com (Jim Graham) Date: Mon, 10 Feb 2014 15:37:49 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52F8DE2A.4080304@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> Message-ID: <52F962CD.2050301@oracle.com> On 2/10/14 6:11 AM, Anton V. Tarasov wrote: >> On 2/3/14 6:36 AM, Anton V. Tarasov wrote: >>> In SG2D, the drawHiDPIImage, for instance, makes a call to >>> op.filter(img, null); where the img is expected to return its layout >>> size. That's why I still prefer to use the setReturnLayoutSize >>> "switcher", in order not to go deep into the 2D rendering code, casting >>> here and there to OffscreenImage and calling getLayoutWidth/Height. >> >> Would we expect one of these images to have the BufferedImageOp >> version of drawImage be used on it? (It could happen if we ever leak >> the object into developers hands, but I'm not sure if that can happen >> or not - I'm pretty sure we don't use those Ops internally ourselves, >> do we?) > > We don't use it internally. Originally, I had an option in the fix with > which a developer could create a HiDPI BufferedImage. Then, I > implemented the last SG2D.drawImage method which didn't have hidpi > support, and created a 2D test for it. In the test I drew some 2D > primitives into a HiDPI image, using a BufferedImageOp transform. So, I > just tested the ability to use it externally. > > In the current version of the fix there's no option to get a HiDPI image > from the outside, so this code is not really used. I can eliminate it if > we think we don't need it in the nearest future. It might make sense to leave it in for now. I'm not happy with that design conceptually in the long term, but I don't think there is a 100% pure/simple/obvious solution to the issues we are facing and it's not really hurting anything in the short term... ...jim From james.graham at oracle.com Mon Feb 10 16:12:18 2014 From: james.graham at oracle.com (Jim Graham) Date: Mon, 10 Feb 2014 16:12:18 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52F962CD.2050301@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> Message-ID: <52F96AE2.10106@oracle.com> Just out of curiosity, on a Mac there is support for @2x images where they get loaded and used (at half scale to preserve layout size) automatically for you. In that respect, the added resolution is hidden from the regular APIs and the developer doesn't really have to deal with the meaning of "size" as it relates to HiDPI. But, when you buy into HiDPI for your rendering, it looks like their system requires you to ask them to calculate the proper extents for the back buffer to render it and you are supposed to render it into that rectangle (FX is calling convertRectToBacking and then using the bounds to control the eventual blit of the back buffers). If that is the case, then it looks like we have some precedence there to have them buy into HiDPI backing stores or compatible images where the images report their pixel sizes and they need to manage the display size directly (i.e. by using drawImage(x,y,w,h) as we do internally). I think we could make it a little more friendly than their "convertRectToBacking" system, but it would mean we wouldn't have to pollute the getWidth/Height APIs with conditional return values. For example, if we added getLayoutWH() or getScaleFactor() to image or bimg, then the normal ways of constructing those objects would simply return objects where the answers were unscaled and unsurprising. If they went out of their way to request one that was scaled, then those new APIs (available on all images, but not very interesting except on the specially constructed DPI-aware versions) would have new values to help them manage the scaled image. Unaware code would simply see these as overly large images, but it would be up to the developer to manage hiding any HiDPI images from any code that they had not converted to be DPI aware (just as we are doing here with our internal Swing buffer). One thing to keep in mind, though, is that Windows appears to allow non-integer scales so I think we should not assume integer scale factors in whatever new API we create... ...jim On 2/10/14 3:37 PM, Jim Graham wrote: > > > On 2/10/14 6:11 AM, Anton V. Tarasov wrote: >>> On 2/3/14 6:36 AM, Anton V. Tarasov wrote: >>>> In SG2D, the drawHiDPIImage, for instance, makes a call to >>>> op.filter(img, null); where the img is expected to return its layout >>>> size. That's why I still prefer to use the setReturnLayoutSize >>>> "switcher", in order not to go deep into the 2D rendering code, casting >>>> here and there to OffscreenImage and calling getLayoutWidth/Height. >>> >>> Would we expect one of these images to have the BufferedImageOp >>> version of drawImage be used on it? (It could happen if we ever leak >>> the object into developers hands, but I'm not sure if that can happen >>> or not - I'm pretty sure we don't use those Ops internally ourselves, >>> do we?) >> >> We don't use it internally. Originally, I had an option in the fix with >> which a developer could create a HiDPI BufferedImage. Then, I >> implemented the last SG2D.drawImage method which didn't have hidpi >> support, and created a 2D test for it. In the test I drew some 2D >> primitives into a HiDPI image, using a BufferedImageOp transform. So, I >> just tested the ability to use it externally. >> >> In the current version of the fix there's no option to get a HiDPI image >> from the outside, so this code is not really used. I can eliminate it if >> we think we don't need it in the nearest future. > > It might make sense to leave it in for now. I'm not happy with that > design conceptually in the long term, but I don't think there is a 100% > pure/simple/obvious solution to the issues we are facing and it's not > really hurting anything in the short term... > > ...jim From dmitry.markov at oracle.com Tue Feb 11 01:46:56 2014 From: dmitry.markov at oracle.com (dmitry markov) Date: Tue, 11 Feb 2014 13:46:56 +0400 Subject: [7u] Review request for 7171045 [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag. Message-ID: <52F9F190.6090503@oracle.com> Hello, Could you review a back-port of 7171045 to JDK 7u, please? The back-port and the main fix integrated into JDK 8 are slightly different. bug: http://bugs.sun.com/view_bug.do?bug_id=7171045 webrev for jdk7u: http://cr.openjdk.java.net/~dmarkov/7171045/jdk7u/webrev.00/ jdk8 changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1 technical review for jdk8: http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003238.html Please note: the fix for 7171045 was partly backported to JDK 7u (see http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003376.html for details). However, some problems related to this case still take place on JDK 7u. So it is necessary to backport full changeset integrated into JDK 8. Thanks, Dmitry From magnus.ihse.bursie at oracle.com Tue Feb 11 02:44:20 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Tue, 11 Feb 2014 11:44:20 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> Message-ID: <52F9FF04.8050204@oracle.com> On 2014-02-10 18:43, Andrew Hughes wrote: > You're already using it: > > PKG_CHECK_MODULES([LIBFFI], [libffi]) > > Why that's in LIB_SETUP_STATIC_LINK_LIBSTDCPP, I have no idea. Because libraries.m4 is in need of a long overdue cleanup. :-( > >> * Second, I believe the original intention was to allow for a third >> option, --with-libX=, which would point to an location in which the >> library is installed, similar to how e.g. --with-alsa works. >> > Yes, but you don't allow that: > > AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) > > so using --with-x is confusing if someone does specify a directory. Yes. As I said, that was the original intention -- not the current implementation. Once again, the code in libraries.m4 is in dire need of some TLC. Getting it in better shape *is* on my agenda, but it tends to be pushed down all the time. So from my point of view, Omair's patch is good. It provides additional value. It does not solve all problems in libraries.m4, nor is it the complete answer on how --with-libpng will behave in the future. But it is a good step on the way. I'm willing to sponsor the patch. But I won't do that if you object to accepting it. (After all, from Oracle's point of view there's no real need for this patch.) I'm also not very much interested in working out this specific patch to perfection, when the whole of libraries.m4 needs so much work. So, it's a bit of "take it or leave it". To be extremely clear: Andrew, do you object to bringing Omairs patch, as it is, into OpenJDK? /Magnus From anton.tarasov at oracle.com Tue Feb 11 10:10:48 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Tue, 11 Feb 2014 22:10:48 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52F96AE2.10106@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> Message-ID: <52FA67A8.1010600@oracle.com> Hi Jim, On 2/11/14 4:12 AM, Jim Graham wrote: > Just out of curiosity, on a Mac there is support for @2x images where > they get loaded and used (at half scale to preserve layout size) > automatically for you. In that respect, the added resolution is > hidden from the regular APIs and the developer doesn't really have to > deal with the meaning of "size" as it relates to HiDPI. > > But, when you buy into HiDPI for your rendering, it looks like their > system requires you to ask them to calculate the proper extents for > the back buffer to render it and you are supposed to render it into > that rectangle (FX is calling convertRectToBacking and then using the > bounds to control the eventual blit of the back buffers). > > If that is the case, then it looks like we have some precedence there > to have them buy into HiDPI backing stores or compatible images where > the images report their pixel sizes and they need to manage the > display size directly (i.e. by using drawImage(x,y,w,h) as we do > internally). I think we could make it a little more friendly than > their "convertRectToBacking" system, but it would mean we wouldn't > have to pollute the getWidth/Height APIs with conditional return values. > > For example, if we added getLayoutWH() or getScaleFactor() to image or > bimg, then the normal ways of constructing those objects would simply > return objects where the answers were unscaled and unsurprising. If > they went out of their way to request one that was scaled, then those > new APIs (available on all images, but not very interesting except on > the specially constructed DPI-aware versions) would have new values to > help them manage the scaled image. Unaware code would simply see > these as overly large images, but it would be up to the developer to > manage hiding any HiDPI images from any code that they had not > converted to be DPI aware (just as we are doing here with our internal > Swing buffer). Ok, you're still against those "conditional return values" :) I already tried to convey my thoughts describing the reason why I couldn't simply throw them away. But Ok, let's do it eventually, then look at the new version and judge it... > > One thing to keep in mind, though, is that Windows appears to allow > non-integer scales so I think we should not assume integer scale > factors in whatever new API we create... I just sticked to the type of the scale factor returned by SurfaceData.getDefaultScale() which was int. Thanks, Anton. > > ...jim > > On 2/10/14 3:37 PM, Jim Graham wrote: >> >> >> On 2/10/14 6:11 AM, Anton V. Tarasov wrote: >>>> On 2/3/14 6:36 AM, Anton V. Tarasov wrote: >>>>> In SG2D, the drawHiDPIImage, for instance, makes a call to >>>>> op.filter(img, null); where the img is expected to return its layout >>>>> size. That's why I still prefer to use the setReturnLayoutSize >>>>> "switcher", in order not to go deep into the 2D rendering code, >>>>> casting >>>>> here and there to OffscreenImage and calling getLayoutWidth/Height. >>>> >>>> Would we expect one of these images to have the BufferedImageOp >>>> version of drawImage be used on it? (It could happen if we ever leak >>>> the object into developers hands, but I'm not sure if that can happen >>>> or not - I'm pretty sure we don't use those Ops internally ourselves, >>>> do we?) >>> >>> We don't use it internally. Originally, I had an option in the fix with >>> which a developer could create a HiDPI BufferedImage. Then, I >>> implemented the last SG2D.drawImage method which didn't have hidpi >>> support, and created a 2D test for it. In the test I drew some 2D >>> primitives into a HiDPI image, using a BufferedImageOp transform. So, I >>> just tested the ability to use it externally. >>> >>> In the current version of the fix there's no option to get a HiDPI >>> image >>> from the outside, so this code is not really used. I can eliminate >>> it if >>> we think we don't need it in the nearest future. >> >> It might make sense to leave it in for now. I'm not happy with that >> design conceptually in the long term, but I don't think there is a 100% >> pure/simple/obvious solution to the issues we are facing and it's not >> really hurting anything in the short term... >> >> ...jim From james.graham at oracle.com Tue Feb 11 11:45:17 2014 From: james.graham at oracle.com (Jim Graham) Date: Tue, 11 Feb 2014 11:45:17 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52FA67A8.1010600@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> <52FA67A8.1010600@oracle.com> Message-ID: <52FA7DCD.80405@oracle.com> Hi Anton, These comments are about future public API, but this current patch is about getting the mechanism working behind the scenes. I'm OK with proceeding with the current patch as it is (modulo the review feedback I gave) to get the mechanism working for the basic back buffer behind the scenes, but we will eventually want the applications to be able to create their own HiDPI intermediate buffers in addition to the back buffer that we manage for them - and these comments below are about how we eventually expose this mechanism to them in a future stage... ...jim On 2/11/14 10:10 AM, Anton V. Tarasov wrote: > Hi Jim, > > On 2/11/14 4:12 AM, Jim Graham wrote: >> Just out of curiosity, on a Mac there is support for @2x images where >> they get loaded and used (at half scale to preserve layout size) >> automatically for you. In that respect, the added resolution is >> hidden from the regular APIs and the developer doesn't really have to >> deal with the meaning of "size" as it relates to HiDPI. >> >> But, when you buy into HiDPI for your rendering, it looks like their >> system requires you to ask them to calculate the proper extents for >> the back buffer to render it and you are supposed to render it into >> that rectangle (FX is calling convertRectToBacking and then using the >> bounds to control the eventual blit of the back buffers). >> >> If that is the case, then it looks like we have some precedence there >> to have them buy into HiDPI backing stores or compatible images where >> the images report their pixel sizes and they need to manage the >> display size directly (i.e. by using drawImage(x,y,w,h) as we do >> internally). I think we could make it a little more friendly than >> their "convertRectToBacking" system, but it would mean we wouldn't >> have to pollute the getWidth/Height APIs with conditional return values. >> >> For example, if we added getLayoutWH() or getScaleFactor() to image or >> bimg, then the normal ways of constructing those objects would simply >> return objects where the answers were unscaled and unsurprising. If >> they went out of their way to request one that was scaled, then those >> new APIs (available on all images, but not very interesting except on >> the specially constructed DPI-aware versions) would have new values to >> help them manage the scaled image. Unaware code would simply see >> these as overly large images, but it would be up to the developer to >> manage hiding any HiDPI images from any code that they had not >> converted to be DPI aware (just as we are doing here with our internal >> Swing buffer). > > Ok, you're still against those "conditional return values" :) I already > tried to convey my thoughts describing the reason why I couldn't simply > throw them away. But Ok, let's do it eventually, then look at the new > version and judge it... > >> >> One thing to keep in mind, though, is that Windows appears to allow >> non-integer scales so I think we should not assume integer scale >> factors in whatever new API we create... > > I just sticked to the type of the scale factor returned by > SurfaceData.getDefaultScale() which was int. > > Thanks, > Anton. >> >> ...jim >> >> On 2/10/14 3:37 PM, Jim Graham wrote: >>> >>> >>> On 2/10/14 6:11 AM, Anton V. Tarasov wrote: >>>>> On 2/3/14 6:36 AM, Anton V. Tarasov wrote: >>>>>> In SG2D, the drawHiDPIImage, for instance, makes a call to >>>>>> op.filter(img, null); where the img is expected to return its layout >>>>>> size. That's why I still prefer to use the setReturnLayoutSize >>>>>> "switcher", in order not to go deep into the 2D rendering code, >>>>>> casting >>>>>> here and there to OffscreenImage and calling getLayoutWidth/Height. >>>>> >>>>> Would we expect one of these images to have the BufferedImageOp >>>>> version of drawImage be used on it? (It could happen if we ever leak >>>>> the object into developers hands, but I'm not sure if that can happen >>>>> or not - I'm pretty sure we don't use those Ops internally ourselves, >>>>> do we?) >>>> >>>> We don't use it internally. Originally, I had an option in the fix with >>>> which a developer could create a HiDPI BufferedImage. Then, I >>>> implemented the last SG2D.drawImage method which didn't have hidpi >>>> support, and created a 2D test for it. In the test I drew some 2D >>>> primitives into a HiDPI image, using a BufferedImageOp transform. So, I >>>> just tested the ability to use it externally. >>>> >>>> In the current version of the fix there's no option to get a HiDPI >>>> image >>>> from the outside, so this code is not really used. I can eliminate >>>> it if >>>> we think we don't need it in the nearest future. >>> >>> It might make sense to leave it in for now. I'm not happy with that >>> design conceptually in the long term, but I don't think there is a 100% >>> pure/simple/obvious solution to the issues we are facing and it's not >>> really hurting anything in the short term... >>> >>> ...jim > From oleg.pekhovskiy at oracle.com Tue Feb 11 14:46:50 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Wed, 12 Feb 2014 02:46:50 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52F90996.4050800@oracle.com> References: <52E708C3.4070803@oracle.com> <52F42952.3080303@oracle.com> <52F4F23B.6060604@oracle.com> <52F50739.7090003@oracle.com> <52F90996.4050800@oracle.com> Message-ID: <52FAA85A.9060408@oracle.com> Hi Anthony, I ran only java/awt/EventDispatchThread java/awt/EventQueue and the same from closed. No difference found. It would be great if you propose some other tests that could be sensitive to the fix. Thanks, Oleg On 10.02.2014 21:17, Anthony Petrov wrote: > Thanks for the clarifications. Note that given that we re-create the EDT > if there are more events in the queue, I'm still unsure whether we > regress or not. I recall there was a patch submitted on this mailing > list a few years ago that made the EDT die unconditionally and never be > resurrected if it's requested to die. So I'm afraid the code that relies > on this behavior will stop working correctly after your fix because you > will re-create the EDT for all remaining events. > > What tests did you run with your fix? > > -- > best regards, > Anthony > > On 2/7/2014 8:18 PM, Oleg Pekhovskiy wrote: >> Hi Anthony, >> >> there are two points for choosing this solution: >> 1. If something makes EDT to die, there is a serious reason to do so. >> It's a forced action. >> So it should be done ASAP. Dying EDT usage for pumping followed events >> looks strange because we expect him to die. >> Moreover it could happen that events are posted quite frequently to keep >> dying EDT alive for some period of time. >> >> 2. Synchronization object for posting events from different threads is >> EventQueue.pushPopLock. >> it is used in EventQueue. postEventPrivate(), EventQueue.getNextEvent() >> and EventQueue. detachDispatchThread(). >> When dying EDT returns from EventDispatchThread.pumpEventsForFilter() to >> EventDispatchThread.run() and then goes to >> getEventQueue().detachDispatchThread(), EventQueue.pushPopLock is not >> used, so any other thread could post events. >> So if we don't call peekEvent() to recreate a new EDT, we'll just loose >> these events as it currently happens. >> >> So the main idea is to make EDT life cycle phases obvious. >> >> Thanks, >> Oleg >> >> On 02/07/2014 06:48 PM, Anthony Petrov wrote: >>> Hi Oleg, >>> >>> This code is very tricky. I like it that we process any events that >>> might be posted to the queue after the current EDT dies. However, >>> could you please clarify how initializing a new EDT is any different >>> from not letting the old one die? I.e. could we just not kill the old >>> EDT if we see there are more events in the queue? If not, what exact >>> difference does you solution bring? >>> >>> It's not that I'm against your fix, it looks good actually. I'd just >>> like to understand the difference. Please elaborate. >>> Also, I recall we've fixed a number of bugs in this area. Are we sure >>> we don't regress after this fix? >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/7/2014 4:31 AM, Oleg Pekhovskiy wrote: >>>> Hi all, >>>> >>>> please review the next version of fix: >>>> http://cr.openjdk.java.net/~bagiras/8031694.2/ >>>> >>>> We with Artem Ananiev had off-line discussion and he offered let the >>>> dying EDT to die >>>> and process unhandled events by forcing another EDT start. >>>> >>>> Thanks, >>>> Oleg >>>> >>>> On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: >>>>> Hi all, >>>>> >>>>> please review the fix >>>>> http://cr.openjdk.java.net/~bagiras/8031694.1/ >>>>> for >>>>> https://bugs.openjdk.java.net/browse/JDK-8031694 >>>>> >>>>> During forward-port of JDK-7189350 EDT.doDispatch was not taken into >>>>> account when calling EventQueue.detachDispatchThread(). >>>>> As a result harmful optimization of this method occurred. >>>>> So when doDispatch became false, no more events in QventQueue were >>>>> handled before EDT shutdown. >>>>> I kept the optimization but added the check to >>>>> EDT.pumpEventsForFilter() that EventQueue is not empty to keep >>>>> pumping. >>>>> >>>>> Thanks, >>>>> Oleg >>>> >> From konstantin.shefov at oracle.com Tue Feb 11 23:50:10 2014 From: konstantin.shefov at oracle.com (Konstantin Shefov) Date: Wed, 12 Feb 2014 11:50:10 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52F880D7.3080804@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> <52F393C1.7080702@oracle.com> <52F39437.6010307@oracle.com> <52F880D7.3080804@oracle.com> Message-ID: <52FB27B2.7070109@oracle.com> Reminder On 10-Feb-14 11:33, Konstantin Shefov wrote: > Please, review this test fix. > The test blocks automated test execution, so should be fixed. > > Thanks > -Konstantin > > On 06-Feb-14 17:55, Sergey Bylokhov wrote: >> Thanks. >> Then the fix looks good. >> >> On 06.02.2014 17:53, Konstantin Shefov wrote: >>> >>> On 06-Feb-14 17:49, Konstantin Shefov wrote: >>>> Sergey, >>>> This System.exit will never be seen by jtreg, more than that, this >>>> test already has system.exit and will not work without it. >>> System.exit is invoked by child vm, child vm is NOT controlled by >>> JTREG at all. >>>> >>>> Konstantin >>>> >>>> On 06-Feb-14 17:21, Sergey Bylokhov wrote: >>>>> Hi, Konstantin. >>>>> The tests should not use System.exit() , it can be forbidden in >>>>> some modes of jtreg. >>>>> >>>>> On 06.02.2014 17:03, Konstantin Shefov wrote: >>>>>> Hi all, >>>>>> >>>>>> please review the fix >>>>>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>>>>> for >>>>>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>>>>> >>>>>> Test hangs on windows if test frames are covered by a window of >>>>>> some other app. >>>>>> >>>>>> Thanks, >>>>>> Konstantin >>>>> >>>>> >>>> >>> >> >> > From michael.cui at oracle.com Wed Feb 12 04:59:37 2014 From: michael.cui at oracle.com (michael cui) Date: Wed, 12 Feb 2014 20:59:37 +0800 Subject: RFR for JDK-8028711: TEST_BUG: Tests should pass through VM options: corelibs tests In-Reply-To: <52F89D96.7000601@oracle.com> References: <52E4C2E8.1060605@oracle.com> <52E4D1F2.4030406@oracle.com> <52E5B4C3.6080405@oracle.com> <52F455FC.3020009@oracle.com> <52F4BD7B.8080006@oracle.com> <52F87906.5040702@oracle.com> <52F89D96.7000601@oracle.com> Message-ID: <52FB7039.3060907@oracle.com> On 02/10/2014 05:36 PM, Alan Bateman wrote: > A minor comment on test/java/net/URLPermission/nstest/lookup.sh is > that the resulting line length is 182 characters and this will likely > be annoying for future side-by-side views. So I think I'd split this > while you are there. Please review the updated version at http://cr.openjdk.java.net/~tyan/michael/JDK-8028711/webrev.04/ Changes includes : 1. split line if it longer than 80 characters. 2. merge the fix of JDK-8033897 3. add few missed scripts. If no further changes need to be made, I would like to find sponsor to push this fix. Michael Cui -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140212/af29fb01/attachment.html From artem.ananiev at oracle.com Wed Feb 12 04:58:30 2014 From: artem.ananiev at oracle.com (Artem Ananiev) Date: Wed, 12 Feb 2014 16:58:30 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52F90996.4050800@oracle.com> References: <52E708C3.4070803@oracle.com> <52F42952.3080303@oracle.com> <52F4F23B.6060604@oracle.com> <52F50739.7090003@oracle.com> <52F90996.4050800@oracle.com> Message-ID: <52FB6FF6.8010302@oracle.com> On 2/10/2014 9:17 PM, Anthony Petrov wrote: > Thanks for the clarifications. Note that given that we re-create the EDT > if there are more events in the queue, I'm still unsure whether we > regress or not. I recall there was a patch submitted on this mailing > list a few years ago that made the EDT die unconditionally and never be > resurrected if it's requested to die. So I'm afraid the code that relies > on this behavior will stop working correctly after your fix because you > will re-create the EDT for all remaining events. I can barely imagine such a code that kills EDT and expect it to have died forever :) This is a violation of AWT contract, when event dispatching is started as soon as a new event is posted. If applications needs another behavior, it has to make sure no events are posted to AWT event queue. Oleg, webrev .2 looks fine to me. Thanks, Artem > What tests did you run with your fix? > > -- > best regards, > Anthony > > On 2/7/2014 8:18 PM, Oleg Pekhovskiy wrote: >> Hi Anthony, >> >> there are two points for choosing this solution: >> 1. If something makes EDT to die, there is a serious reason to do so. >> It's a forced action. >> So it should be done ASAP. Dying EDT usage for pumping followed events >> looks strange because we expect him to die. >> Moreover it could happen that events are posted quite frequently to keep >> dying EDT alive for some period of time. >> >> 2. Synchronization object for posting events from different threads is >> EventQueue.pushPopLock. >> it is used in EventQueue. postEventPrivate(), EventQueue.getNextEvent() >> and EventQueue. detachDispatchThread(). >> When dying EDT returns from EventDispatchThread.pumpEventsForFilter() to >> EventDispatchThread.run() and then goes to >> getEventQueue().detachDispatchThread(), EventQueue.pushPopLock is not >> used, so any other thread could post events. >> So if we don't call peekEvent() to recreate a new EDT, we'll just loose >> these events as it currently happens. >> >> So the main idea is to make EDT life cycle phases obvious. >> >> Thanks, >> Oleg >> >> On 02/07/2014 06:48 PM, Anthony Petrov wrote: >>> Hi Oleg, >>> >>> This code is very tricky. I like it that we process any events that >>> might be posted to the queue after the current EDT dies. However, >>> could you please clarify how initializing a new EDT is any different >>> from not letting the old one die? I.e. could we just not kill the old >>> EDT if we see there are more events in the queue? If not, what exact >>> difference does you solution bring? >>> >>> It's not that I'm against your fix, it looks good actually. I'd just >>> like to understand the difference. Please elaborate. >>> Also, I recall we've fixed a number of bugs in this area. Are we sure >>> we don't regress after this fix? >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/7/2014 4:31 AM, Oleg Pekhovskiy wrote: >>>> Hi all, >>>> >>>> please review the next version of fix: >>>> http://cr.openjdk.java.net/~bagiras/8031694.2/ >>>> >>>> We with Artem Ananiev had off-line discussion and he offered let the >>>> dying EDT to die >>>> and process unhandled events by forcing another EDT start. >>>> >>>> Thanks, >>>> Oleg >>>> >>>> On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: >>>>> Hi all, >>>>> >>>>> please review the fix >>>>> http://cr.openjdk.java.net/~bagiras/8031694.1/ >>>>> for >>>>> https://bugs.openjdk.java.net/browse/JDK-8031694 >>>>> >>>>> During forward-port of JDK-7189350 EDT.doDispatch was not taken into >>>>> account when calling EventQueue.detachDispatchThread(). >>>>> As a result harmful optimization of this method occurred. >>>>> So when doDispatch became false, no more events in QventQueue were >>>>> handled before EDT shutdown. >>>>> I kept the optimization but added the check to >>>>> EDT.pumpEventsForFilter() that EventQueue is not empty to keep >>>>> pumping. >>>>> >>>>> Thanks, >>>>> Oleg >>>> >> From alexandr.scherbatiy at oracle.com Wed Feb 12 05:59:26 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 12 Feb 2014 17:59:26 +0400 Subject: [9] Review request for 8029339 Custom MultiResolution image support on HiDPI displays In-Reply-To: <52F5782A.9060300@oracle.com> References: <52D51764.8020103@oracle.com> <52DF2F98.3030503@oracle.com> <52F4BCEB.9040702@oracle.com> <52F5782A.9060300@oracle.com> Message-ID: <52FB7E3E.6050000@oracle.com> On 2/8/2014 4:19 AM, Jim Graham wrote: > The primary thing that I was concerned about was the presence of > integers in the API when Windows uses non-integer multiples It would make sense to pass real numbers to the getResolutionVariant() method if the difference between resolution variants sizes is 1. It seems that it is not a common case. > and also what policy they use for choosing scaled images. > > I don't see a mention of taking the current transform into account, > just physical issues like screen DPI and form factor. They talk about > resolution plateaus and in their recommendations section they tell the > developer to use a particular property that tells them the screen > resolution to figure out which image to load if they are loading > manually. There is no discussion about dynamically loading multiple > versions of the image based on a dynamic program-applied transform > factor as is done on MacOS. > > Also, they tell developers to draw images to a specific size rather > than using auto-sizing. That begs the question as to how they > interpret a call to draw an image just using a location in the > presence of various DPI factors. There is an interesting doc that describes how to write DPI-aware Win32 applications: http://msdn.microsoft.com/en-us/library/dd464646%28v=vs.85%29.aspx It is suggested to handle WM_DPICHANGED message, load the graphic that has slightly greater resolution to the current DPI and use StretchBlt to scale down the image. Thanks, Alexandr. > > ...jim > > On 2/7/14 3:00 AM, Alexander Scherbatiy wrote: >> On 1/22/2014 6:40 AM, Jim Graham wrote: >>> Hi Alexander, >>> >>> Before we get too far down the road on this API, I think we understand >>> the way in which MacOS processes multi-resolution images for HiDPI >>> screens, but have we investigated the processes that Windows uses >>> under Windows 8? My impression is that Windows 8 has included a >>> number of new techniques for dealing with the high resolution displays >>> that it will run on in the Windows tablet and mobile industries and >>> that these will also come into play as 4K displays (already available) >>> become more common on the desktop. We should make sure that what we >>> come up with here can provide native compatibility with either >>> platform's policies and standard practices. >>> >>> If you've investigated the MS policies I'd like to see a summary so >>> that we can consider them as we review this API... >> There is the Windows Guidelines for scaling to pixel density: >> http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx >> which says that Windows has automatic resource loading that supports >> three version of images scaling (100%, 140%, and 180%) >> -------------------------------- >> Without scaling, as the pixel density of a display device increases, the >> physical sizes of objects on screen get smaller. >> When UI would otherwise be too small to touch and when text gets too >> small to read, >> Windows scales the system and app UI to one of the following scaling >> plateaus: >> >> 1.0 (100%, no scaling is applied) >> 1.4 (140% scaling) >> 1.8 (180% scaling) >> >> Windows determines which scaling plateau to use based on the physical >> screen size, the screen resolution, the DPI of the screen, and form >> factor. >> >> Use resource loading for bitmap images in the app package For bitmap >> images stored >> in the app package, provide a separate image for each scaling >> factor(100%, 140%, and 180%), >> and name your image files using the "scale" naming convention described >> below. >> Windows loads the right image for the current scale automatically. >> -------------------------------- >> >> The image name convention for the various scales is: >> images/logo.scale-100.png >> images/logo.scale-140.png >> images/logo.scale-180.png >> >> The 'ms-appx:///images/logo.png' uri is used to load the image in an >> application. >> >> If we want to support this in the same way as it is done for Mac OS X >> the WToolkit should return MultiResolution image in case if the >> loaded image has .scale-* qualifiers. >> The Graphics class can request an image with necessary resolution >> from the MultiResolution image. >> >> It seems that nothing should be changed in the MultiResolution >> interface in this case. >> >> Thanks, >> Alexandr. >>> >>> ...jim >>> >>> On 1/14/14 2:54 AM, Alexander Scherbatiy wrote: >>>> >>>> Hello, >>>> >>>> Could you review the fix: >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8029339 >>>> webrev: http://cr.openjdk.java.net/~alexsch/8029339/webrev.00 >>>> >>>> This is a proposal to introduce an API that allows to create a >>>> custom >>>> multi resolution image. >>>> >>>> I. It seems reasonable that the API should provide two basic >>>> operations: >>>> >>>> 1. Get the resolution variant based on the requested image width and >>>> height: >>>> - Image getResolutionVariant(int width, int height) >>>> >>>> Usually the system provides the scale factor which represents the >>>> number of pixels corresponding to each linear unit on the display. >>>> However, it has sense to combine the scale factor and the current >>>> transformations to get the actual image size to be displayed. >>>> >>>> 2. Get all provided resolution variants: >>>> - List getResolutionVariants() >>>> >>>> There are several uses cases: >>>> - Create a new multi-resolution image based on the given >>>> multi-resolution image. >>>> - Pass to the native system the multi-resolution image. For >>>> example, >>>> a use can set to the system the custom multi-resolution cursor. >>>> >>>> II. There are some possible ways where the new API can be added >>>> >>>> 1. java.awt.Image. >>>> >>>> The 2 new methods can be added to the Image class. A user can >>>> override >>>> the getResolutionVariant() and getResolutionVariants() methods to >>>> provide the resolution variants >>>> or there can be default implementations of these methods if a user >>>> puts resolution variants >>>> to the list in the sorted order. >>>> >>>> To check that the image has resolution variants the following >>>> statement can be used: image.getResolutionVariants().size() != 1 >>>> >>>> The disadvantage is that there is an overhead that the Image class >>>> should contain the List object and not all >>>> images can have resolution variants. >>>> >>>> 2. Introduce new MultiResolutionImage interface. >>>> >>>> A user should extend Image class and implement the >>>> MultiResolutionImage interface. >>>> >>>> For example: >>>> --------------------- >>>> public class CustomMultiResolutionImage extends BufferedImage >>>> implements MultiResolutionImage { >>>> >>>> Image highResolutionImage; >>>> >>>> public CustomMultiResolutionImage(BufferedImage baseImage, >>>> BufferedImage highResolutionImage) { >>>> super(baseImage.getWidth(), baseImage.getHeight(), >>>> baseImage.getType()); >>>> this.highResolutionImage = highResolutionImage; >>>> Graphics g = getGraphics(); >>>> g.drawImage(baseImage, 0, 0, null); >>>> g.dispose(); >>>> } >>>> >>>> @Override >>>> public Image getResolutionVariant(int width, int height) { >>>> return ((width <= getWidth() && height <= getHeight())) >>>> ? this : highResolutionImage; >>>> } >>>> >>>> @Override >>>> public List getResolutionVariants() { >>>> return Arrays.asList(this, highResolutionImage); >>>> } >>>> } >>>> --------------------- >>>> >>>> The current fix adds the MultiResolutionImage interface and public >>>> resolution variant rendering hints. >>>> >>>> Thanks, >>>> Alexandr. >>>> >> From gnu.andrew at redhat.com Wed Feb 12 09:47:02 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Wed, 12 Feb 2014 12:47:02 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <52F9FF04.8050204@oracle.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> Message-ID: <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> ----- Original Message ----- > On 2014-02-10 18:43, Andrew Hughes wrote: > > You're already using it: > > > > PKG_CHECK_MODULES([LIBFFI], [libffi]) > > > > Why that's in LIB_SETUP_STATIC_LINK_LIBSTDCPP, I have no idea. > Because libraries.m4 is in need of a long overdue cleanup. :-( > > > >> * Second, I believe the original intention was to allow for a third > >> option, --with-libX=, which would point to an location in which the > >> library is installed, similar to how e.g. --with-alsa works. > >> > > Yes, but you don't allow that: > > > > AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use > > 'system' or 'bundled']) > > > > so using --with-x is confusing if someone does specify a directory. > Yes. As I said, that was the original intention -- not the current > implementation. Once again, the code in libraries.m4 is in dire need of > some TLC. Getting it in better shape *is* on my agenda, but it tends to > be pushed down all the time. > > So from my point of view, Omair's patch is good. It provides additional > value. It does not solve all problems in libraries.m4, nor is it the > complete answer on how --with-libpng will behave in the future. But it > is a good step on the way. I'm willing to sponsor the patch. But I won't > do that if you object to accepting it. (After all, from Oracle's point > of view there's no real need for this patch.) I'm also not very much > interested in working out this specific patch to perfection, when the > whole of libraries.m4 needs so much work. So, it's a bit of "take it or > leave it". > > To be extremely clear: Andrew, do you object to bringing Omairs patch, > as it is, into OpenJDK? > Yes. I can agree with leaving the option format until others are changed too; it would only make things inconsistent to change it. However, I do object to hardcoding "-lpng" into the Makefiles. Even if configure doesn't yet use pkg-config for libpng, it should at least pass LIBPNG_LDFLAGS into the build, so any future alterations don't have to change the JDK makefiles again. I'm not sure this current patch would even work here as pkg-config returns cflags for libpng, which aren't being picked up. I didn't realise this was in such a bad state, given it's new. I haven't had chance to look at it in about a year, as my first priority is 6 & 7. > /Magnus > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From anthony.petrov at oracle.com Wed Feb 12 09:52:55 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Wed, 12 Feb 2014 21:52:55 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52FB6FF6.8010302@oracle.com> References: <52E708C3.4070803@oracle.com> <52F42952.3080303@oracle.com> <52F4F23B.6060604@oracle.com> <52F50739.7090003@oracle.com> <52F90996.4050800@oracle.com> <52FB6FF6.8010302@oracle.com> Message-ID: <52FBB4F7.6000705@oracle.com> Oleg, Artem, thank you for the clarifications. I'm fine with the webrev version .2, too. -- best regards, Anthony On 2/12/2014 4:58 PM, Artem Ananiev wrote: > > On 2/10/2014 9:17 PM, Anthony Petrov wrote: >> Thanks for the clarifications. Note that given that we re-create the EDT >> if there are more events in the queue, I'm still unsure whether we >> regress or not. I recall there was a patch submitted on this mailing >> list a few years ago that made the EDT die unconditionally and never be >> resurrected if it's requested to die. So I'm afraid the code that relies >> on this behavior will stop working correctly after your fix because you >> will re-create the EDT for all remaining events. > > I can barely imagine such a code that kills EDT and expect it to have > died forever :) This is a violation of AWT contract, when event > dispatching is started as soon as a new event is posted. If applications > needs another behavior, it has to make sure no events are posted to AWT > event queue. > > Oleg, > > webrev .2 looks fine to me. > > Thanks, > > Artem > >> What tests did you run with your fix? >> >> -- >> best regards, >> Anthony >> >> On 2/7/2014 8:18 PM, Oleg Pekhovskiy wrote: >>> Hi Anthony, >>> >>> there are two points for choosing this solution: >>> 1. If something makes EDT to die, there is a serious reason to do so. >>> It's a forced action. >>> So it should be done ASAP. Dying EDT usage for pumping followed events >>> looks strange because we expect him to die. >>> Moreover it could happen that events are posted quite frequently to keep >>> dying EDT alive for some period of time. >>> >>> 2. Synchronization object for posting events from different threads is >>> EventQueue.pushPopLock. >>> it is used in EventQueue. postEventPrivate(), EventQueue.getNextEvent() >>> and EventQueue. detachDispatchThread(). >>> When dying EDT returns from EventDispatchThread.pumpEventsForFilter() to >>> EventDispatchThread.run() and then goes to >>> getEventQueue().detachDispatchThread(), EventQueue.pushPopLock is not >>> used, so any other thread could post events. >>> So if we don't call peekEvent() to recreate a new EDT, we'll just loose >>> these events as it currently happens. >>> >>> So the main idea is to make EDT life cycle phases obvious. >>> >>> Thanks, >>> Oleg >>> >>> On 02/07/2014 06:48 PM, Anthony Petrov wrote: >>>> Hi Oleg, >>>> >>>> This code is very tricky. I like it that we process any events that >>>> might be posted to the queue after the current EDT dies. However, >>>> could you please clarify how initializing a new EDT is any different >>>> from not letting the old one die? I.e. could we just not kill the old >>>> EDT if we see there are more events in the queue? If not, what exact >>>> difference does you solution bring? >>>> >>>> It's not that I'm against your fix, it looks good actually. I'd just >>>> like to understand the difference. Please elaborate. >>>> Also, I recall we've fixed a number of bugs in this area. Are we sure >>>> we don't regress after this fix? >>>> >>>> -- >>>> best regards, >>>> Anthony >>>> >>>> On 2/7/2014 4:31 AM, Oleg Pekhovskiy wrote: >>>>> Hi all, >>>>> >>>>> please review the next version of fix: >>>>> http://cr.openjdk.java.net/~bagiras/8031694.2/ >>>>> >>>>> We with Artem Ananiev had off-line discussion and he offered let the >>>>> dying EDT to die >>>>> and process unhandled events by forcing another EDT start. >>>>> >>>>> Thanks, >>>>> Oleg >>>>> >>>>> On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: >>>>>> Hi all, >>>>>> >>>>>> please review the fix >>>>>> http://cr.openjdk.java.net/~bagiras/8031694.1/ >>>>>> for >>>>>> https://bugs.openjdk.java.net/browse/JDK-8031694 >>>>>> >>>>>> During forward-port of JDK-7189350 EDT.doDispatch was not taken into >>>>>> account when calling EventQueue.detachDispatchThread(). >>>>>> As a result harmful optimization of this method occurred. >>>>>> So when doDispatch became false, no more events in QventQueue were >>>>>> handled before EDT shutdown. >>>>>> I kept the optimization but added the check to >>>>>> EDT.pumpEventsForFilter() that EventQueue is not empty to keep >>>>>> pumping. >>>>>> >>>>>> Thanks, >>>>>> Oleg >>>>> >>> From Alan.Bateman at oracle.com Wed Feb 12 10:35:17 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 12 Feb 2014 18:35:17 +0000 Subject: RFR for JDK-8028711: TEST_BUG: Tests should pass through VM options: corelibs tests In-Reply-To: <52FB7039.3060907@oracle.com> References: <52E4C2E8.1060605@oracle.com> <52E4D1F2.4030406@oracle.com> <52E5B4C3.6080405@oracle.com> <52F455FC.3020009@oracle.com> <52F4BD7B.8080006@oracle.com> <52F87906.5040702@oracle.com> <52F89D96.7000601@oracle.com> <52FB7039.3060907@oracle.com> Message-ID: <52FBBEE5.7010302@oracle.com> On 12/02/2014 12:59, michael cui wrote: > On 02/10/2014 05:36 PM, Alan Bateman wrote: >> A minor comment on test/java/net/URLPermission/nstest/lookup.sh is >> that the resulting line length is 182 characters and this will likely >> be annoying for future side-by-side views. So I think I'd split this >> while you are there. > Please review the updated version at > http://cr.openjdk.java.net/~tyan/michael/JDK-8028711/webrev.04/ > > > Changes includes : > > 1. split line if it longer than 80 characters. > 2. merge the fix of JDK-8033897 > > 3. add few missed scripts. > > If no further changes need to be made, I would like to find sponsor to > push this fix. The changes look okay to me. I see you decided to ignore the javac usages but that is okay and can be done another time. Also thanks for fixing lookup.sh. I don't personally mind lines > 80 but that one was >180 which make it difficult to look at side-by-side changes. -Alan. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140212/9716a028/attachment.html From magnus.ihse.bursie at oracle.com Wed Feb 12 14:49:32 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Wed, 12 Feb 2014 23:49:32 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> Message-ID: <52FBFA7C.2020100@oracle.com> On 2014-02-12 18:47, Andrew Hughes wrote: >> To be extremely clear: Andrew, do you object to bringing Omairs patch, >> as it is, into OpenJDK? >> > Yes. Okay then. I'll put a mental note to revisit libpng when cleaning up libraries.m4. Are we in agreement that it should to the following: --with-libpng=bundled | system | and if "system" is selected, it should first check with pkg-config, and only if that fails, try hard-coded values. In any case it should try to compile a short code to see that it works properly. (This is not needed for bundled; that is assumed to be working). /Magnus From omajid at redhat.com Wed Feb 12 14:55:14 2014 From: omajid at redhat.com (Omair Majid) Date: Wed, 12 Feb 2014 17:55:14 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <52FBFA7C.2020100@oracle.com> References: <20140203174327.GA9174@redhat.com> <52EFF100.8000004@oracle.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> Message-ID: <20140212225513.GB6766@redhat.com> Hi, * Magnus Ihse Bursie [2014-02-12 17:49]: > > On 2014-02-12 18:47, Andrew Hughes wrote: > >>To be extremely clear: Andrew, do you object to bringing Omairs patch, > >>as it is, into OpenJDK? > >> > >Yes. > > Okay then. > > I'll put a mental note to revisit libpng when cleaning up > libraries.m4. Assuming that I have the cycles to clean up some stuff, what's the minimal I could get away with (to enable system libpng support)? > Are we in agreement that it should to the following: > --with-libpng=bundled | system | > and if "system" is selected, it should first check with pkg-config, > and only if that fails, try hard-coded values. In any case it should > try to compile a short code to see that it works properly. (This is > not needed for bundled; that is assumed to be working). Would it be sufficient if I updated the patch to use PGK_CHECK_MODULES and simply fail if that doesn't work? I will be happy to implement something more complex if you can sketch it out. Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From james.graham at oracle.com Wed Feb 12 16:42:20 2014 From: james.graham at oracle.com (Jim Graham) Date: Wed, 12 Feb 2014 16:42:20 -0800 Subject: [9] Review request for 8029339 Custom MultiResolution image support on HiDPI displays In-Reply-To: <52FB7E3E.6050000@oracle.com> References: <52D51764.8020103@oracle.com> <52DF2F98.3030503@oracle.com> <52F4BCEB.9040702@oracle.com> <52F5782A.9060300@oracle.com> <52FB7E3E.6050000@oracle.com> Message-ID: <52FC14EC.9080503@oracle.com> On 2/12/14 5:59 AM, Alexander Scherbatiy wrote: > On 2/8/2014 4:19 AM, Jim Graham wrote: >> The primary thing that I was concerned about was the presence of >> integers in the API when Windows uses non-integer multiples > It would make sense to pass real numbers to the > getResolutionVariant() method if the difference between resolution > variants sizes is 1. > It seems that it is not a common case. I was thinking of other API that is related to this, such as the API that queries the scaling factor from a SurfaceManager. I seem to remember some integer return values in that, but Windows might have the answer 1.4 or 1.8, depending on the screen scaling factor that was determined from the UI. In terms of the getResolutionVariant() method here, those non-integer screen scaling factors don't directly impact this API. But, we have some issues with the use of integers there from other sources: - That API assumes that the caller will determine the pixel size needed, but the actual media choice is determined with different techniques on Mac and Windows so this means that the caller will have to worry about platform conventions. Is that the right tradeoff? - The technique recommended for Mac involves computing the precise size desired using the current transform, which may be a floating point value, so the integer values used in this API are already approximations and there is no documentation on how to generate the proper integer. In particular, the current code in SG2D naively uses a cast to integer to determine the values to supply which means a transformed size of W+0.5 will be truncated to W and the lower resolution image will be used. Does that conform to Mac guidelines? Do they require the truncated size to reach W+1 before the next size is used? Passing in float or double values would sidestep all of that since then the comparisons would be done with full precision, but as long as we can determine a "best practices compatible with all platforms" rule on how to round to integers, then integers are OK there. - The Windows document you cite below suggests that the determination should be made by looking at the Screen DPI and choosing the next higher media variant based on that screen DPI. They do not specify choosing media based on the current transform as is done for Mac. If we stick with supplying values that are used to determine which media to use, then on Windows we should not take the transform into account, but instead query the SurfaceManager for the scale factor and only transform by those values (even if the current transform was manually overridden to identity). There are pros and cons to both approaches. Mac ensures that you are always using the best media for any given render operation. But, Windows ensure more consistency in the face of other scaling. The thing to consider is that if you have a 500x500 image with a 1000x1000 variant and you rendering it at 500x500 and then 501x501, that first jump will be fairly jarring as the scaled version of the 1000x1000 will not look precisely like the original 500x500 did. With @2x images only, this effect is minimized so the advantage of always using "the best media for a given render operation" may outweigh the inconsistency issue. But, on Windows where the media are 1.4x or 1.8x in size, a downscaled image will start to show more interpolation noise and so the balance of the two choices may shift more towards not wanting a jarring shift. We might want one or more of the following: - Developer chooses policy (TX_AWARE, DPI_AWARE, ALWAYS_LARGEST, NONE, PLATFORM) where the last policy would use TX_AWARE on Mac and DPI_AWARE on Windows - We create our own policy and always use it (TX_AWARE? or DPI_AWARE?) - We create our own policy that dynamically chooses one of the above strategies depending on platform or available media or ??? - We could create an optional interface for them to install their own algorithm as well. I think it would work best as a delegate interface that one installs into Image so that it can be used with any image without having to subclass (it wouldn't really have much to do for BufferedImages or VolatileImages, though): class Image { void setResolutionHelper(ImageResolutionHelper foo); List getResolutionVariants(); } or: class Graphics { void setResolutionHelper(ImageResolutionHelper foo); } or - anywhere else it could be installed more centrally (per App context)? and the interface would be something like one of these variants: interface ImageResolutionHelper { // This version would prevent substituting a random image: // They have to return an index into the List for that image... public int chooseVariant(Image img, double dpi, number w, number h); or: // This version would allow substituting an arbitrary image: public Image getVariant(Image img, double dpi, number w, number h); } Since they would be in full control of the policy, though, we would unfortunately always have to call this, there would be no more testing in SG2D to see "if" we need to deal with DPI, though perhaps we could document some internal conditions in which we do not call it for common cases (but that would have to be well agreed not to get in the way of reasonable uses of the API and well documented)? Note that we would have to do a security audit to make sure that random image substitution couldn't allow any sort of "screen phishing" exploit. ...jim >> and also what policy they use for choosing scaled images. >> >> I don't see a mention of taking the current transform into account, >> just physical issues like screen DPI and form factor. They talk about >> resolution plateaus and in their recommendations section they tell the >> developer to use a particular property that tells them the screen >> resolution to figure out which image to load if they are loading >> manually. There is no discussion about dynamically loading multiple >> versions of the image based on a dynamic program-applied transform >> factor as is done on MacOS. >> >> Also, they tell developers to draw images to a specific size rather >> than using auto-sizing. That begs the question as to how they >> interpret a call to draw an image just using a location in the >> presence of various DPI factors. > There is an interesting doc that describes how to write DPI-aware > Win32 applications: > http://msdn.microsoft.com/en-us/library/dd464646%28v=vs.85%29.aspx > It is suggested to handle WM_DPICHANGED message, load the graphic > that has slightly greater resolution to the current DPI and use StretchBlt > to scale down the image. > > Thanks, > Alexandr. > >> >> ...jim >> >> On 2/7/14 3:00 AM, Alexander Scherbatiy wrote: >>> On 1/22/2014 6:40 AM, Jim Graham wrote: >>>> Hi Alexander, >>>> >>>> Before we get too far down the road on this API, I think we understand >>>> the way in which MacOS processes multi-resolution images for HiDPI >>>> screens, but have we investigated the processes that Windows uses >>>> under Windows 8? My impression is that Windows 8 has included a >>>> number of new techniques for dealing with the high resolution displays >>>> that it will run on in the Windows tablet and mobile industries and >>>> that these will also come into play as 4K displays (already available) >>>> become more common on the desktop. We should make sure that what we >>>> come up with here can provide native compatibility with either >>>> platform's policies and standard practices. >>>> >>>> If you've investigated the MS policies I'd like to see a summary so >>>> that we can consider them as we review this API... >>> There is the Windows Guidelines for scaling to pixel density: >>> http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx >>> which says that Windows has automatic resource loading that supports >>> three version of images scaling (100%, 140%, and 180%) >>> -------------------------------- >>> Without scaling, as the pixel density of a display device increases, the >>> physical sizes of objects on screen get smaller. >>> When UI would otherwise be too small to touch and when text gets too >>> small to read, >>> Windows scales the system and app UI to one of the following scaling >>> plateaus: >>> >>> 1.0 (100%, no scaling is applied) >>> 1.4 (140% scaling) >>> 1.8 (180% scaling) >>> >>> Windows determines which scaling plateau to use based on the physical >>> screen size, the screen resolution, the DPI of the screen, and form >>> factor. >>> >>> Use resource loading for bitmap images in the app package For bitmap >>> images stored >>> in the app package, provide a separate image for each scaling >>> factor(100%, 140%, and 180%), >>> and name your image files using the "scale" naming convention described >>> below. >>> Windows loads the right image for the current scale automatically. >>> -------------------------------- >>> >>> The image name convention for the various scales is: >>> images/logo.scale-100.png >>> images/logo.scale-140.png >>> images/logo.scale-180.png >>> >>> The 'ms-appx:///images/logo.png' uri is used to load the image in an >>> application. >>> >>> If we want to support this in the same way as it is done for Mac OS X >>> the WToolkit should return MultiResolution image in case if the >>> loaded image has .scale-* qualifiers. >>> The Graphics class can request an image with necessary resolution >>> from the MultiResolution image. >>> >>> It seems that nothing should be changed in the MultiResolution >>> interface in this case. >>> >>> Thanks, >>> Alexandr. >>>> >>>> ...jim >>>> >>>> On 1/14/14 2:54 AM, Alexander Scherbatiy wrote: >>>>> >>>>> Hello, >>>>> >>>>> Could you review the fix: >>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8029339 >>>>> webrev: http://cr.openjdk.java.net/~alexsch/8029339/webrev.00 >>>>> >>>>> This is a proposal to introduce an API that allows to create a >>>>> custom >>>>> multi resolution image. >>>>> >>>>> I. It seems reasonable that the API should provide two basic >>>>> operations: >>>>> >>>>> 1. Get the resolution variant based on the requested image width and >>>>> height: >>>>> - Image getResolutionVariant(int width, int height) >>>>> >>>>> Usually the system provides the scale factor which represents the >>>>> number of pixels corresponding to each linear unit on the display. >>>>> However, it has sense to combine the scale factor and the current >>>>> transformations to get the actual image size to be displayed. >>>>> >>>>> 2. Get all provided resolution variants: >>>>> - List getResolutionVariants() >>>>> >>>>> There are several uses cases: >>>>> - Create a new multi-resolution image based on the given >>>>> multi-resolution image. >>>>> - Pass to the native system the multi-resolution image. For >>>>> example, >>>>> a use can set to the system the custom multi-resolution cursor. >>>>> >>>>> II. There are some possible ways where the new API can be added >>>>> >>>>> 1. java.awt.Image. >>>>> >>>>> The 2 new methods can be added to the Image class. A user can >>>>> override >>>>> the getResolutionVariant() and getResolutionVariants() methods to >>>>> provide the resolution variants >>>>> or there can be default implementations of these methods if a user >>>>> puts resolution variants >>>>> to the list in the sorted order. >>>>> >>>>> To check that the image has resolution variants the following >>>>> statement can be used: image.getResolutionVariants().size() != 1 >>>>> >>>>> The disadvantage is that there is an overhead that the Image class >>>>> should contain the List object and not all >>>>> images can have resolution variants. >>>>> >>>>> 2. Introduce new MultiResolutionImage interface. >>>>> >>>>> A user should extend Image class and implement the >>>>> MultiResolutionImage interface. >>>>> >>>>> For example: >>>>> --------------------- >>>>> public class CustomMultiResolutionImage extends BufferedImage >>>>> implements MultiResolutionImage { >>>>> >>>>> Image highResolutionImage; >>>>> >>>>> public CustomMultiResolutionImage(BufferedImage baseImage, >>>>> BufferedImage highResolutionImage) { >>>>> super(baseImage.getWidth(), baseImage.getHeight(), >>>>> baseImage.getType()); >>>>> this.highResolutionImage = highResolutionImage; >>>>> Graphics g = getGraphics(); >>>>> g.drawImage(baseImage, 0, 0, null); >>>>> g.dispose(); >>>>> } >>>>> >>>>> @Override >>>>> public Image getResolutionVariant(int width, int height) { >>>>> return ((width <= getWidth() && height <= getHeight())) >>>>> ? this : highResolutionImage; >>>>> } >>>>> >>>>> @Override >>>>> public List getResolutionVariants() { >>>>> return Arrays.asList(this, highResolutionImage); >>>>> } >>>>> } >>>>> --------------------- >>>>> >>>>> The current fix adds the MultiResolutionImage interface and public >>>>> resolution variant rendering hints. >>>>> >>>>> Thanks, >>>>> Alexandr. >>>>> >>> > From michael.cui at oracle.com Wed Feb 12 17:15:36 2014 From: michael.cui at oracle.com (michael cui) Date: Thu, 13 Feb 2014 09:15:36 +0800 Subject: RFR for JDK-8028711: TEST_BUG: Tests should pass through VM options: corelibs tests In-Reply-To: <52FBBEE5.7010302@oracle.com> References: <52E4C2E8.1060605@oracle.com> <52E4D1F2.4030406@oracle.com> <52E5B4C3.6080405@oracle.com> <52F455FC.3020009@oracle.com> <52F4BD7B.8080006@oracle.com> <52F87906.5040702@oracle.com> <52F89D96.7000601@oracle.com> <52FB7039.3060907@oracle.com> <52FBBEE5.7010302@oracle.com> Message-ID: <52FC1CB8.90707@oracle.com> On 02/13/2014 02:35 AM, Alan Bateman wrote: > The changes look okay to me. I see you decided to ignore the javac > usages but that is okay and can be done another time. > > Also thanks for fixing lookup.sh. I don't personally mind lines > 80 > but that one was >180 which make it difficult to look at side-by-side > changes. Hi Alan, Thanks so much for reviewing this! Would you mind to sponsor this for me? Regrads, Michael Cui From konstantin.shefov at oracle.com Thu Feb 13 03:52:51 2014 From: konstantin.shefov at oracle.com (Konstantin Shefov) Date: Thu, 13 Feb 2014 15:52:51 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52F880D7.3080804@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> <52F393C1.7080702@oracle.com> <52F39437.6010307@oracle.com> <52F880D7.3080804@oracle.com> Message-ID: <52FCB213.9020208@oracle.com> Reminder On 10-Feb-14 11:33, Konstantin Shefov wrote: > Please, review this test fix. > The test blocks automated test execution, so should be fixed. > > Thanks > -Konstantin > > On 06-Feb-14 17:55, Sergey Bylokhov wrote: >> Thanks. >> Then the fix looks good. >> >> On 06.02.2014 17:53, Konstantin Shefov wrote: >>> >>> On 06-Feb-14 17:49, Konstantin Shefov wrote: >>>> Sergey, >>>> This System.exit will never be seen by jtreg, more than that, this >>>> test already has system.exit and will not work without it. >>> System.exit is invoked by child vm, child vm is NOT controlled by >>> JTREG at all. >>>> >>>> Konstantin >>>> >>>> On 06-Feb-14 17:21, Sergey Bylokhov wrote: >>>>> Hi, Konstantin. >>>>> The tests should not use System.exit() , it can be forbidden in >>>>> some modes of jtreg. >>>>> >>>>> On 06.02.2014 17:03, Konstantin Shefov wrote: >>>>>> Hi all, >>>>>> >>>>>> please review the fix >>>>>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>>>>> for >>>>>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>>>>> >>>>>> Test hangs on windows if test frames are covered by a window of >>>>>> some other app. >>>>>> >>>>>> Thanks, >>>>>> Konstantin >>>>> >>>>> >>>> >>> >> >> > From anton.tarasov at oracle.com Thu Feb 13 05:03:09 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Thu, 13 Feb 2014 17:03:09 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52FA7DCD.80405@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> <52FA67A8.1010600@oracle.com> <52FA7DCD.80405@oracle.com> Message-ID: <52FCC28D.5010007@oracle.com> Hi Jim, Please, look at the update: http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.5 Here I'm correcting the rect after the transform in SG2D: 2123 // In case of negative scale transform, reflect the rect coords. 2124 if (w < 0) { 2125 w *= -1; 2126 x -= w; 2127 } 2128 if (h < 0) { 2129 h *= -1; 2130 y -= h; 2131 } The blit direction (dx, dy) remains transformed. Is this the right behavior from your perspective? On 11.02.2014 23:45, Jim Graham wrote: > Hi Anton, > > These comments are about future public API, but this current patch is about getting the mechanism > working behind the scenes. I'm OK with proceeding with the current patch as it is (modulo the > review feedback I gave) to get the mechanism working for the basic back buffer behind the scenes, > but we will eventually want the applications to be able to create their own HiDPI intermediate > buffers in addition to the back buffer that we manage for them - and these comments below are > about how we eventually expose this mechanism to them in a future stage... Thanks for the clarification. (Please, see below.) > > ...jim > > On 2/11/14 10:10 AM, Anton V. Tarasov wrote: >> Hi Jim, >> >> On 2/11/14 4:12 AM, Jim Graham wrote: >>> Just out of curiosity, on a Mac there is support for @2x images where >>> they get loaded and used (at half scale to preserve layout size) >>> automatically for you. In that respect, the added resolution is >>> hidden from the regular APIs and the developer doesn't really have to >>> deal with the meaning of "size" as it relates to HiDPI. >>> >>> But, when you buy into HiDPI for your rendering, it looks like their >>> system requires you to ask them to calculate the proper extents for >>> the back buffer to render it and you are supposed to render it into >>> that rectangle (FX is calling convertRectToBacking and then using the >>> bounds to control the eventual blit of the back buffers). >>> >>> If that is the case, then it looks like we have some precedence there >>> to have them buy into HiDPI backing stores or compatible images where >>> the images report their pixel sizes and they need to manage the >>> display size directly (i.e. by using drawImage(x,y,w,h) as we do >>> internally). I think we could make it a little more friendly than >>> their "convertRectToBacking" system, but it would mean we wouldn't >>> have to pollute the getWidth/Height APIs with conditional return values. >>> >>> For example, if we added getLayoutWH() or getScaleFactor() to image or >>> bimg, then the normal ways of constructing those objects would simply >>> return objects where the answers were unscaled and unsurprising. If >>> they went out of their way to request one that was scaled, then those >>> new APIs (available on all images, but not very interesting except on >>> the specially constructed DPI-aware versions) would have new values to >>> help them manage the scaled image. Unaware code would simply see >>> these as overly large images, but it would be up to the developer to >>> manage hiding any HiDPI images from any code that they had not >>> converted to be DPI aware (just as we are doing here with our internal >>> Swing buffer). >> So, HiDPI BI won't be backward compatible (unlike VolatileImage's) in terms of behavior? Thanks, Anton. From alexandr.scherbatiy at oracle.com Thu Feb 13 06:04:41 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 13 Feb 2014 18:04:41 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina Message-ID: <52FCD0F9.3000001@oracle.com> Hello, Could you review the fix: bug: https://bugs.openjdk.java.net/browse/JDK-8031573 webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 The NSMenu* system icons are templates and do not have image representations. The fix retrieves images with original and double size from an NSImage and put them to a MultiResolution image. The fix also adds sun.awt.image.MultiResolutionBufferedImage class which can be used uniformly for a Multiresolution image creation. The fix is independent of the fix 8033534 Get MultiResolution image from native system http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html because CImage.createImageFromName(imageName) never returns a MultiResolution image for templates. But the fix 8033534 can be updated to use the MultiResolutionBufferedImage. Thanks, Alexandr. From oleg.pekhovskiy at oracle.com Thu Feb 13 06:26:21 2014 From: oleg.pekhovskiy at oracle.com (Oleg Pekhovskiy) Date: Thu, 13 Feb 2014 18:26:21 +0400 Subject: [9] Review request for 8031694: [macosx] TwentyThousandTest test intermittently hangs In-Reply-To: <52FBB4F7.6000705@oracle.com> References: <52E708C3.4070803@oracle.com> <52F42952.3080303@oracle.com> <52F4F23B.6060604@oracle.com> <52F50739.7090003@oracle.com> <52F90996.4050800@oracle.com> <52FB6FF6.8010302@oracle.com> <52FBB4F7.6000705@oracle.com> Message-ID: <52FCD60D.3040207@oracle.com> Thank you, guys! Regards, Oleg On 12.02.2014 21:52, Anthony Petrov wrote: > Oleg, Artem, thank you for the clarifications. > > I'm fine with the webrev version .2, too. > > -- > best regards, > Anthony > > On 2/12/2014 4:58 PM, Artem Ananiev wrote: >> >> On 2/10/2014 9:17 PM, Anthony Petrov wrote: >>> Thanks for the clarifications. Note that given that we re-create the EDT >>> if there are more events in the queue, I'm still unsure whether we >>> regress or not. I recall there was a patch submitted on this mailing >>> list a few years ago that made the EDT die unconditionally and never be >>> resurrected if it's requested to die. So I'm afraid the code that relies >>> on this behavior will stop working correctly after your fix because you >>> will re-create the EDT for all remaining events. >> >> I can barely imagine such a code that kills EDT and expect it to have >> died forever :) This is a violation of AWT contract, when event >> dispatching is started as soon as a new event is posted. If applications >> needs another behavior, it has to make sure no events are posted to AWT >> event queue. >> >> Oleg, >> >> webrev .2 looks fine to me. >> >> Thanks, >> >> Artem >> >>> What tests did you run with your fix? >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/7/2014 8:18 PM, Oleg Pekhovskiy wrote: >>>> Hi Anthony, >>>> >>>> there are two points for choosing this solution: >>>> 1. If something makes EDT to die, there is a serious reason to do so. >>>> It's a forced action. >>>> So it should be done ASAP. Dying EDT usage for pumping followed events >>>> looks strange because we expect him to die. >>>> Moreover it could happen that events are posted quite frequently to >>>> keep >>>> dying EDT alive for some period of time. >>>> >>>> 2. Synchronization object for posting events from different threads is >>>> EventQueue.pushPopLock. >>>> it is used in EventQueue. postEventPrivate(), EventQueue.getNextEvent() >>>> and EventQueue. detachDispatchThread(). >>>> When dying EDT returns from >>>> EventDispatchThread.pumpEventsForFilter() to >>>> EventDispatchThread.run() and then goes to >>>> getEventQueue().detachDispatchThread(), EventQueue.pushPopLock is not >>>> used, so any other thread could post events. >>>> So if we don't call peekEvent() to recreate a new EDT, we'll just loose >>>> these events as it currently happens. >>>> >>>> So the main idea is to make EDT life cycle phases obvious. >>>> >>>> Thanks, >>>> Oleg >>>> >>>> On 02/07/2014 06:48 PM, Anthony Petrov wrote: >>>>> Hi Oleg, >>>>> >>>>> This code is very tricky. I like it that we process any events that >>>>> might be posted to the queue after the current EDT dies. However, >>>>> could you please clarify how initializing a new EDT is any different >>>>> from not letting the old one die? I.e. could we just not kill the old >>>>> EDT if we see there are more events in the queue? If not, what exact >>>>> difference does you solution bring? >>>>> >>>>> It's not that I'm against your fix, it looks good actually. I'd just >>>>> like to understand the difference. Please elaborate. >>>>> Also, I recall we've fixed a number of bugs in this area. Are we sure >>>>> we don't regress after this fix? >>>>> >>>>> -- >>>>> best regards, >>>>> Anthony >>>>> >>>>> On 2/7/2014 4:31 AM, Oleg Pekhovskiy wrote: >>>>>> Hi all, >>>>>> >>>>>> please review the next version of fix: >>>>>> http://cr.openjdk.java.net/~bagiras/8031694.2/ >>>>>> >>>>>> We with Artem Ananiev had off-line discussion and he offered let the >>>>>> dying EDT to die >>>>>> and process unhandled events by forcing another EDT start. >>>>>> >>>>>> Thanks, >>>>>> Oleg >>>>>> >>>>>> On 01/28/2014 05:32 AM, Oleg Pekhovskiy wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> please review the fix >>>>>>> http://cr.openjdk.java.net/~bagiras/8031694.1/ >>>>>>> for >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8031694 >>>>>>> >>>>>>> During forward-port of JDK-7189350 EDT.doDispatch was not taken into >>>>>>> account when calling EventQueue.detachDispatchThread(). >>>>>>> As a result harmful optimization of this method occurred. >>>>>>> So when doDispatch became false, no more events in QventQueue were >>>>>>> handled before EDT shutdown. >>>>>>> I kept the optimization but added the check to >>>>>>> EDT.pumpEventsForFilter() that EventQueue is not empty to keep >>>>>>> pumping. >>>>>>> >>>>>>> Thanks, >>>>>>> Oleg >>>>>> >>>> From hs at tagtraum.com Thu Feb 13 08:10:43 2014 From: hs at tagtraum.com (Hendrik Schreiber) Date: Thu, 13 Feb 2014 17:10:43 +0100 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <52FCD0F9.3000001@oracle.com> References: <52FCD0F9.3000001@oracle.com> Message-ID: <3C47938B-BB2E-4EFF-BA87-B3150E1466D7@tagtraum.com> On Feb 13, 2014, at 15:04, Alexander Scherbatiy wrote: > Could you review the fix: > bug: https://bugs.openjdk.java.net/browse/JDK-8031573 > webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 > > The NSMenu* system icons are templates and do not have image representations. > > The fix retrieves images with original and double size from an NSImage and put them to a MultiResolution image. > The fix also adds sun.awt.image.MultiResolutionBufferedImage class which can be used uniformly for a Multiresolution image creation. > > The fix is independent of the fix 8033534 Get MultiResolution image from native system > http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html > because CImage.createImageFromName(imageName) never returns a MultiResolution image for templates. > But the fix 8033534 can be updated to use the MultiResolutionBufferedImage. Glad to see you guys are working on this. It greatly increases chances of actually shipping something for OS X with bundled Java 8?once 8u20 is out. Thanks! -hendrik From Sergey.Bylokhov at oracle.com Thu Feb 13 14:01:58 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 14 Feb 2014 02:01:58 +0400 Subject: [9] Review Request: 8034068 Label.toString performance improvement In-Reply-To: <52F932EB.3040908@oracle.com> References: <52F8D9F1.6070805@oracle.com> <52F90B78.8030702@oracle.com> <52F932EB.3040908@oracle.com> Message-ID: <52FD40D6.50905@oracle.com> On 11.02.2014 0:13, Artem Ananiev wrote: > > On 2/10/2014 9:25 PM, Anthony Petrov wrote: >> Looks okay. How faster does the Label work now, btw? :) > > Earlier today Sergey told it would be about ~20% - AWT Label should be > very fast now :) > > A minor comment from my side. Since we already use ?: in > Component.paramString(), we can also use it for !isValid(), visible, > and !enabled later in the same method. The resulting line of code > won't be very nice (but shouldn't be ugly too), but it will be fast. I changed this method a little bit to compact and fast version. Updated version: http://cr.openjdk.java.net/~serb/8034068/webrev%2c01 > > > Thanks, > > Artem > >> -- >> best regards, >> Anthony >> >> On 2/10/2014 5:53 PM, Sergey Bylokhov wrote: >>> Hello. >>> Please review the quick fix for jdk 9. >>> The code in Label was changed to be a faster and a readable. + small >>> cleanup in Component. >>> >>> Actual change is from: >>> String str = ",align="; >>> switch(alignment) { >>> case 0: str = (new >>> StringBuilder()).append(s).append("left").toString(); break; >>> case 1: str = (new >>> StringBuilder()).append(s).append("center").toString(); break; >>> case 2: str = (new >>> StringBuilder()).append(s).append("right").toString(); break; >>> } >>> return (new >>> StringBuilder()).append(super.paramString()).append(str).append(",text=").append(text).toString(); >>> >>> >>> >>> to >>> String str = ""; >>> switch(alignment) { >>> case 0: str = "left"; break; >>> case 1: str = "center"; break; >>> case 2: str = "right"; break; >>> } >>> return (new >>> StringBuilder()).append(super.paramString()).append(",align=").append(str).append(",text=").append(text).toString(); >>> >>> >>> >>> >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8034068 >>> Webrev can be found at: >>> http://cr.openjdk.java.net/~serb/8034068/webrev.00 >>> -- Best regards, Sergey. From anthony.petrov at oracle.com Thu Feb 13 14:10:20 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Fri, 14 Feb 2014 02:10:20 +0400 Subject: [9] Review Request: 8034068 Label.toString performance improvement In-Reply-To: <52FD40D6.50905@oracle.com> References: <52F8D9F1.6070805@oracle.com> <52F90B78.8030702@oracle.com> <52F932EB.3040908@oracle.com> <52FD40D6.50905@oracle.com> Message-ID: <52FD42CC.4090005@oracle.com> The fix still looks good to me. -- best regards, Anthony On 2/14/2014 2:01 AM, Sergey Bylokhov wrote: > On 11.02.2014 0:13, Artem Ananiev wrote: >> >> On 2/10/2014 9:25 PM, Anthony Petrov wrote: >>> Looks okay. How faster does the Label work now, btw? :) >> >> Earlier today Sergey told it would be about ~20% - AWT Label should be >> very fast now :) >> >> A minor comment from my side. Since we already use ?: in >> Component.paramString(), we can also use it for !isValid(), visible, >> and !enabled later in the same method. The resulting line of code >> won't be very nice (but shouldn't be ugly too), but it will be fast. > I changed this method a little bit to compact and fast version. > Updated version: > http://cr.openjdk.java.net/~serb/8034068/webrev%2c01 >> >> >> Thanks, >> >> Artem >> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/10/2014 5:53 PM, Sergey Bylokhov wrote: >>>> Hello. >>>> Please review the quick fix for jdk 9. >>>> The code in Label was changed to be a faster and a readable. + small >>>> cleanup in Component. >>>> >>>> Actual change is from: >>>> String str = ",align="; >>>> switch(alignment) { >>>> case 0: str = (new >>>> StringBuilder()).append(s).append("left").toString(); break; >>>> case 1: str = (new >>>> StringBuilder()).append(s).append("center").toString(); break; >>>> case 2: str = (new >>>> StringBuilder()).append(s).append("right").toString(); break; >>>> } >>>> return (new >>>> StringBuilder()).append(super.paramString()).append(str).append(",text=").append(text).toString(); >>>> >>>> >>>> >>>> to >>>> String str = ""; >>>> switch(alignment) { >>>> case 0: str = "left"; break; >>>> case 1: str = "center"; break; >>>> case 2: str = "right"; break; >>>> } >>>> return (new >>>> StringBuilder()).append(super.paramString()).append(",align=").append(str).append(",text=").append(text).toString(); >>>> >>>> >>>> >>>> >>>> >>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8034068 >>>> Webrev can be found at: >>>> http://cr.openjdk.java.net/~serb/8034068/webrev.00 >>>> > > From Sergey.Bylokhov at oracle.com Thu Feb 13 14:12:27 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 14 Feb 2014 02:12:27 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <52FCD0F9.3000001@oracle.com> References: <52FCD0F9.3000001@oracle.com> Message-ID: <52FD434B.4060002@oracle.com> Hi, Alexander. Did you check option of loading of the picture on demand?Since most of the time x2 version is useless on non hdpi and vice versa. On 13.02.2014 18:04, Alexander Scherbatiy wrote: > > Hello, > > Could you review the fix: > bug: https://bugs.openjdk.java.net/browse/JDK-8031573 > webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 > > The NSMenu* system icons are templates and do not have image > representations. > > The fix retrieves images with original and double size from an > NSImage and put them to a MultiResolution image. > The fix also adds sun.awt.image.MultiResolutionBufferedImage class > which can be used uniformly for a Multiresolution image creation. > > The fix is independent of the fix 8033534 Get MultiResolution image > from native system > http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html > because CImage.createImageFromName(imageName) never returns a > MultiResolution image for templates. > But the fix 8033534 can be updated to use the > MultiResolutionBufferedImage. > > Thanks, > Alexandr. > -- Best regards, Sergey. From james.graham at oracle.com Thu Feb 13 14:52:38 2014 From: james.graham at oracle.com (Jim Graham) Date: Thu, 13 Feb 2014 14:52:38 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52FCC28D.5010007@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> <52FA67A8.1010600@oracle.com> <52FA7DCD.80405@oracle.com> <52FCC28D.5010007@oracle.com> Message-ID: <52FD4CB6.2090805@oracle.com> On 2/13/14 5:03 AM, Anton V. Tarasov wrote: > Hi Jim, > > Please, look at the update: > > http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.5 > > Here I'm correcting the rect after the transform in SG2D: > > 2123 // In case of negative scale transform, reflect the rect > coords. > 2124 if (w < 0) { > 2125 w *= -1; > 2126 x -= w; > 2127 } > 2128 if (h < 0) { > 2129 h *= -1; > 2130 y -= h; > 2131 } > > > The blit direction (dx, dy) remains transformed. Is this the right > behavior from your perspective? Yes, that looks good. I wonder if the "w *= -1" results in a multiply byte code whereas "w = -w" would avoid the multiply? ...jim From gnu.andrew at redhat.com Thu Feb 13 20:49:34 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Thu, 13 Feb 2014 23:49:34 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <52FBFA7C.2020100@oracle.com> References: <20140203174327.GA9174@redhat.com> <246610961.4358603.1391559960875.JavaMail.root@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> Message-ID: <1765957702.3418825.1392353374801.JavaMail.zimbra@redhat.com> ----- Original Message ----- > > On 2014-02-12 18:47, Andrew Hughes wrote: > >> To be extremely clear: Andrew, do you object to bringing Omairs patch, > >> as it is, into OpenJDK? > >> > > Yes. > > Okay then. > > I'll put a mental note to revisit libpng when cleaning up libraries.m4. > Are we in agreement that it should to the following: > --with-libpng=bundled | system | > and if "system" is selected, it should first check with pkg-config, and > only if that fails, try hard-coded values. In any case it should try to > compile a short code to see that it works properly. (This is not needed > for bundled; that is assumed to be working). I'd rather it was simply --enable-system-libpng. I see no reason to specify a value, as I don't see how that could encode all of the needed CFLAGS and LDFLAGS. > > /Magnus > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From gnu.andrew at redhat.com Thu Feb 13 20:59:21 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Thu, 13 Feb 2014 23:59:21 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140212225513.GB6766@redhat.com> References: <20140203174327.GA9174@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> Message-ID: <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> ----- Original Message ----- > Hi, > > * Magnus Ihse Bursie [2014-02-12 17:49]: > > > > On 2014-02-12 18:47, Andrew Hughes wrote: > > >>To be extremely clear: Andrew, do you object to bringing Omairs patch, > > >>as it is, into OpenJDK? > > >> > > >Yes. > > > > Okay then. > > > > I'll put a mental note to revisit libpng when cleaning up > > libraries.m4. > > Assuming that I have the cycles to clean up some stuff, what's the > minimal I could get away with (to enable system libpng support)? > > > Are we in agreement that it should to the following: > > --with-libpng=bundled | system | > > and if "system" is selected, it should first check with pkg-config, > > and only if that fails, try hard-coded values. In any case it should > > try to compile a short code to see that it works properly. (This is > > not needed for bundled; that is assumed to be working). > > Would it be sufficient if I updated the patch to use PGK_CHECK_MODULES > and simply fail if that doesn't work? I will be happy to implement > something more complex if you can sketch it out. > > Thanks, > Omair > > -- > PGP Key: 66484681 (http://pgp.mit.edu/) > Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 > As I said in the previous e-mail, the minimum I'd be happy with is if the current patch was updated so settings weren't being hardcoded into the makefiles. Passing them from configure would be sufficient for now, then it can be replaced by PKG_CONFIG. That said, adding PKG_CONFIG is trivial. This is what the IcedTea forest has had in its jdk_generic_profile script since 2011: # Export variables for system libpng # PNG_CFLAGS and PNG_LIBS tell the compiler how to compile and # link against libpng if [ -x "${pkgconfig}" ] ; then if [ "${PNG_CFLAGS}" = "" ] ; then PNG_CFLAGS=$("${pkgconfig}" --cflags libpng) fi if [ "${PNG_LIBS}" = "" ] ; then PNG_LIBS=$("${pkgconfig}" --libs libpng) fi fi if [ "${PNG_LIBS}" = "" ] ; then PNG_LIBS="-lpng" fi export PNG_CFLAGS export PNG_LIBS In autoconf, obviously, you can use the preferable macro instead by the idea is the same. I don't see why this needs so much discussion. If pkg-config fails, there are three options of what to do: 1. Error out. This is my preference & what IcedTea does. PKG_CHECK_MODULES(PNG, libpng,[LIBPNG_FOUND=yes],[LIBPNG_FOUND=no]) if test "x${LIBPNG_FOUND}" = xno then AC_MSG_ERROR([Could not find libpng; install libpng or build with --disable-system-png to use the in-tree copy.]) fi AC_SUBST(PNG_CFLAGS) AC_SUBST(PNG_LIBS) 2. Use a hardcoded value as the IcedTea forest does. 3. Output a message and drop back to bundled automatically. This isn't the default like in IcedTea, which makes me even more strongly in favour of option 1. If someone has explicitly enabled the system libpng option, silently carrying on and using the bundled one is kind of evil. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From anton.tarasov at oracle.com Thu Feb 13 23:12:17 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Fri, 14 Feb 2014 11:12:17 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52FD4CB6.2090805@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> <52FA67A8.1010600@oracle.com> <52FA7DCD.80405@oracle.com> <52FCC28D.5010007@oracle.com> <52FD4CB6.2090805@oracle.com> Message-ID: <52FDC1D1.8050907@oracle.com> On 14.02.2014 2:52, Jim Graham wrote: > > > On 2/13/14 5:03 AM, Anton V. Tarasov wrote: >> Hi Jim, >> >> Please, look at the update: >> >> http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.5 >> >> Here I'm correcting the rect after the transform in SG2D: >> >> 2123 // In case of negative scale transform, reflect the rect >> coords. >> 2124 if (w < 0) { >> 2125 w *= -1; >> 2126 x -= w; >> 2127 } >> 2128 if (h < 0) { >> 2129 h *= -1; >> 2130 y -= h; >> 2131 } >> >> >> The blit direction (dx, dy) remains transformed. Is this the right >> behavior from your perspective? > > Yes, that looks good. I wonder if the "w *= -1" results in a multiply byte code whereas "w = -w" > would avoid the multiply? > > ...jim Jim, Yes, this indeed results in different byte code instructions (imult & ineg). Just for curiosity I did some measuring which showed negatioation worked 10% faster :) Well, I'll fix it but let me please not send an update... Thanks! Anton. From alexandr.scherbatiy at oracle.com Fri Feb 14 02:32:32 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 14 Feb 2014 14:32:32 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <52FD434B.4060002@oracle.com> References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> Message-ID: <52FDF0C0.6070200@oracle.com> On 2/14/2014 2:12 AM, Sergey Bylokhov wrote: > Hi, Alexander. > Did you check option of loading of the picture on demand?Since most of > the time x2 version is useless on non hdpi and vice versa. It's not quite true. MacOSX choses a necessary image representation based on the current transformations. Setting current transformation to scale 2x leads that the high resolution image is drawn even on non HiDPI display. There is a similar mechanism for the MultiResolution toolkit images. The base image is drawn in case if the high-resolution image has not been loaded yet. It has an issue that if there is no one more repaint event the image with high resolution is not shown. I would suggest to move this topic to a separate issue. Thanks, Alexandr. > > On 13.02.2014 18:04, Alexander Scherbatiy wrote: >> >> Hello, >> >> Could you review the fix: >> bug: https://bugs.openjdk.java.net/browse/JDK-8031573 >> webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 >> >> The NSMenu* system icons are templates and do not have image >> representations. >> >> The fix retrieves images with original and double size from an >> NSImage and put them to a MultiResolution image. >> The fix also adds sun.awt.image.MultiResolutionBufferedImage class >> which can be used uniformly for a Multiresolution image creation. >> >> The fix is independent of the fix 8033534 Get MultiResolution image >> from native system >> http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html >> because CImage.createImageFromName(imageName) never returns a >> MultiResolution image for templates. >> But the fix 8033534 can be updated to use the >> MultiResolutionBufferedImage. >> >> Thanks, >> Alexandr. >> > > From Sergey.Bylokhov at oracle.com Fri Feb 14 03:16:57 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 14 Feb 2014 15:16:57 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <52FDF0C0.6070200@oracle.com> References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> <52FDF0C0.6070200@oracle.com> Message-ID: <52FDFB29.4060901@oracle.com> On 2/14/14 2:32 PM, Alexander Scherbatiy wrote: > On 2/14/2014 2:12 AM, Sergey Bylokhov wrote: >> Hi, Alexander. >> Did you check option of loading of the picture on demand?Since most >> of the time x2 version is useless on non hdpi and vice versa. Yes but in this particular case menu items will be painted in one particular scale only. > It's not quite true. > MacOSX choses a necessary image representation based on the > current transformations. Setting current transformation to scale 2x leads > that the high resolution image is drawn even on non HiDPI display. > > There is a similar mechanism for the MultiResolution toolkit > images. The base image is drawn in case if the high-resolution image > has not been loaded yet. > It has an issue that if there is no one more repaint event the > image with high resolution is not shown. > > I would suggest to move this topic to a separate issue. > > Thanks, > Alexandr. > >> >> On 13.02.2014 18:04, Alexander Scherbatiy wrote: >>> >>> Hello, >>> >>> Could you review the fix: >>> bug: https://bugs.openjdk.java.net/browse/JDK-8031573 >>> webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 >>> >>> The NSMenu* system icons are templates and do not have image >>> representations. >>> >>> The fix retrieves images with original and double size from an >>> NSImage and put them to a MultiResolution image. >>> The fix also adds sun.awt.image.MultiResolutionBufferedImage class >>> which can be used uniformly for a Multiresolution image creation. >>> >>> The fix is independent of the fix 8033534 Get MultiResolution >>> image from native system >>> http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html >>> >>> because CImage.createImageFromName(imageName) never returns a >>> MultiResolution image for templates. >>> But the fix 8033534 can be updated to use the >>> MultiResolutionBufferedImage. >>> >>> Thanks, >>> Alexandr. >>> >> >> > -- Best regards, Sergey. From omajid at redhat.com Fri Feb 14 09:27:47 2014 From: omajid at redhat.com (Omair Majid) Date: Fri, 14 Feb 2014 12:27:47 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> References: <20140203174327.GA9174@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> Message-ID: <20140214172747.GE2406@redhat.com> * Andrew Hughes [2014-02-13 23:59]: > As I said in the previous e-mail, the minimum I'd be happy with is if > the current patch was updated so settings weren't being hardcoded into > the makefiles. Passing them from configure would be sufficient for now, > then it can be replaced by PKG_CONFIG. How does this updated patch look: http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/03/ http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/03-jdk/ Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From james.graham at oracle.com Fri Feb 14 17:01:02 2014 From: james.graham at oracle.com (Jim Graham) Date: Fri, 14 Feb 2014 17:01:02 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52FDC1D1.8050907@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> <52FA67A8.1010600@oracle.com> <52FA7DCD.80405@oracle.com> <52FCC28D.5010007@oracle.com> <52FD4CB6.2090805@oracle.com> <52FDC1D1.8050907@oracle.com> Message-ID: <52FEBC4E.9010202@oracle.com> I don't need to see an update for that. I didn't read the entire webrev, but I looked at this one piece of code and if that was the only thing changed then I think that dealt with the outstanding issues... ...jim On 2/13/14 11:12 PM, Anton V. Tarasov wrote: > On 14.02.2014 2:52, Jim Graham wrote: >> >> >> On 2/13/14 5:03 AM, Anton V. Tarasov wrote: >>> Hi Jim, >>> >>> Please, look at the update: >>> >>> http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.5 >>> >>> Here I'm correcting the rect after the transform in SG2D: >>> >>> 2123 // In case of negative scale transform, reflect the rect >>> coords. >>> 2124 if (w < 0) { >>> 2125 w *= -1; >>> 2126 x -= w; >>> 2127 } >>> 2128 if (h < 0) { >>> 2129 h *= -1; >>> 2130 y -= h; >>> 2131 } >>> >>> >>> The blit direction (dx, dy) remains transformed. Is this the right >>> behavior from your perspective? >> >> Yes, that looks good. I wonder if the "w *= -1" results in a multiply >> byte code whereas "w = -w" would avoid the multiply? >> >> ...jim > > Jim, > > Yes, this indeed results in different byte code instructions (imult & > ineg). Just for curiosity I did some measuring which showed negatioation > worked 10% faster :) > Well, I'll fix it but let me please not send an update... > > Thanks! > Anton. > From mikael.vidstedt at oracle.com Fri Feb 14 17:54:15 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Fri, 14 Feb 2014 17:54:15 -0800 Subject: RFR: Even more gcc warnings Message-ID: <52FEC8C7.9000700@oracle.com> All, A drive-by set of warning fixes: http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/jdk-warnings/webrev.00/ Highlights: * src/share/native/com/sun/java/util/jar/pack/bands.cpp Set the size of the array explicitly to increase likelihood of enum and struct array being in sync. Arguably this should be changed to use the (new) [] = instead. Initialize all the fields in the (redundant) terminator struct explicitly. Remove unused macro. * src/share/native/sun/java2d/opengl/OGLContext.c Get the prototype for jio_snprintf from jvm.h to address an implicit declaration. * src/solaris/native/sun/awt/awt_Font.c Comparisons with string literals is undefined behavior - keep track of whether the string should be freed explicitly with a boolean instead. * src/solaris/native/sun/awt/awt_LoadLibrary.c The macro is supposed to expand to a void function declaration, but forgets to actually add the "void". Cheers, Mikael From mikael.vidstedt at oracle.com Sat Feb 15 08:37:39 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Sat, 15 Feb 2014 08:37:39 -0800 Subject: RFR: Even more gcc warnings In-Reply-To: <52FEC8C7.9000700@oracle.com> References: <52FEC8C7.9000700@oracle.com> Message-ID: <41E8E647-4C1E-4DD6-86AF-40A498B503B7@oracle.com> Corrected link - this webrev is based on jdk9/client: http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/webrev.01/webrev/ Cheers, Mikael > On Feb 14, 2014, at 17:54, Mikael Vidstedt wrote: > > > All, > > A drive-by set of warning fixes: > > http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/jdk-warnings/webrev.00/ > > Highlights: > > * src/share/native/com/sun/java/util/jar/pack/bands.cpp > > Set the size of the array explicitly to increase likelihood of enum and struct array being in sync. Arguably this should be changed to use the (new) [] = instead. > > Initialize all the fields in the (redundant) terminator struct explicitly. > > Remove unused macro. > > * src/share/native/sun/java2d/opengl/OGLContext.c > > Get the prototype for jio_snprintf from jvm.h to address an implicit declaration. > > * src/solaris/native/sun/awt/awt_Font.c > > Comparisons with string literals is undefined behavior - keep track of whether the string should be freed explicitly with a boolean instead. > > * src/solaris/native/sun/awt/awt_LoadLibrary.c > > The macro is supposed to expand to a void function declaration, but forgets to actually add the "void". > > Cheers, > Mikael > From philip.race at oracle.com Sat Feb 15 09:31:27 2014 From: philip.race at oracle.com (Phil Race) Date: Sat, 15 Feb 2014 09:31:27 -0800 Subject: RFR: Even more gcc warnings In-Reply-To: <41E8E647-4C1E-4DD6-86AF-40A498B503B7@oracle.com> References: <52FEC8C7.9000700@oracle.com> <41E8E647-4C1E-4DD6-86AF-40A498B503B7@oracle.com> Message-ID: <52FFA46F.4000202@oracle.com> Looks OK to me although I just realised there's no bug ID here FWIW I develop on WIndows, Mac & Linux and I've noticed widely divergent things that the compilers on these platforms warn about. Warning free on Linux might not mean warning free on Windows. Also, assuming you develop on Linux might want to check if any of these make the VS compiler less happy about anything. > * src/solaris/native/sun/awt/awt_Font.c > > Comparisons with string literals is undefined behavior - keep track of whether the string should be freed explicitly with a boolean instead. Gosh .. that code must be from 1996 or thereabouts. -phil. On 2/15/14 8:37 AM, Mikael Vidstedt wrote: > Corrected link - this webrev is based on jdk9/client: > > http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/webrev.01/webrev/ > > Cheers, > Mikael > >> On Feb 14, 2014, at 17:54, Mikael Vidstedt wrote: >> >> >> All, >> >> A drive-by set of warning fixes: >> >> http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/jdk-warnings/webrev.00/ >> >> Highlights: >> >> * src/share/native/com/sun/java/util/jar/pack/bands.cpp >> >> Set the size of the array explicitly to increase likelihood of enum and struct array being in sync. Arguably this should be changed to use the (new) [] = instead. >> >> Initialize all the fields in the (redundant) terminator struct explicitly. >> >> Remove unused macro. >> >> * src/share/native/sun/java2d/opengl/OGLContext.c >> >> Get the prototype for jio_snprintf from jvm.h to address an implicit declaration. >> >> * src/solaris/native/sun/awt/awt_Font.c >> >> Comparisons with string literals is undefined behavior - keep track of whether the string should be freed explicitly with a boolean instead. >> >> * src/solaris/native/sun/awt/awt_LoadLibrary.c >> >> The macro is supposed to expand to a void function declaration, but forgets to actually add the "void". >> >> Cheers, >> Mikael >> From erik.joelsson at oracle.com Mon Feb 17 01:16:31 2014 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Mon, 17 Feb 2014 10:16:31 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140214172747.GE2406@redhat.com> References: <20140203174327.GA9174@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> Message-ID: <5301D36F.3060702@oracle.com> At least to me this looks good, but better let Magnus and Andrew have their say too. /Erik On 2014-02-14 18:27, Omair Majid wrote: > * Andrew Hughes [2014-02-13 23:59]: >> As I said in the previous e-mail, the minimum I'd be happy with is if >> the current patch was updated so settings weren't being hardcoded into >> the makefiles. Passing them from configure would be sufficient for now, >> then it can be replaced by PKG_CONFIG. > How does this updated patch look: > http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/03/ > http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/03-jdk/ > > Thanks, > Omair > From alexandr.scherbatiy at oracle.com Mon Feb 17 03:04:16 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 17 Feb 2014 15:04:16 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <52FCB213.9020208@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> <52F393C1.7080702@oracle.com> <52F39437.6010307@oracle.com> <52F880D7.3080804@oracle.com> <52FCB213.9020208@oracle.com> Message-ID: <5301ECB0.5080803@oracle.com> I use the jtreg 4.1 fcs b05 and it fails the test with System.exit() with zero and non-zero exit value: ------- test.java ------------------------- /** * @test * @bug 8000000 * @run main test */ public class test { public static void main(String[] args) throws Exception { int exitStatus = 0; System.out.println("Exit status: " + exitStatus); System.exit(exitStatus); } } -------------------------------- TEST RESULT: Failed. Unexpected exit from test [exit code: 0] Is your test passed in this case? Thanks, Alexandr. On 2/13/2014 3:52 PM, Konstantin Shefov wrote: > Reminder > > On 10-Feb-14 11:33, Konstantin Shefov wrote: >> Please, review this test fix. >> The test blocks automated test execution, so should be fixed. >> >> Thanks >> -Konstantin >> >> On 06-Feb-14 17:55, Sergey Bylokhov wrote: >>> Thanks. >>> Then the fix looks good. >>> >>> On 06.02.2014 17:53, Konstantin Shefov wrote: >>>> >>>> On 06-Feb-14 17:49, Konstantin Shefov wrote: >>>>> Sergey, >>>>> This System.exit will never be seen by jtreg, more than that, this >>>>> test already has system.exit and will not work without it. >>>> System.exit is invoked by child vm, child vm is NOT controlled by >>>> JTREG at all. >>>>> >>>>> Konstantin >>>>> >>>>> On 06-Feb-14 17:21, Sergey Bylokhov wrote: >>>>>> Hi, Konstantin. >>>>>> The tests should not use System.exit() , it can be forbidden in >>>>>> some modes of jtreg. >>>>>> >>>>>> On 06.02.2014 17:03, Konstantin Shefov wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> please review the fix >>>>>>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>>>>>> for >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>>>>>> >>>>>>> Test hangs on windows if test frames are covered by a window of >>>>>>> some other app. >>>>>>> >>>>>>> Thanks, >>>>>>> Konstantin >>>>>> >>>>>> >>>>> >>>> >>> >>> >> > From konstantin.shefov at oracle.com Mon Feb 17 03:05:56 2014 From: konstantin.shefov at oracle.com (Konstantin Shefov) Date: Mon, 17 Feb 2014 15:05:56 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <5301ECB0.5080803@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> <52F393C1.7080702@oracle.com> <52F39437.6010307@oracle.com> <52F880D7.3080804@oracle.com> <52FCB213.9020208@oracle.com> <5301ECB0.5080803@oracle.com> Message-ID: <5301ED14.1050701@oracle.com> Alexandr, System.exit(exitStatus) in my test is called only by child JVM process, JTREG does not know about it. Test passes in my case. We had already the same discussion with Sergey Bylokhov (see below). Thanks, Konstantin On 17-Feb-14 15:04, Alexander Scherbatiy wrote: > > I use the jtreg 4.1 fcs b05 and it fails the test with System.exit() > with zero and non-zero exit value: > ------- test.java ------------------------- > /** > * @test > * @bug 8000000 > * @run main test > */ > public class test { > > public static void main(String[] args) throws Exception { > > int exitStatus = 0; > System.out.println("Exit status: " + exitStatus); > System.exit(exitStatus); > } > } > -------------------------------- > TEST RESULT: Failed. Unexpected exit from test [exit code: 0] > > Is your test passed in this case? > > Thanks, > Alexandr. > > > On 2/13/2014 3:52 PM, Konstantin Shefov wrote: >> Reminder >> >> On 10-Feb-14 11:33, Konstantin Shefov wrote: >>> Please, review this test fix. >>> The test blocks automated test execution, so should be fixed. >>> >>> Thanks >>> -Konstantin >>> >>> On 06-Feb-14 17:55, Sergey Bylokhov wrote: >>>> Thanks. >>>> Then the fix looks good. >>>> >>>> On 06.02.2014 17:53, Konstantin Shefov wrote: >>>>> >>>>> On 06-Feb-14 17:49, Konstantin Shefov wrote: >>>>>> Sergey, >>>>>> This System.exit will never be seen by jtreg, more than that, this >>>>>> test already has system.exit and will not work without it. >>>>> System.exit is invoked by child vm, child vm is NOT controlled by >>>>> JTREG at all. >>>>>> >>>>>> Konstantin >>>>>> >>>>>> On 06-Feb-14 17:21, Sergey Bylokhov wrote: >>>>>>> Hi, Konstantin. >>>>>>> The tests should not use System.exit() , it can be forbidden in >>>>>>> some modes of jtreg. >>>>>>> >>>>>>> On 06.02.2014 17:03, Konstantin Shefov wrote: >>>>>>>> Hi all, >>>>>>>> >>>>>>>> please review the fix >>>>>>>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>>>>>>> for >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>>>>>>> >>>>>>>> Test hangs on windows if test frames are covered by a window of >>>>>>>> some other app. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Konstantin >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> >>> >> > From alexandr.scherbatiy at oracle.com Mon Feb 17 04:49:44 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 17 Feb 2014 16:49:44 +0400 Subject: [9] Review request for 8017456: [TEST_BUG] java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html: test frames remain after test execution In-Reply-To: <5301ED14.1050701@oracle.com> References: <52F38837.9090805@oracle.com> <52F38C4E.6020402@oracle.com> <52F39304.1060304@oracle.com> <52F393C1.7080702@oracle.com> <52F39437.6010307@oracle.com> <52F880D7.3080804@oracle.com> <52FCB213.9020208@oracle.com> <5301ECB0.5080803@oracle.com> <5301ED14.1050701@oracle.com> Message-ID: <53020568.1000604@oracle.com> The fix looks good for me. Thanks, Alexandr. On 2/17/2014 3:05 PM, Konstantin Shefov wrote: > Alexandr, > > System.exit(exitStatus) in my test is called only by child JVM > process, JTREG does not know about it. > Test passes in my case. > We had already the same discussion with Sergey Bylokhov (see below). > > Thanks, > Konstantin > > On 17-Feb-14 15:04, Alexander Scherbatiy wrote: >> >> I use the jtreg 4.1 fcs b05 and it fails the test with >> System.exit() with zero and non-zero exit value: >> ------- test.java ------------------------- >> /** >> * @test >> * @bug 8000000 >> * @run main test >> */ >> public class test { >> >> public static void main(String[] args) throws Exception { >> >> int exitStatus = 0; >> System.out.println("Exit status: " + exitStatus); >> System.exit(exitStatus); >> } >> } >> -------------------------------- >> TEST RESULT: Failed. Unexpected exit from test [exit code: 0] >> >> Is your test passed in this case? >> >> Thanks, >> Alexandr. >> >> >> On 2/13/2014 3:52 PM, Konstantin Shefov wrote: >>> Reminder >>> >>> On 10-Feb-14 11:33, Konstantin Shefov wrote: >>>> Please, review this test fix. >>>> The test blocks automated test execution, so should be fixed. >>>> >>>> Thanks >>>> -Konstantin >>>> >>>> On 06-Feb-14 17:55, Sergey Bylokhov wrote: >>>>> Thanks. >>>>> Then the fix looks good. >>>>> >>>>> On 06.02.2014 17:53, Konstantin Shefov wrote: >>>>>> >>>>>> On 06-Feb-14 17:49, Konstantin Shefov wrote: >>>>>>> Sergey, >>>>>>> This System.exit will never be seen by jtreg, more than that, this >>>>>>> test already has system.exit and will not work without it. >>>>>> System.exit is invoked by child vm, child vm is NOT controlled by >>>>>> JTREG at all. >>>>>>> >>>>>>> Konstantin >>>>>>> >>>>>>> On 06-Feb-14 17:21, Sergey Bylokhov wrote: >>>>>>>> Hi, Konstantin. >>>>>>>> The tests should not use System.exit() , it can be forbidden in >>>>>>>> some modes of jtreg. >>>>>>>> >>>>>>>> On 06.02.2014 17:03, Konstantin Shefov wrote: >>>>>>>>> Hi all, >>>>>>>>> >>>>>>>>> please review the fix >>>>>>>>> http://cr.openjdk.java.net/~kshefov/8017456/webrev.00 >>>>>>>>> for >>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8017456 >>>>>>>>> >>>>>>>>> Test hangs on windows if test frames are covered by a window of >>>>>>>>> some other app. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Konstantin >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>> >>> >> > From dmitry.markov at oracle.com Mon Feb 17 04:49:00 2014 From: dmitry.markov at oracle.com (dmitry markov) Date: Mon, 17 Feb 2014 16:49:00 +0400 Subject: [7u] Review request for 7171045 [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag. In-Reply-To: <52F9F190.6090503@oracle.com> References: <52F9F190.6090503@oracle.com> Message-ID: <5302053C.3080709@oracle.com> Reminder. Could you review this, please? Thanks, Dmitry On 11/02/2014 13:46, dmitry markov wrote: > Hello, > > Could you review a back-port of 7171045 to JDK 7u, please? The > back-port and the main fix integrated into JDK 8 are slightly different. > > bug: http://bugs.sun.com/view_bug.do?bug_id=7171045 > webrev for jdk7u: > http://cr.openjdk.java.net/~dmarkov/7171045/jdk7u/webrev.00/ > jdk8 changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1 > technical review for jdk8: > http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003238.html > > Please note: the fix for 7171045 was partly backported to JDK 7u (see > http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003376.html > for details). However, some problems related to this case still take > place on JDK 7u. So it is necessary to backport full changeset > integrated into JDK 8. > > Thanks, > Dmitry From Sergey.Bylokhov at oracle.com Mon Feb 17 05:17:38 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 17 Feb 2014 17:17:38 +0400 Subject: [9] Review request for 8032078: CPlatformWindow.setWindowState throws RuntimeException, if windowState=ICONIFIED|MAXIMIZED_BOTH In-Reply-To: <52E26E0C.7090501@oracle.com> References: <52DE59BE.80907@oracle.com> <607D029B-D860-4E41-80DC-FAE824071E22@oracle.com> <52E26E0C.7090501@oracle.com> Message-ID: <53020BF2.7090407@oracle.com> Hi, Anton. I suppose that CPW should have the same behavior on setVisible() and setExtendedState() for compound states? Also I suggest to change comment to describe that on macosx we support ICONIFY state only for compounds states, currently the comment is quite obvious. Probably the code could be improved and we can change windowState to ICONIFY before the switch for compound states? On 24.01.2014 17:43, Anton Litvinov wrote: > Hello Petr, > > Thank you very much for review of this fix. I am not sure that the > behavior of "ICONIFIED | MAXIMIZED_BOTH" should be completely the same > as "ICONIFIED" on OS X, but I think that in this bitwise mask the most > important bit is "ICONIFIED". And, if this compound state is valid, > then as a result the window should be minimized. > > This combination of flags is handled absolutely differently in > Windows, Solaris/Linux implementation of JDK. Particularly on Windows > the frame becomes minimized and will be always maximized, if the > frame's icon on the taskbar is clicked. But "Frame.getExtendedState", > "WFramePeer.getState()" will not always return "ICONIFIED | > MAXIMIZED_BOTH", instead of this "ICONIFIED" will be returned, when > before a call to "Frame.setExtendedState" method "Frame.state" was not > "MAXIMIZED_BOTH". > > The common feature of Windows and Solaris/Linux code is the fact that > the implementation of "java.awt.peer.FramePeer.setState" does not > throw an exception unlike OS X code. > > Yes, this bug may be fixed in "Frame.isFrameStateSupported", but the > change will require introduction of code checking, either it is > executed on OS X platform or not, because this method should not be > changed for other platforms, since they depend on it for a long time > since 2004, when it was introduced by the fix for the bug JDK-4987087. > From my opinion, making "Frame.isFrameStateSupported" return false for > this compound state on OS X platform will make the code of this method > not truly shared and will not let code calling > "Frame.setExtendedState" with the state "ICONIFIED | MAXIMIZED_BOTH" > to minimize the frame. > > Thank you, > Anton > > On 1/21/2014 4:26 PM, Petr Pchelko wrote: >> Hello, Anton. >> >> Are we sure that the behavior of ICONIFIED | MAXIMIZED_BOTH should be >> the same as just ICONIFIED? >> What does this combination of flags do on other platforms? >> >> I would expect that if the frame is not maximized, this combination >> would iconify it, but when you deiconify the frame >> should go to maximized state. However, I?m quite sure you can?t do it >> like this on Mac OS X, because we use the native >> zoom mechanism for maximization and do not have enough control over >> it. So, in my opinion this should be fixed by >> making Frame.isFrameStateSupported return false for this combination. >> What do you think? >> >> With best regards. Petr. >> >> 21 ???. 2014 ?., ? 3:27 ????? ???????, Anton >> Litvinov ???????(?): >> >>> Hello, >>> >>> Could you please review the following fix for the bug. >>> >>> Bug:https://bugs.openjdk.java.net/browse/JDK-8032078 >>> Webrev:http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.00 >>> >>> The bug consists in undocumented throwing of "RuntimeException" from >>> the method "Frame.setExtendedState" for the compound state >>> "ICONIFIED | MAXIMIZED_BOTH" that is supported according to a result >>> of "Frame.isFrameStateSupported" method call on OS X. >>> >>> The solution adds handling of the mask "ICONIFIED | MAXIMIZED_BOTH" >>> to "switch" block of the method >>> "sun.lwawt.macosx.CPlatformWindow.setWindowState" which duplicates >>> existing handling of the state "ICONIFIED" and prevents from >>> throwing of the exception. >>> >>> Thank you, >>> Anton > -- Best regards, Sergey. From anton.tarasov at oracle.com Mon Feb 17 06:09:49 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Mon, 17 Feb 2014 18:09:49 +0400 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52FEBC4E.9010202@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> <52FA67A8.1010600@oracle.com> <52FA7DCD.80405@oracle.com> <52FCC28D.5010007@oracle.com> <52FD4CB6.2090805@oracle.com> <52FDC1D1.8050907@oracle.com> <52FEBC4E.9010202@oracle.com> Message-ID: <5302182D.3070600@oracle.com> Jim, so this is ready for a push then. Thanks! Anton. On 15.02.2014 5:01, Jim Graham wrote: > I don't need to see an update for that. I didn't read the entire webrev, but I looked at this one > piece of code and if that was the only thing changed then I think that dealt with the outstanding > issues... > > ...jim > > On 2/13/14 11:12 PM, Anton V. Tarasov wrote: >> On 14.02.2014 2:52, Jim Graham wrote: >>> >>> >>> On 2/13/14 5:03 AM, Anton V. Tarasov wrote: >>>> Hi Jim, >>>> >>>> Please, look at the update: >>>> >>>> http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.5 >>>> >>>> Here I'm correcting the rect after the transform in SG2D: >>>> >>>> 2123 // In case of negative scale transform, reflect the rect >>>> coords. >>>> 2124 if (w < 0) { >>>> 2125 w *= -1; >>>> 2126 x -= w; >>>> 2127 } >>>> 2128 if (h < 0) { >>>> 2129 h *= -1; >>>> 2130 y -= h; >>>> 2131 } >>>> >>>> >>>> The blit direction (dx, dy) remains transformed. Is this the right >>>> behavior from your perspective? >>> >>> Yes, that looks good. I wonder if the "w *= -1" results in a multiply >>> byte code whereas "w = -w" would avoid the multiply? >>> >>> ...jim >> >> Jim, >> >> Yes, this indeed results in different byte code instructions (imult & >> ineg). Just for curiosity I did some measuring which showed negatioation >> worked 10% faster :) >> Well, I'll fix it but let me please not send an update... >> >> Thanks! >> Anton. >> From alexandr.scherbatiy at oracle.com Mon Feb 17 06:38:19 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 17 Feb 2014 18:38:19 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <52FDFB29.4060901@oracle.com> References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> <52FDF0C0.6070200@oracle.com> <52FDFB29.4060901@oracle.com> Message-ID: <53021EDB.5010807@oracle.com> On 2/14/2014 3:16 PM, Sergey Bylokhov wrote: > On 2/14/14 2:32 PM, Alexander Scherbatiy wrote: >> On 2/14/2014 2:12 AM, Sergey Bylokhov wrote: >>> Hi, Alexander. >>> Did you check option of loading of the picture on demand?Since most >>> of the time x2 version is useless on non hdpi and vice versa. > Yes but in this particular case menu items will be painted in one > particular scale only. I have created the separate issue on it: 8035069 [macosx] Loading resolution variants by demand https://bugs.openjdk.java.net/browse/JDK-8035069 Thanks, Alexandr. >> It's not quite true. >> MacOSX choses a necessary image representation based on the >> current transformations. Setting current transformation to scale 2x >> leads >> that the high resolution image is drawn even on non HiDPI display. >> >> There is a similar mechanism for the MultiResolution toolkit >> images. The base image is drawn in case if the high-resolution image >> has not been loaded yet. >> It has an issue that if there is no one more repaint event the >> image with high resolution is not shown. >> >> I would suggest to move this topic to a separate issue. >> >> Thanks, >> Alexandr. >> >>> >>> On 13.02.2014 18:04, Alexander Scherbatiy wrote: >>>> >>>> Hello, >>>> >>>> Could you review the fix: >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8031573 >>>> webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 >>>> >>>> The NSMenu* system icons are templates and do not have image >>>> representations. >>>> >>>> The fix retrieves images with original and double size from an >>>> NSImage and put them to a MultiResolution image. >>>> The fix also adds sun.awt.image.MultiResolutionBufferedImage >>>> class which can be used uniformly for a Multiresolution image >>>> creation. >>>> >>>> The fix is independent of the fix 8033534 Get MultiResolution >>>> image from native system >>>> http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html >>>> >>>> because CImage.createImageFromName(imageName) never returns a >>>> MultiResolution image for templates. >>>> But the fix 8033534 can be updated to use the >>>> MultiResolutionBufferedImage. >>>> >>>> Thanks, >>>> Alexandr. >>>> >>> >>> >> > > From petr.pchelko at oracle.com Tue Feb 18 01:47:36 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Tue, 18 Feb 2014 13:47:36 +0400 Subject: [9] Review Request: JDK-8035147 [macosx] Drag and Drop tests are failing with -Xchech:jni Message-ID: <086FED90-2830-428A-BDA6-5D9CF0E0BA61@oracle.com> Hello, AWT team. Please review the fix for the issue: https://bugs.openjdk.java.net/browse/JDK-8035147 The fix is available at: http://cr.openjdk.java.net/~pchelko/9/8035147/webrev.00/ The problem was that we were creating global references in the wrong place - after redispatching them to the Appkit thread and not before. Also I've made a small refactoring to pass the drag image ptr to native directly intead of making an upcall to get it from an object. Thank you. With best regards. Petr. From alexander.zvegintsev at oracle.com Tue Feb 18 02:37:23 2014 From: alexander.zvegintsev at oracle.com (Alexander Zvegintsev) Date: Tue, 18 Feb 2014 14:37:23 +0400 Subject: [9] Review Request: JDK-8035147 [macosx] Drag and Drop tests are failing with -Xchech:jni In-Reply-To: <086FED90-2830-428A-BDA6-5D9CF0E0BA61@oracle.com> References: <086FED90-2830-428A-BDA6-5D9CF0E0BA61@oracle.com> Message-ID: <530337E3.7090607@oracle.com> Hi Petr, the fix looks good to me. Thanks, Alexander. On 02/18/2014 01:47 PM, Petr Pchelko wrote: > Hello, AWT team. > > Please review the fix for the issue: > https://bugs.openjdk.java.net/browse/JDK-8035147 > The fix is available at: > http://cr.openjdk.java.net/~pchelko/9/8035147/webrev.00/ > > The problem was that we were creating global references in the wrong place - after redispatching them to the Appkit thread and not before. > Also I've made a small refactoring to pass the drag image ptr to native directly intead of making an upcall to get it from an object. > > Thank you. > With best regards. Petr. From Sergey.Bylokhov at oracle.com Tue Feb 18 04:00:15 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 18 Feb 2014 16:00:15 +0400 Subject: [9] Review Request: JDK-8035147 [macosx] Drag and Drop tests are failing with -Xchech:jni In-Reply-To: <086FED90-2830-428A-BDA6-5D9CF0E0BA61@oracle.com> References: <086FED90-2830-428A-BDA6-5D9CF0E0BA61@oracle.com> Message-ID: <53034B4F.9010604@oracle.com> Hi, Petr. The fix looks good. On 18.02.2014 13:47, Petr Pchelko wrote: > Hello, AWT team. > > Please review the fix for the issue: > https://bugs.openjdk.java.net/browse/JDK-8035147 > The fix is available at: > http://cr.openjdk.java.net/~pchelko/9/8035147/webrev.00/ > > The problem was that we were creating global references in the wrong place - after redispatching them to the Appkit thread and not before. > Also I've made a small refactoring to pass the drag image ptr to native directly intead of making an upcall to get it from an object. > > Thank you. > With best regards. Petr. -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Tue Feb 18 04:20:45 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 18 Feb 2014 16:20:45 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <53021EDB.5010807@oracle.com> References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> <52FDF0C0.6070200@oracle.com> <52FDFB29.4060901@oracle.com> <53021EDB.5010807@oracle.com> Message-ID: <5303501D.9010108@oracle.com> Hi, Alexander. The fix looks good then. On 17.02.2014 18:38, Alexander Scherbatiy wrote: > On 2/14/2014 3:16 PM, Sergey Bylokhov wrote: >> On 2/14/14 2:32 PM, Alexander Scherbatiy wrote: >>> On 2/14/2014 2:12 AM, Sergey Bylokhov wrote: >>>> Hi, Alexander. >>>> Did you check option of loading of the picture on demand?Since most >>>> of the time x2 version is useless on non hdpi and vice versa. >> Yes but in this particular case menu items will be painted in one >> particular scale only. > > I have created the separate issue on it: 8035069 [macosx] Loading > resolution variants by demand > https://bugs.openjdk.java.net/browse/JDK-8035069 > > Thanks, > Alexandr. >>> It's not quite true. >>> MacOSX choses a necessary image representation based on the >>> current transformations. Setting current transformation to scale 2x >>> leads >>> that the high resolution image is drawn even on non HiDPI display. >>> >>> There is a similar mechanism for the MultiResolution toolkit >>> images. The base image is drawn in case if the high-resolution image >>> has not been loaded yet. >>> It has an issue that if there is no one more repaint event the >>> image with high resolution is not shown. >>> >>> I would suggest to move this topic to a separate issue. >>> >>> Thanks, >>> Alexandr. >>> >>>> >>>> On 13.02.2014 18:04, Alexander Scherbatiy wrote: >>>>> >>>>> Hello, >>>>> >>>>> Could you review the fix: >>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8031573 >>>>> webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 >>>>> >>>>> The NSMenu* system icons are templates and do not have image >>>>> representations. >>>>> >>>>> The fix retrieves images with original and double size from an >>>>> NSImage and put them to a MultiResolution image. >>>>> The fix also adds sun.awt.image.MultiResolutionBufferedImage >>>>> class which can be used uniformly for a Multiresolution image >>>>> creation. >>>>> >>>>> The fix is independent of the fix 8033534 Get MultiResolution >>>>> image from native system >>>>> http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html >>>>> >>>>> because CImage.createImageFromName(imageName) never returns a >>>>> MultiResolution image for templates. >>>>> But the fix 8033534 can be updated to use the >>>>> MultiResolutionBufferedImage. >>>>> >>>>> Thanks, >>>>> Alexandr. >>>>> >>>> >>>> >>> >> >> > -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Tue Feb 18 05:52:46 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 18 Feb 2014 17:52:46 +0400 Subject: [9] Review Request: JDK-7185258 [macosx] Deadlock in SunToolKit.realSync() In-Reply-To: <66F0D2C1-E7A9-4B5B-9BF0-99DDC2D17F8F@oracle.com> References: <52B8ADEE.90409@oracle.com> <52B943EF.8060700@oracle.com> <66F0D2C1-E7A9-4B5B-9BF0-99DDC2D17F8F@oracle.com> Message-ID: <530365AE.5030206@oracle.com> Hi, Petr. A few comments: case RESULT_TIMEOUT: 412 if (EventQueue.isDispatchThread()) { 413 // Deadlocked. Have to return and let EDT process some events Comment is not accurate. Most of the time syncNativeQueue is called on EDT and deadlock is possible but not necessary. 414 return false; 415 } else { 416 // The timeout is too low, because deadlock is impossible. 417 // Make another attempt to flush with bigger timeout. 418 waitTime += 100; What happens if syncNativeQueue is called on Appkit? 419 } 420 break; On 17.01.2014 17:52, Petr Pchelko wrote: > Hello, AWT Team. > > Let's reveal this discussion. > > The bug: https://bugs.openjdk.java.net/browse/JDK-7185258 > The fix: http://cr.openjdk.java.net/~pchelko/9/7185258/webrev.01/ > > This review was left because there was an idea to use a different approach to this problem: just use the timeout, detect a deadlock and return false from syncNativeQueue. > I've implemented this approach and played with it, but it appears to work not really well. The problem is the timeout: if we set it too little we would have too many false positive deadlocks > which would result in bad synchronization and tremendously increasing probability of the InfiniteLoop exception. If the timeout is too big tests slow down badly, but what's even worse - if we wait > for a deadlock too long some events could get posted to EDT (repaints, timer updates etc..) resulting in an InfiniteLoop exception. So, I've decided to return back to my original approach. > > The idea of this fix is to interrupt waiting as soon as we detect that we've got into the nested Appkit loop. This happens in DnD and in LWCToolkit.invokeAndWait. > > With this fix several tests start to pass. Tested on DnD-related regression tests. > >>>> 2. To dispatch some DropTarget events on EDT synchronously we start our own nested loop in doAWTRunLoop using the ToolkitThreadBlockedHandler. In this case we do process the events in a nested runLoop. >>>> This case might actually be a bug, because we are short-circuiting normal event processing and could "steal" some events from Cocoa. But I would not address this it in this fix. >>> Probably it is a good time to realize how it should work? Since the fix adds complexity which can not be necessary in the future. >> I agree. But this would be a long investigation, so let's leave this review until I find out how we should really work. > This question arises during the review. It's not related, but anyway: > Our nested loop is indeed quite dangerous, because it could really still events from Cocoa, so it should be used with great cation. But we need to process the events in this nested loop, because DropTarget event handlers are called > synchronously and opening a modal dialog in such a handler would completely block the application if we do not process events in nested loop. So, everything works fine right now. > > With best regards. Petr. > > On 24.12.2013, at 12:30, Petr Pchelko wrote: > >> Hello, Sergey. >> >>>>> As I remember doAWTRunLoop process events and selectors in case of drags/DnD otherwise how we got mouse events? Or I have missed something? >>>> In case of DnD we have several nested loops in place: >>>> 1. The native Cocoa DnD nested loop. It's started within the NSView dragImage:... call. It processes only the DnD-related events - some mouse events, some key events and flag changed events. This is for the DragSource. >>> And we cannot emulate such event in postDummyevent? >> We could post something like a dummy MouseUp event and get rid of it in the NSApplication sendEvent:..., but I don't like such a solution. >> May be Cocoa has more nested event loops we do not know about yet which do not accept MouseUp. The same would be valid for any event type. >> >>>> 2. To dispatch some DropTarget events on EDT synchronously we start our own nested loop in doAWTRunLoop using the ToolkitThreadBlockedHandler. In this case we do process the events in a nested runLoop. >>>> This case might actually be a bug, because we are short-circuiting normal event processing and could "steal" some events from Cocoa. But I would not address this it in this fix. >>> Probably it is a good time to realize how it should work? Since the fix adds complexity which can not be necessary in the future. >> I agree. But this would be a long investigation, so let's leave this review until I find out how we should really work. >> >> With best regards. Petr. >> >> On 24.12.2013, at 12:21, Sergey Bylokhov wrote: >> >>> On 12/24/13 11:57 AM, Petr Pchelko wrote: >>>> Hello, Sergey. >>>> >>>>> As I remember doAWTRunLoop process events and selectors in case of drags/DnD otherwise how we got mouse events? Or I have missed something? >>>> In case of DnD we have several nested loops in place: >>>> 1. The native Cocoa DnD nested loop. It's started within the NSView dragImage:... call. It processes only the DnD-related events - some mouse events, some key events and flag changed events. This is for the DragSource. >>> And we cannot emulate such event in postDummyevent? >>>> 2. To dispatch some DropTarget events on EDT synchronously we start our own nested loop in doAWTRunLoop using the ToolkitThreadBlockedHandler. In this case we do process the events in a nested runLoop. >>>> This case might actually be a bug, because we are short-circuiting normal event processing and could "steal" some events from Cocoa. But I would not address this it in this fix. >>> Probably it is a good time to realize how it should work? Since the fix adds complexity which can not be necessary in the future. >>>> Without the DnD we use a doAWTRunLoop which does not process events. (Except the case with Single-Threaded Interop with FX). >>>> >>>> Actually, after some more thinking I believe I should reimplement the fix and follow Anthony's suggestion with a timeout, because my fix is too complex. I'll send a new webrev later today. >>>> >>>> With best regards. Petr. >>>> >>>> On 24.12.2013, at 1:41, Sergey Bylokhov wrote: >>>> >>>>> Hi, Petr. >>>>> On 23.12.2013 16:54, Petr Pchelko wrote: >>>>>> The problem: >>>>>> nativeSyncQueue synchronizes the native event queue. However, there are several situations when a dummy event posted to the native queue is not dispatched. These are our own nested loop in doAWTRunLoop and Cocoa's internal nested loop in NSView:dragImage. >>>>> As I remember doAWTRunLoop process events and selectors in case of drags/DnD otherwise how we got mouse events? Or I have missed something? >>>>> >>>>>> Solution: >>>>>> >>>>>> 1. The interruptNativeSyncQueue was introduced. In case we are waiting for the native event queue this method interrupts waiting, otherwise it's a no-op. This is needed for the following reason: suppose the nativeSyncQueue is called on EDT. While the queue is flushed some event was processed which caused us to call doAWTRunLoop. As EDT is blocked we would have got a deadlock. Interrupting the wait lets EDT flush it's events and lets AppKit exit a nested loop. When the nativeSyncQueue is interrupted we do not immediately exit realSync, but flush EDT and try to sync native queue again. Most likely in this case we would not be in a nested loop and will successfully sync a native queue. >>>>>> >>>>>> 2. A lightweight version of nativeSyncQueue was introduced. This one does not flush the event queue, it only flushes a selector queue. This is needed to not deadlock when realSync was called during DnD. Suppose nativeSyncQueue is called while the app is in the native nested dragging loop. Until dragging operation finishes only dragging-related events will be processed. So we have no opportunity to flush the queue as our dummy event will be blocked by a dragging nested loop. >>>>>> >>>>>> I've tested it by running almost all awt and swing tests. No new failures, some tests start to pass after the fix. >>>>>> >>>>>> With best regards. Petr. >>>>>> >>>>>> >>>>> -- >>>>> Best regards, Sergey. >>>>> >>> >>> -- >>> Best regards, Sergey. >>> -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Tue Feb 18 06:16:57 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 18 Feb 2014 18:16:57 +0400 Subject: [9] Review Request: 6744401 Consider removal of code disabling JIT in Toolkit.getDefaultToolkit Message-ID: <53036B59.8040107@oracle.com> Hello. Please review the fix for jdk 9. - jit related methods were removed(see http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-February/013482.html) - Small cleanup - Note that i did not convert the code to lambda, because toolkit initialization in this case two times slower. Bug: https://bugs.openjdk.java.net/browse/JDK-6744401 Webrev can be found at: http://cr.openjdk.java.net/~serb/6744401/webrev.00 -- Best regards, Sergey. From anton.litvinov at oracle.com Tue Feb 18 06:25:10 2014 From: anton.litvinov at oracle.com (Anton Litvinov) Date: Tue, 18 Feb 2014 18:25:10 +0400 Subject: [9] Review request for 8032078: CPlatformWindow.setWindowState throws RuntimeException, if windowState=ICONIFIED|MAXIMIZED_BOTH In-Reply-To: <53020BF2.7090407@oracle.com> References: <52DE59BE.80907@oracle.com> <607D029B-D860-4E41-80DC-FAE824071E22@oracle.com> <52E26E0C.7090501@oracle.com> <53020BF2.7090407@oracle.com> Message-ID: <53036D46.2030303@oracle.com> Hello Sergey, Thank you for the review of this fix. The fix was corrected to address your remarks. Could you please review the new version of the fix. Webrev: http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.01 Changes in the fix are following: 1. Check for a compound state with ICONIFIED bit was moved from "switch" block of "CPlatformWindow.setWindowState" method to the separate "if" statement before "switch" block. 2. The same pattern was applied also to "CPlatformWindow.setVisible" method. 3. The comment was changed. 4. The regression test was changed to also check cases with undecorated frame and to verify that changes between the states "ICONIFIED | MAXIMIZED_BOTH <--> NORMAL, ICONIFIED, MAXIMIZED_BOTH" are committed properly and do not raise exceptions. Thank you, Anton On 2/17/2014 5:17 PM, Sergey Bylokhov wrote: > Hi, Anton. > I suppose that CPW should have the same behavior on setVisible() and > setExtendedState() for compound states? > Also I suggest to change comment to describe that on macosx we support > ICONIFY state only for compounds states, currently the comment is > quite obvious. Probably the code could be improved and we can change > windowState to ICONIFY before the switch for compound states? > > On 24.01.2014 17:43, Anton Litvinov wrote: >> Hello Petr, >> >> Thank you very much for review of this fix. I am not sure that the >> behavior of "ICONIFIED | MAXIMIZED_BOTH" should be completely the >> same as "ICONIFIED" on OS X, but I think that in this bitwise mask >> the most important bit is "ICONIFIED". And, if this compound state is >> valid, then as a result the window should be minimized. >> >> This combination of flags is handled absolutely differently in >> Windows, Solaris/Linux implementation of JDK. Particularly on Windows >> the frame becomes minimized and will be always maximized, if the >> frame's icon on the taskbar is clicked. But "Frame.getExtendedState", >> "WFramePeer.getState()" will not always return "ICONIFIED | >> MAXIMIZED_BOTH", instead of this "ICONIFIED" will be returned, when >> before a call to "Frame.setExtendedState" method "Frame.state" was >> not "MAXIMIZED_BOTH". >> >> The common feature of Windows and Solaris/Linux code is the fact that >> the implementation of "java.awt.peer.FramePeer.setState" does not >> throw an exception unlike OS X code. >> >> Yes, this bug may be fixed in "Frame.isFrameStateSupported", but the >> change will require introduction of code checking, either it is >> executed on OS X platform or not, because this method should not be >> changed for other platforms, since they depend on it for a long time >> since 2004, when it was introduced by the fix for the bug >> JDK-4987087. From my opinion, making "Frame.isFrameStateSupported" >> return false for this compound state on OS X platform will make the >> code of this method not truly shared and will not let code calling >> "Frame.setExtendedState" with the state "ICONIFIED | MAXIMIZED_BOTH" >> to minimize the frame. >> >> Thank you, >> Anton >> >> On 1/21/2014 4:26 PM, Petr Pchelko wrote: >>> Hello, Anton. >>> >>> Are we sure that the behavior of ICONIFIED | MAXIMIZED_BOTH should >>> be the same as just ICONIFIED? >>> What does this combination of flags do on other platforms? >>> >>> I would expect that if the frame is not maximized, this combination >>> would iconify it, but when you deiconify the frame >>> should go to maximized state. However, I?m quite sure you can?t do >>> it like this on Mac OS X, because we use the native >>> zoom mechanism for maximization and do not have enough control over >>> it. So, in my opinion this should be fixed by >>> making Frame.isFrameStateSupported return false for this >>> combination. What do you think? >>> >>> With best regards. Petr. >>> >>> 21 ???. 2014 ?., ? 3:27 ????? ???????, Anton >>> Litvinov ???????(?): >>> >>>> Hello, >>>> >>>> Could you please review the following fix for the bug. >>>> >>>> Bug:https://bugs.openjdk.java.net/browse/JDK-8032078 >>>> Webrev:http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.00 >>>> >>>> The bug consists in undocumented throwing of "RuntimeException" >>>> from the method "Frame.setExtendedState" for the compound state >>>> "ICONIFIED | MAXIMIZED_BOTH" that is supported according to a >>>> result of "Frame.isFrameStateSupported" method call on OS X. >>>> >>>> The solution adds handling of the mask "ICONIFIED | MAXIMIZED_BOTH" >>>> to "switch" block of the method >>>> "sun.lwawt.macosx.CPlatformWindow.setWindowState" which duplicates >>>> existing handling of the state "ICONIFIED" and prevents from >>>> throwing of the exception. >>>> >>>> Thank you, >>>> Anton >> > > From Sergey.Bylokhov at oracle.com Tue Feb 18 06:35:36 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 18 Feb 2014 18:35:36 +0400 Subject: [9] Review request for 8032078: CPlatformWindow.setWindowState throws RuntimeException, if windowState=ICONIFIED|MAXIMIZED_BOTH In-Reply-To: <53036D46.2030303@oracle.com> References: <52DE59BE.80907@oracle.com> <607D029B-D860-4E41-80DC-FAE824071E22@oracle.com> <52E26E0C.7090501@oracle.com> <53020BF2.7090407@oracle.com> <53036D46.2030303@oracle.com> Message-ID: <53036FB8.9040407@oracle.com> Hi, Anton. The fix looks good to me. But since you change setVisible() method you need to check it in the test too. On 18.02.2014 18:25, Anton Litvinov wrote: > Hello Sergey, > > Thank you for the review of this fix. The fix was corrected to address > your remarks. Could you please review the new version of the fix. > > Webrev: http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.01 > > Changes in the fix are following: > > 1. Check for a compound state with ICONIFIED bit was moved from > "switch" block of "CPlatformWindow.setWindowState" method to the > separate "if" statement before "switch" block. > 2. The same pattern was applied also to "CPlatformWindow.setVisible" > method. > 3. The comment was changed. > 4. The regression test was changed to also check cases with > undecorated frame and to verify that changes between the states > "ICONIFIED | MAXIMIZED_BOTH <--> NORMAL, ICONIFIED, MAXIMIZED_BOTH" > are committed properly and do not raise exceptions. > > Thank you, > Anton > On 2/17/2014 5:17 PM, Sergey Bylokhov wrote: >> Hi, Anton. >> I suppose that CPW should have the same behavior on setVisible() and >> setExtendedState() for compound states? >> Also I suggest to change comment to describe that on macosx we >> support ICONIFY state only for compounds states, currently the >> comment is quite obvious. Probably the code could be improved and we >> can change windowState to ICONIFY before the switch for compound states? >> >> On 24.01.2014 17:43, Anton Litvinov wrote: >>> Hello Petr, >>> >>> Thank you very much for review of this fix. I am not sure that the >>> behavior of "ICONIFIED | MAXIMIZED_BOTH" should be completely the >>> same as "ICONIFIED" on OS X, but I think that in this bitwise mask >>> the most important bit is "ICONIFIED". And, if this compound state >>> is valid, then as a result the window should be minimized. >>> >>> This combination of flags is handled absolutely differently in >>> Windows, Solaris/Linux implementation of JDK. Particularly on >>> Windows the frame becomes minimized and will be always maximized, if >>> the frame's icon on the taskbar is clicked. But >>> "Frame.getExtendedState", "WFramePeer.getState()" will not always >>> return "ICONIFIED | MAXIMIZED_BOTH", instead of this "ICONIFIED" >>> will be returned, when before a call to "Frame.setExtendedState" >>> method "Frame.state" was not "MAXIMIZED_BOTH". >>> >>> The common feature of Windows and Solaris/Linux code is the fact >>> that the implementation of "java.awt.peer.FramePeer.setState" does >>> not throw an exception unlike OS X code. >>> >>> Yes, this bug may be fixed in "Frame.isFrameStateSupported", but the >>> change will require introduction of code checking, either it is >>> executed on OS X platform or not, because this method should not be >>> changed for other platforms, since they depend on it for a long time >>> since 2004, when it was introduced by the fix for the bug >>> JDK-4987087. From my opinion, making "Frame.isFrameStateSupported" >>> return false for this compound state on OS X platform will make the >>> code of this method not truly shared and will not let code calling >>> "Frame.setExtendedState" with the state "ICONIFIED | MAXIMIZED_BOTH" >>> to minimize the frame. >>> >>> Thank you, >>> Anton >>> >>> On 1/21/2014 4:26 PM, Petr Pchelko wrote: >>>> Hello, Anton. >>>> >>>> Are we sure that the behavior of ICONIFIED | MAXIMIZED_BOTH should >>>> be the same as just ICONIFIED? >>>> What does this combination of flags do on other platforms? >>>> >>>> I would expect that if the frame is not maximized, this combination >>>> would iconify it, but when you deiconify the frame >>>> should go to maximized state. However, I?m quite sure you can?t do >>>> it like this on Mac OS X, because we use the native >>>> zoom mechanism for maximization and do not have enough control over >>>> it. So, in my opinion this should be fixed by >>>> making Frame.isFrameStateSupported return false for this >>>> combination. What do you think? >>>> >>>> With best regards. Petr. >>>> >>>> 21 ???. 2014 ?., ? 3:27 ????? ???????, Anton >>>> Litvinov ???????(?): >>>> >>>>> Hello, >>>>> >>>>> Could you please review the following fix for the bug. >>>>> >>>>> Bug:https://bugs.openjdk.java.net/browse/JDK-8032078 >>>>> Webrev:http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.00 >>>>> >>>>> The bug consists in undocumented throwing of "RuntimeException" >>>>> from the method "Frame.setExtendedState" for the compound state >>>>> "ICONIFIED | MAXIMIZED_BOTH" that is supported according to a >>>>> result of "Frame.isFrameStateSupported" method call on OS X. >>>>> >>>>> The solution adds handling of the mask "ICONIFIED | >>>>> MAXIMIZED_BOTH" to "switch" block of the method >>>>> "sun.lwawt.macosx.CPlatformWindow.setWindowState" which duplicates >>>>> existing handling of the state "ICONIFIED" and prevents from >>>>> throwing of the exception. >>>>> >>>>> Thank you, >>>>> Anton >>> >> >> > -- Best regards, Sergey. From anthony.petrov at oracle.com Tue Feb 18 06:38:28 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Tue, 18 Feb 2014 18:38:28 +0400 Subject: [9] Review Request: 6744401 Consider removal of code disabling JIT in Toolkit.getDefaultToolkit In-Reply-To: <53036B59.8040107@oracle.com> References: <53036B59.8040107@oracle.com> Message-ID: <53037064.2090106@oracle.com> Hi Sergey, The fix looks good to me. -- best regards, Anthony On 2/18/2014 6:16 PM, Sergey Bylokhov wrote: > Hello. > Please review the fix for jdk 9. > - jit related methods were removed(see > http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-February/013482.html) > > - Small cleanup > - Note that i did not convert the code to lambda, because toolkit > initialization in this case two times slower. > > Bug: https://bugs.openjdk.java.net/browse/JDK-6744401 > Webrev can be found at: http://cr.openjdk.java.net/~serb/6744401/webrev.00 > From alexandr.scherbatiy at oracle.com Tue Feb 18 07:33:17 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Tue, 18 Feb 2014 19:33:17 +0400 Subject: [9] Review request for 8029339 Custom MultiResolution image support on HiDPI displays In-Reply-To: <52FC14EC.9080503@oracle.com> References: <52D51764.8020103@oracle.com> <52DF2F98.3030503@oracle.com> <52F4BCEB.9040702@oracle.com> <52F5782A.9060300@oracle.com> <52FB7E3E.6050000@oracle.com> <52FC14EC.9080503@oracle.com> Message-ID: <53037D3D.80709@oracle.com> Hi Jim, Let's divide the discussion into two part. 1. Where it is better to hold resolution variants? Putting resolution variants in Image class brings some questions like: - Some type of images do not need to have resolution variants - Should resolution variants have the same type as the base image? - getResolutionVariants() method can return copy of the original list so add/removeRV methods should be also added. There are pros and cons for placing resolution variants to Image class or to a separate intreface. 2. Using scale factor/image sizes/scaled image sizes to retreive a resolution variant. May be it is better to have a structure that provide all necessary information to query the resolution variant: scale factor, draw area width/height, transformed area width/height? For example: --------------------- public interface MultiResolutionImage { interface DrawAreaInfo { float getScaleFactor(); float getAreaWidth(); float getAreaHeight(); float getTransformedAreaWidth(); float getTransformedAreaHeight(); } public Image getResolutionVariant(DrawAreaInfo drawAreaInfo) ; public List getResolutionVariants(); } --------------------- The MultiResolutionImage default implementation could allow to use different strategies like scale factor/transfom/OS based to query a resolution variant. The OS based strategy can be used by default. Thanks, Alexandr. On 2/13/2014 4:42 AM, Jim Graham wrote: > On 2/12/14 5:59 AM, Alexander Scherbatiy wrote: >> On 2/8/2014 4:19 AM, Jim Graham wrote: >>> The primary thing that I was concerned about was the presence of >>> integers in the API when Windows uses non-integer multiples >> It would make sense to pass real numbers to the >> getResolutionVariant() method if the difference between resolution >> variants sizes is 1. >> It seems that it is not a common case. > > I was thinking of other API that is related to this, such as the API > that queries the scaling factor from a SurfaceManager. I seem to > remember some integer return values in that, but Windows might have > the answer 1.4 or 1.8, depending on the screen scaling factor that was > determined from the UI. > > In terms of the getResolutionVariant() method here, those non-integer > screen scaling factors don't directly impact this API. But, we have > some issues with the use of integers there from other sources: > > - That API assumes that the caller will determine the pixel size > needed, but the actual media choice is determined with different > techniques on Mac and Windows so this means that the caller will have > to worry about platform conventions. Is that the right tradeoff? > > - The technique recommended for Mac involves computing the precise > size desired using the current transform, which may be a floating > point value, so the integer values used in this API are already > approximations and there is no documentation on how to generate the > proper integer. In particular, the current code in SG2D naively uses > a cast to integer to determine the values to supply which means a > transformed size of W+0.5 will be truncated to W and the lower > resolution image will be used. Does that conform to Mac guidelines? > Do they require the truncated size to reach W+1 before the next size > is used? Passing in float or double values would sidestep all of that > since then the comparisons would be done with full precision, but as > long as we can determine a "best practices compatible with all > platforms" rule on how to round to integers, then integers are OK there. > > - The Windows document you cite below suggests that the determination > should be made by looking at the Screen DPI and choosing the next > higher media variant based on that screen DPI. They do not specify > choosing media based on the current transform as is done for Mac. If > we stick with supplying values that are used to determine which media > to use, then on Windows we should not take the transform into account, > but instead query the SurfaceManager for the scale factor and only > transform by those values (even if the current transform was manually > overridden to identity). > > There are pros and cons to both approaches. > > Mac ensures that you are always using the best media for any given > render operation. > > But, Windows ensure more consistency in the face of other scaling. > > The thing to consider is that if you have a 500x500 image with a > 1000x1000 variant and you rendering it at 500x500 and then 501x501, > that first jump will be fairly jarring as the scaled version of the > 1000x1000 will not look precisely like the original 500x500 did. With > @2x images only, this effect is minimized so the advantage of always > using "the best media for a given render operation" may outweigh the > inconsistency issue. But, on Windows where the media are 1.4x or 1.8x > in size, a downscaled image will start to show more interpolation > noise and so the balance of the two choices may shift more towards not > wanting a jarring shift. > > We might want one or more of the following: > > - Developer chooses policy (TX_AWARE, DPI_AWARE, ALWAYS_LARGEST, NONE, > PLATFORM) where the last policy would use TX_AWARE on Mac and > DPI_AWARE on Windows > > - We create our own policy and always use it (TX_AWARE? or DPI_AWARE?) > > - We create our own policy that dynamically chooses one of the above > strategies depending on platform or available media or ??? > > - We could create an optional interface for them to install their own > algorithm as well. I think it would work best as a delegate interface > that one installs into Image so that it can be used with any image > without having to subclass (it wouldn't really have much to do for > BufferedImages or VolatileImages, though): > > class Image { > void setResolutionHelper(ImageResolutionHelper foo); > List getResolutionVariants(); > } > > or: > > class Graphics { > void setResolutionHelper(ImageResolutionHelper foo); > } > > or - anywhere else it could be installed more centrally (per App > context)? > > and the interface would be something like one of these variants: > > interface ImageResolutionHelper { > // This version would prevent substituting a random image: > // They have to return an index into the List for that > image... > public int chooseVariant(Image img, double dpi, number w, number h); > > or: > > // This version would allow substituting an arbitrary image: > public Image getVariant(Image img, double dpi, number w, number h); > } > > Since they would be in full control of the policy, though, we would > unfortunately always have to call this, there would be no more testing > in SG2D to see "if" we need to deal with DPI, though perhaps we could > document some internal conditions in which we do not call it for > common cases (but that would have to be well agreed not to get in the > way of reasonable uses of the API and well documented)? > > Note that we would have to do a security audit to make sure that > random image substitution couldn't allow any sort of "screen phishing" > exploit. > > ...jim > >>> and also what policy they use for choosing scaled images. >>> >>> I don't see a mention of taking the current transform into account, >>> just physical issues like screen DPI and form factor. They talk about >>> resolution plateaus and in their recommendations section they tell the >>> developer to use a particular property that tells them the screen >>> resolution to figure out which image to load if they are loading >>> manually. There is no discussion about dynamically loading multiple >>> versions of the image based on a dynamic program-applied transform >>> factor as is done on MacOS. >>> >>> Also, they tell developers to draw images to a specific size rather >>> than using auto-sizing. That begs the question as to how they >>> interpret a call to draw an image just using a location in the >>> presence of various DPI factors. >> There is an interesting doc that describes how to write DPI-aware >> Win32 applications: >> http://msdn.microsoft.com/en-us/library/dd464646%28v=vs.85%29.aspx >> It is suggested to handle WM_DPICHANGED message, load the graphic >> that has slightly greater resolution to the current DPI and use >> StretchBlt >> to scale down the image. >> >> Thanks, >> Alexandr. >> >>> >>> ...jim >>> >>> On 2/7/14 3:00 AM, Alexander Scherbatiy wrote: >>>> On 1/22/2014 6:40 AM, Jim Graham wrote: >>>>> Hi Alexander, >>>>> >>>>> Before we get too far down the road on this API, I think we >>>>> understand >>>>> the way in which MacOS processes multi-resolution images for HiDPI >>>>> screens, but have we investigated the processes that Windows uses >>>>> under Windows 8? My impression is that Windows 8 has included a >>>>> number of new techniques for dealing with the high resolution >>>>> displays >>>>> that it will run on in the Windows tablet and mobile industries and >>>>> that these will also come into play as 4K displays (already >>>>> available) >>>>> become more common on the desktop. We should make sure that what we >>>>> come up with here can provide native compatibility with either >>>>> platform's policies and standard practices. >>>>> >>>>> If you've investigated the MS policies I'd like to see a summary so >>>>> that we can consider them as we review this API... >>>> There is the Windows Guidelines for scaling to pixel density: >>>> http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx >>>> which says that Windows has automatic resource loading that >>>> supports >>>> three version of images scaling (100%, 140%, and 180%) >>>> -------------------------------- >>>> Without scaling, as the pixel density of a display device >>>> increases, the >>>> physical sizes of objects on screen get smaller. >>>> When UI would otherwise be too small to touch and when text gets too >>>> small to read, >>>> Windows scales the system and app UI to one of the following scaling >>>> plateaus: >>>> >>>> 1.0 (100%, no scaling is applied) >>>> 1.4 (140% scaling) >>>> 1.8 (180% scaling) >>>> >>>> Windows determines which scaling plateau to use based on the physical >>>> screen size, the screen resolution, the DPI of the screen, and form >>>> factor. >>>> >>>> Use resource loading for bitmap images in the app package For bitmap >>>> images stored >>>> in the app package, provide a separate image for each scaling >>>> factor(100%, 140%, and 180%), >>>> and name your image files using the "scale" naming convention >>>> described >>>> below. >>>> Windows loads the right image for the current scale automatically. >>>> -------------------------------- >>>> >>>> The image name convention for the various scales is: >>>> images/logo.scale-100.png >>>> images/logo.scale-140.png >>>> images/logo.scale-180.png >>>> >>>> The 'ms-appx:///images/logo.png' uri is used to load the image >>>> in an >>>> application. >>>> >>>> If we want to support this in the same way as it is done for Mac >>>> OS X >>>> the WToolkit should return MultiResolution image in case if the >>>> loaded image has .scale-* qualifiers. >>>> The Graphics class can request an image with necessary resolution >>>> from the MultiResolution image. >>>> >>>> It seems that nothing should be changed in the MultiResolution >>>> interface in this case. >>>> >>>> Thanks, >>>> Alexandr. >>>>> >>>>> ...jim >>>>> >>>>> On 1/14/14 2:54 AM, Alexander Scherbatiy wrote: >>>>>> >>>>>> Hello, >>>>>> >>>>>> Could you review the fix: >>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8029339 >>>>>> webrev: http://cr.openjdk.java.net/~alexsch/8029339/webrev.00 >>>>>> >>>>>> This is a proposal to introduce an API that allows to create a >>>>>> custom >>>>>> multi resolution image. >>>>>> >>>>>> I. It seems reasonable that the API should provide two basic >>>>>> operations: >>>>>> >>>>>> 1. Get the resolution variant based on the requested image >>>>>> width and >>>>>> height: >>>>>> - Image getResolutionVariant(int width, int height) >>>>>> >>>>>> Usually the system provides the scale factor which represents >>>>>> the >>>>>> number of pixels corresponding to each linear unit on the display. >>>>>> However, it has sense to combine the scale factor and the >>>>>> current >>>>>> transformations to get the actual image size to be displayed. >>>>>> >>>>>> 2. Get all provided resolution variants: >>>>>> - List getResolutionVariants() >>>>>> >>>>>> There are several uses cases: >>>>>> - Create a new multi-resolution image based on the given >>>>>> multi-resolution image. >>>>>> - Pass to the native system the multi-resolution image. For >>>>>> example, >>>>>> a use can set to the system the custom multi-resolution cursor. >>>>>> >>>>>> II. There are some possible ways where the new API can be added >>>>>> >>>>>> 1. java.awt.Image. >>>>>> >>>>>> The 2 new methods can be added to the Image class. A user can >>>>>> override >>>>>> the getResolutionVariant() and getResolutionVariants() methods to >>>>>> provide the resolution variants >>>>>> or there can be default implementations of these methods if a >>>>>> user >>>>>> puts resolution variants >>>>>> to the list in the sorted order. >>>>>> >>>>>> To check that the image has resolution variants the following >>>>>> statement can be used: image.getResolutionVariants().size() != 1 >>>>>> >>>>>> The disadvantage is that there is an overhead that the Image >>>>>> class >>>>>> should contain the List object and not all >>>>>> images can have resolution variants. >>>>>> >>>>>> 2. Introduce new MultiResolutionImage interface. >>>>>> >>>>>> A user should extend Image class and implement the >>>>>> MultiResolutionImage interface. >>>>>> >>>>>> For example: >>>>>> --------------------- >>>>>> public class CustomMultiResolutionImage extends BufferedImage >>>>>> implements MultiResolutionImage { >>>>>> >>>>>> Image highResolutionImage; >>>>>> >>>>>> public CustomMultiResolutionImage(BufferedImage baseImage, >>>>>> BufferedImage highResolutionImage) { >>>>>> super(baseImage.getWidth(), baseImage.getHeight(), >>>>>> baseImage.getType()); >>>>>> this.highResolutionImage = highResolutionImage; >>>>>> Graphics g = getGraphics(); >>>>>> g.drawImage(baseImage, 0, 0, null); >>>>>> g.dispose(); >>>>>> } >>>>>> >>>>>> @Override >>>>>> public Image getResolutionVariant(int width, int height) { >>>>>> return ((width <= getWidth() && height <= getHeight())) >>>>>> ? this : highResolutionImage; >>>>>> } >>>>>> >>>>>> @Override >>>>>> public List getResolutionVariants() { >>>>>> return Arrays.asList(this, highResolutionImage); >>>>>> } >>>>>> } >>>>>> --------------------- >>>>>> >>>>>> The current fix adds the MultiResolutionImage interface and public >>>>>> resolution variant rendering hints. >>>>>> >>>>>> Thanks, >>>>>> Alexandr. >>>>>> >>>> >> From petr.pchelko at oracle.com Tue Feb 18 07:41:23 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Tue, 18 Feb 2014 19:41:23 +0400 Subject: [9] Review Request: 6744401 Consider removal of code disabling JIT in Toolkit.getDefaultToolkit In-Reply-To: <53037064.2090106@oracle.com> References: <53036B59.8040107@oracle.com> <53037064.2090106@oracle.com> Message-ID: Hello, Sergey. The fix looks good to me. With best regards. Petr. 18 ????. 2014 ?., ? 6:38 ????? ???????, Anthony Petrov ???????(?): > Hi Sergey, > > The fix looks good to me. > > -- > best regards, > Anthony > > On 2/18/2014 6:16 PM, Sergey Bylokhov wrote: >> Hello. >> Please review the fix for jdk 9. >> - jit related methods were removed(see >> http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-February/013482.html) >> >> - Small cleanup >> - Note that i did not convert the code to lambda, because toolkit >> initialization in this case two times slower. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-6744401 >> Webrev can be found at: http://cr.openjdk.java.net/~serb/6744401/webrev.00 >> From omajid at redhat.com Tue Feb 18 09:09:33 2014 From: omajid at redhat.com (Omair Majid) Date: Tue, 18 Feb 2014 12:09:33 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <5301D36F.3060702@oracle.com> References: <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> Message-ID: <20140218170933.GF4279@redhat.com> * Erik Joelsson [2014-02-17 04:16]: > At least to me this looks good, but better let Magnus and Andrew > have their say too. Feedback from an AWT expert would be appreciated too! Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From Sergey.Bylokhov at oracle.com Tue Feb 18 09:34:39 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 18 Feb 2014 21:34:39 +0400 Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140214172747.GE2406@redhat.com> References: <20140203174327.GA9174@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> Message-ID: <530399AF.8000007@oracle.com> cc 2d alias also. The fix looks good. I am curious who will document all new options in README-builds.html? On 14.02.2014 21:27, Omair Majid wrote: > * Andrew Hughes [2014-02-13 23:59]: >> As I said in the previous e-mail, the minimum I'd be happy with is if >> the current patch was updated so settings weren't being hardcoded into >> the makefiles. Passing them from configure would be sufficient for now, >> then it can be replaced by PKG_CONFIG. > How does this updated patch look: > http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/03/ > http://cr.openjdk.java.net/~omajid/webrevs/system-libpng/03-jdk/ > > Thanks, > Omair > -- Best regards, Sergey. From omajid at redhat.com Tue Feb 18 09:48:24 2014 From: omajid at redhat.com (Omair Majid) Date: Tue, 18 Feb 2014 12:48:24 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <530399AF.8000007@oracle.com> References: <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <530399AF.8000007@oracle.com> Message-ID: <20140218174823.GH4279@redhat.com> * Sergey Bylokhov [2014-02-18 12:35]: > cc 2d alias also. > > The fix looks good. I am curious who will document all new options > in README-builds.html? One thing I have always loved about autotools is self documentation. With this patch, for example, ./configure --help gives me the new option and the description but also gives me the new _CFLAGS and _LIBS options added. I don't mind updating README-builds.html, but I think that might be over-documenting (if there's such a thing) :) Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From gnu.andrew at redhat.com Tue Feb 18 11:21:12 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Tue, 18 Feb 2014 14:21:12 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140218170933.GF4279@redhat.com> References: <20140205151517.GA9621@redhat.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <20140218170933.GF4279@redhat.com> Message-ID: <252064231.5276919.1392751272783.JavaMail.zimbra@redhat.com> ----- Original Message ----- > * Erik Joelsson [2014-02-17 04:16]: > > At least to me this looks good, but better let Magnus and Andrew > > have their say too. > This looks fine. > Feedback from an AWT expert would be appreciated too! > I'm not sure why this is needed, given it doesn't really touch any AWT code. If the #include change fails, you'll see that as a build failure. > Thanks, > Omair > > -- > PGP Key: 66484681 (http://pgp.mit.edu/) > Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From mikael.vidstedt at oracle.com Tue Feb 18 17:30:01 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Tue, 18 Feb 2014 17:30:01 -0800 Subject: RFR: Even more gcc warnings (8035287) In-Reply-To: <52FFA46F.4000202@oracle.com> References: <52FEC8C7.9000700@oracle.com> <41E8E647-4C1E-4DD6-86AF-40A498B503B7@oracle.com> <52FFA46F.4000202@oracle.com> Message-ID: <53040919.3050400@oracle.com> On 2014-02-15 09:31, Phil Race wrote: > Looks OK to me although I just realised there's no bug ID here Bug created: https://bugs.openjdk.java.net/browse/JDK-8035287 > FWIW I develop on WIndows, Mac & Linux and I've noticed widely divergent > things that the compilers on these platforms warn about. Warning > free on Linux might not mean warning free on Windows. > Also, assuming you develop on Linux might want to check if any of > these make > the VS compiler less happy about anything. Acknowledged - not all platforms/compilers complain about the same thing(s). I tried my best to manually verify that no new warnings are introduced by building on the usual suspect platforms and grep through the warnings. > >> * src/solaris/native/sun/awt/awt_Font.c >> >> Comparisons with string literals is undefined behavior - keep track >> of whether the string should be freed explicitly with a boolean instead. > Gosh .. that code must be from 1996 or thereabouts. I hope touching it doesn't mean I own it ;) Anything else I should do/test? Cheers, Mikael > > -phil. > > On 2/15/14 8:37 AM, Mikael Vidstedt wrote: >> Corrected link - this webrev is based on jdk9/client: >> >> http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/webrev.01/webrev/ >> >> >> Cheers, >> Mikael >> >>> On Feb 14, 2014, at 17:54, Mikael Vidstedt >>> wrote: >>> >>> >>> All, >>> >>> A drive-by set of warning fixes: >>> >>> http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/jdk-warnings/webrev.00/ >>> >>> >>> Highlights: >>> >>> * src/share/native/com/sun/java/util/jar/pack/bands.cpp >>> >>> Set the size of the array explicitly to increase likelihood of enum >>> and struct array being in sync. Arguably this should be changed to >>> use the (new) [] = instead. >>> >>> Initialize all the fields in the (redundant) terminator struct >>> explicitly. >>> >>> Remove unused macro. >>> >>> * src/share/native/sun/java2d/opengl/OGLContext.c >>> >>> Get the prototype for jio_snprintf from jvm.h to address an implicit >>> declaration. >>> >>> * src/solaris/native/sun/awt/awt_Font.c >>> >>> Comparisons with string literals is undefined behavior - keep track >>> of whether the string should be freed explicitly with a boolean >>> instead. >>> >>> * src/solaris/native/sun/awt/awt_LoadLibrary.c >>> >>> The macro is supposed to expand to a void function declaration, but >>> forgets to actually add the "void". >>> >>> Cheers, >>> Mikael >>> > From philip.race at oracle.com Tue Feb 18 17:37:08 2014 From: philip.race at oracle.com (Phil Race) Date: Tue, 18 Feb 2014 17:37:08 -0800 Subject: RFR: Even more gcc warnings (8035287) In-Reply-To: <53040919.3050400@oracle.com> References: <52FEC8C7.9000700@oracle.com> <41E8E647-4C1E-4DD6-86AF-40A498B503B7@oracle.com> <52FFA46F.4000202@oracle.com> <53040919.3050400@oracle.com> Message-ID: <53040AC4.2020403@oracle.com> > Anything else I should do/test? No. Sounds fine. -phil. On 2/18/14 5:30 PM, Mikael Vidstedt wrote: > > On 2014-02-15 09:31, Phil Race wrote: >> Looks OK to me although I just realised there's no bug ID here > > Bug created: > > https://bugs.openjdk.java.net/browse/JDK-8035287 > >> FWIW I develop on WIndows, Mac & Linux and I've noticed widely divergent >> things that the compilers on these platforms warn about. Warning >> free on Linux might not mean warning free on Windows. >> Also, assuming you develop on Linux might want to check if any of >> these make >> the VS compiler less happy about anything. > > Acknowledged - not all platforms/compilers complain about the same > thing(s). I tried my best to manually verify that no new warnings are > introduced by building on the usual suspect platforms and grep through > the warnings. > >> >>> * src/solaris/native/sun/awt/awt_Font.c >>> >>> Comparisons with string literals is undefined behavior - keep track >>> of whether the string should be freed explicitly with a boolean >>> instead. >> Gosh .. that code must be from 1996 or thereabouts. > > I hope touching it doesn't mean I own it ;) > > > Anything else I should do/test? > > Cheers, > Mikael > >> >> -phil. >> >> On 2/15/14 8:37 AM, Mikael Vidstedt wrote: >>> Corrected link - this webrev is based on jdk9/client: >>> >>> http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/webrev.01/webrev/ >>> >>> >>> Cheers, >>> Mikael >>> >>>> On Feb 14, 2014, at 17:54, Mikael Vidstedt >>>> wrote: >>>> >>>> >>>> All, >>>> >>>> A drive-by set of warning fixes: >>>> >>>> http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/jdk-warnings/webrev.00/ >>>> >>>> >>>> Highlights: >>>> >>>> * src/share/native/com/sun/java/util/jar/pack/bands.cpp >>>> >>>> Set the size of the array explicitly to increase likelihood of enum >>>> and struct array being in sync. Arguably this should be changed to >>>> use the (new) [] = instead. >>>> >>>> Initialize all the fields in the (redundant) terminator struct >>>> explicitly. >>>> >>>> Remove unused macro. >>>> >>>> * src/share/native/sun/java2d/opengl/OGLContext.c >>>> >>>> Get the prototype for jio_snprintf from jvm.h to address an >>>> implicit declaration. >>>> >>>> * src/solaris/native/sun/awt/awt_Font.c >>>> >>>> Comparisons with string literals is undefined behavior - keep track >>>> of whether the string should be freed explicitly with a boolean >>>> instead. >>>> >>>> * src/solaris/native/sun/awt/awt_LoadLibrary.c >>>> >>>> The macro is supposed to expand to a void function declaration, but >>>> forgets to actually add the "void". >>>> >>>> Cheers, >>>> Mikael >>>> >> > From mikael.vidstedt at oracle.com Tue Feb 18 17:57:18 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Tue, 18 Feb 2014 17:57:18 -0800 Subject: RFR: Even more gcc warnings (8035287) In-Reply-To: <53040AC4.2020403@oracle.com> References: <52FEC8C7.9000700@oracle.com> <41E8E647-4C1E-4DD6-86AF-40A498B503B7@oracle.com> <52FFA46F.4000202@oracle.com> <53040919.3050400@oracle.com> <53040AC4.2020403@oracle.com> Message-ID: <53040F7E.1060808@oracle.com> Thanks for the review Phil! Cheers, Mikael On 2014-02-18 17:37, Phil Race wrote: > > Anything else I should do/test? > > No. Sounds fine. > > -phil. > > On 2/18/14 5:30 PM, Mikael Vidstedt wrote: >> >> On 2014-02-15 09:31, Phil Race wrote: >>> Looks OK to me although I just realised there's no bug ID here >> >> Bug created: >> >> https://bugs.openjdk.java.net/browse/JDK-8035287 >> >>> FWIW I develop on WIndows, Mac & Linux and I've noticed widely >>> divergent >>> things that the compilers on these platforms warn about. Warning >>> free on Linux might not mean warning free on Windows. >>> Also, assuming you develop on Linux might want to check if any of >>> these make >>> the VS compiler less happy about anything. >> >> Acknowledged - not all platforms/compilers complain about the same >> thing(s). I tried my best to manually verify that no new warnings are >> introduced by building on the usual suspect platforms and grep >> through the warnings. >> >>> >>>> * src/solaris/native/sun/awt/awt_Font.c >>>> >>>> Comparisons with string literals is undefined behavior - keep track >>>> of whether the string should be freed explicitly with a boolean >>>> instead. >>> Gosh .. that code must be from 1996 or thereabouts. >> >> I hope touching it doesn't mean I own it ;) >> >> >> Anything else I should do/test? >> >> Cheers, >> Mikael >> >>> >>> -phil. >>> >>> On 2/15/14 8:37 AM, Mikael Vidstedt wrote: >>>> Corrected link - this webrev is based on jdk9/client: >>>> >>>> http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/webrev.01/webrev/ >>>> >>>> >>>> Cheers, >>>> Mikael >>>> >>>>> On Feb 14, 2014, at 17:54, Mikael Vidstedt >>>>> wrote: >>>>> >>>>> >>>>> All, >>>>> >>>>> A drive-by set of warning fixes: >>>>> >>>>> http://cr.openjdk.java.net/~mikael/webrevs/jdk-warnings/jdk-warnings/webrev.00/ >>>>> >>>>> >>>>> Highlights: >>>>> >>>>> * src/share/native/com/sun/java/util/jar/pack/bands.cpp >>>>> >>>>> Set the size of the array explicitly to increase likelihood of >>>>> enum and struct array being in sync. Arguably this should be >>>>> changed to use the (new) [] = instead. >>>>> >>>>> Initialize all the fields in the (redundant) terminator struct >>>>> explicitly. >>>>> >>>>> Remove unused macro. >>>>> >>>>> * src/share/native/sun/java2d/opengl/OGLContext.c >>>>> >>>>> Get the prototype for jio_snprintf from jvm.h to address an >>>>> implicit declaration. >>>>> >>>>> * src/solaris/native/sun/awt/awt_Font.c >>>>> >>>>> Comparisons with string literals is undefined behavior - keep >>>>> track of whether the string should be freed explicitly with a >>>>> boolean instead. >>>>> >>>>> * src/solaris/native/sun/awt/awt_LoadLibrary.c >>>>> >>>>> The macro is supposed to expand to a void function declaration, >>>>> but forgets to actually add the "void". >>>>> >>>>> Cheers, >>>>> Mikael >>>>> >>> >> > From anton.litvinov at oracle.com Wed Feb 19 00:39:13 2014 From: anton.litvinov at oracle.com (Anton Litvinov) Date: Wed, 19 Feb 2014 12:39:13 +0400 Subject: [9] Review request for 8032078: CPlatformWindow.setWindowState throws RuntimeException, if windowState=ICONIFIED|MAXIMIZED_BOTH In-Reply-To: <53036FB8.9040407@oracle.com> References: <52DE59BE.80907@oracle.com> <607D029B-D860-4E41-80DC-FAE824071E22@oracle.com> <52E26E0C.7090501@oracle.com> <53020BF2.7090407@oracle.com> <53036D46.2030303@oracle.com> <53036FB8.9040407@oracle.com> Message-ID: <53046DB1.10500@oracle.com> Hello Sergey, Thank you for the review of the corrected version of the fix. It is a good idea to verify workability of "setVisible" method, but I think that "setVisible" method is not related to the original bug and we should not include testing of this method into the fix. Also for me it is not clear, what exactly should be tested in "setVisible" method test, because: - "Frame.state" field is changed immediately during the call "Frame.setExtendedState" for both visible and invisible frames. - According to the documentation of "Frame.setExtendedState" method, when "setVisible(true)" is called, the frame will only attempt to apply the state and reception of any "WindowEvent.WINDOW_STATE_CHANGED" events is not guaranteed. I suggest to create a separate bug on creation of the test for verification of "setVisible" method, if it is necessary to verify this method and, if no analogous regression tests exist currently. Thank you, Anton On 2/18/2014 6:35 PM, Sergey Bylokhov wrote: > Hi, Anton. > The fix looks good to me. But since you change setVisible() method you > need to check it in the test too. > > On 18.02.2014 18:25, Anton Litvinov wrote: >> Hello Sergey, >> >> Thank you for the review of this fix. The fix was corrected to >> address your remarks. Could you please review the new version of the >> fix. >> >> Webrev: http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.01 >> >> Changes in the fix are following: >> >> 1. Check for a compound state with ICONIFIED bit was moved from >> "switch" block of "CPlatformWindow.setWindowState" method to the >> separate "if" statement before "switch" block. >> 2. The same pattern was applied also to "CPlatformWindow.setVisible" >> method. >> 3. The comment was changed. >> 4. The regression test was changed to also check cases with >> undecorated frame and to verify that changes between the states >> "ICONIFIED | MAXIMIZED_BOTH <--> NORMAL, ICONIFIED, MAXIMIZED_BOTH" >> are committed properly and do not raise exceptions. >> >> Thank you, >> Anton >> On 2/17/2014 5:17 PM, Sergey Bylokhov wrote: >>> Hi, Anton. >>> I suppose that CPW should have the same behavior on setVisible() and >>> setExtendedState() for compound states? >>> Also I suggest to change comment to describe that on macosx we >>> support ICONIFY state only for compounds states, currently the >>> comment is quite obvious. Probably the code could be improved and we >>> can change windowState to ICONIFY before the switch for compound >>> states? >>> >>> On 24.01.2014 17:43, Anton Litvinov wrote: >>>> Hello Petr, >>>> >>>> Thank you very much for review of this fix. I am not sure that the >>>> behavior of "ICONIFIED | MAXIMIZED_BOTH" should be completely the >>>> same as "ICONIFIED" on OS X, but I think that in this bitwise mask >>>> the most important bit is "ICONIFIED". And, if this compound state >>>> is valid, then as a result the window should be minimized. >>>> >>>> This combination of flags is handled absolutely differently in >>>> Windows, Solaris/Linux implementation of JDK. Particularly on >>>> Windows the frame becomes minimized and will be always maximized, >>>> if the frame's icon on the taskbar is clicked. But >>>> "Frame.getExtendedState", "WFramePeer.getState()" will not always >>>> return "ICONIFIED | MAXIMIZED_BOTH", instead of this "ICONIFIED" >>>> will be returned, when before a call to "Frame.setExtendedState" >>>> method "Frame.state" was not "MAXIMIZED_BOTH". >>>> >>>> The common feature of Windows and Solaris/Linux code is the fact >>>> that the implementation of "java.awt.peer.FramePeer.setState" does >>>> not throw an exception unlike OS X code. >>>> >>>> Yes, this bug may be fixed in "Frame.isFrameStateSupported", but >>>> the change will require introduction of code checking, either it is >>>> executed on OS X platform or not, because this method should not be >>>> changed for other platforms, since they depend on it for a long >>>> time since 2004, when it was introduced by the fix for the bug >>>> JDK-4987087. From my opinion, making "Frame.isFrameStateSupported" >>>> return false for this compound state on OS X platform will make the >>>> code of this method not truly shared and will not let code calling >>>> "Frame.setExtendedState" with the state "ICONIFIED | >>>> MAXIMIZED_BOTH" to minimize the frame. >>>> >>>> Thank you, >>>> Anton >>>> >>>> On 1/21/2014 4:26 PM, Petr Pchelko wrote: >>>>> Hello, Anton. >>>>> >>>>> Are we sure that the behavior of ICONIFIED | MAXIMIZED_BOTH should >>>>> be the same as just ICONIFIED? >>>>> What does this combination of flags do on other platforms? >>>>> >>>>> I would expect that if the frame is not maximized, this >>>>> combination would iconify it, but when you deiconify the frame >>>>> should go to maximized state. However, I?m quite sure you can?t do >>>>> it like this on Mac OS X, because we use the native >>>>> zoom mechanism for maximization and do not have enough control >>>>> over it. So, in my opinion this should be fixed by >>>>> making Frame.isFrameStateSupported return false for this >>>>> combination. What do you think? >>>>> >>>>> With best regards. Petr. >>>>> >>>>> 21 ???. 2014 ?., ? 3:27 ????? ???????, Anton >>>>> Litvinov ???????(?): >>>>> >>>>>> Hello, >>>>>> >>>>>> Could you please review the following fix for the bug. >>>>>> >>>>>> Bug:https://bugs.openjdk.java.net/browse/JDK-8032078 >>>>>> Webrev:http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.00 >>>>>> >>>>>> The bug consists in undocumented throwing of "RuntimeException" >>>>>> from the method "Frame.setExtendedState" for the compound state >>>>>> "ICONIFIED | MAXIMIZED_BOTH" that is supported according to a >>>>>> result of "Frame.isFrameStateSupported" method call on OS X. >>>>>> >>>>>> The solution adds handling of the mask "ICONIFIED | >>>>>> MAXIMIZED_BOTH" to "switch" block of the method >>>>>> "sun.lwawt.macosx.CPlatformWindow.setWindowState" which >>>>>> duplicates existing handling of the state "ICONIFIED" and >>>>>> prevents from throwing of the exception. >>>>>> >>>>>> Thank you, >>>>>> Anton >>>> >>> >>> >> > > From alexandr.scherbatiy at oracle.com Wed Feb 19 01:09:03 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 19 Feb 2014 13:09:03 +0400 Subject: EventQueue NPE? In-Reply-To: <20140219040301.GL9822@palantir.com> References: <20140219040301.GL9822@palantir.com> Message-ID: <530474AF.7050205@oracle.com> On 2/19/2014 8:03 AM, Keith Amling wrote: > I may be barking up the wrong tree e-mailing an OpenJDK list when I've > only reproduced this against an Oracle JDK (1.7.0_25, and in particular > it doesn't reproduce against 1.7.0_21), but the attached file produces > NPEs [1] via EventQueue.isDispatchThread() fairly regularly with an > argument of 10 [threads] and can even produce it with just 2 (although > less often). This is an interesting exception. I am able to reproduce it with the JDK 7u51 but not able to reproduce it with the JDK 8. Could you check that the issue is not reproduced on your side with the latest JDK 8: https://jdk8.java.net/download.html > > We've had even weirder NPEs [2] in the code behind that but I have yet > to distill them to a repro unfortunately. We have several reports about this NPE like: https://bugs.openjdk.java.net/browse/JDK-8019272 It should have been already fixed in JDK 7u60 and in the JDK 8. Thanks, Alexandr. > > Are either of these known? Is there something we should be doing in our > rather multi-threaded environment to protect this code? > > Keith > > [1] E.g.: > >> java.lang.NullPointerException >> at java.awt.EventQueue.isDispatchThread(EventQueue.java:1014) >> at EQNPE$1.run(EQNPE.java:23) > [2] Ending in: > >> java.lang.NullPointerException >> at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1011) >> at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1007) >> at sun.awt.HeadlessToolkit.getSystemEventQueueImpl(HeadlessToolkit.java:352) >> at java.awt.Toolkit.getSystemEventQueue(Toolkit.java:1717) >> From petr.pchelko at oracle.com Wed Feb 19 01:20:22 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Wed, 19 Feb 2014 13:20:22 +0400 Subject: EventQueue NPE? In-Reply-To: <530474AF.7050205@oracle.com> References: <20140219040301.GL9822@palantir.com> <530474AF.7050205@oracle.com> Message-ID: <55271688-81B5-4142-AB96-E3681978BFFD@oracle.com> Hello, Keith. I suppose it was fixed under this bug: https://bugs.openjdk.java.net/browse/JDK-8019623 With best regards. Petr. On 19.02.2014, at 13:09, Alexander Scherbatiy wrote: > On 2/19/2014 8:03 AM, Keith Amling wrote: >> I may be barking up the wrong tree e-mailing an OpenJDK list when I've >> only reproduced this against an Oracle JDK (1.7.0_25, and in particular >> it doesn't reproduce against 1.7.0_21), but the attached file produces >> NPEs [1] via EventQueue.isDispatchThread() fairly regularly with an >> argument of 10 [threads] and can even produce it with just 2 (although >> less often). > This is an interesting exception. I am able to reproduce it with the JDK 7u51 but > not able to reproduce it with the JDK 8. > > Could you check that the issue is not reproduced on your side with the latest JDK 8: > https://jdk8.java.net/download.html > >> >> We've had even weirder NPEs [2] in the code behind that but I have yet >> to distill them to a repro unfortunately. > We have several reports about this NPE like: > https://bugs.openjdk.java.net/browse/JDK-8019272 > > It should have been already fixed in JDK 7u60 and in the JDK 8. > > Thanks, > Alexandr. >> >> Are either of these known? Is there something we should be doing in our >> rather multi-threaded environment to protect this code? >> >> Keith >> >> [1] E.g.: >> >>> java.lang.NullPointerException >>> at java.awt.EventQueue.isDispatchThread(EventQueue.java:1014) >>> at EQNPE$1.run(EQNPE.java:23) >> [2] Ending in: >> >>> java.lang.NullPointerException >>> at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1011) >>> at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1007) >>> at sun.awt.HeadlessToolkit.getSystemEventQueueImpl(HeadlessToolkit.java:352) >>> at java.awt.Toolkit.getSystemEventQueue(Toolkit.java:1717) >>> > From petr.pchelko at oracle.com Wed Feb 19 03:29:01 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Wed, 19 Feb 2014 15:29:01 +0400 Subject: [9] Review Request: JDK-8032960 Running forms URL throws NullPointerException in Javaconsole. Message-ID: <0EB4849B-CA97-4429-8A4E-D6CCDD002BF1@oracle.com> Hello, AWT Team. Please review the fix for the issue: https://bugs.openjdk.java.net/browse/JDK-8032960 The fix is available at: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.00/ The problem: The Toolkit thread does not have an AppContext so we can't use EventQueue.invokeLater on it. The solution: Remove invokeLater. This is safe, because the updateProperties is thread safe. The result of this call is a post of a PropertyChangeEvent for each AppContext in the application. The test: Hard to create, because we can't synthesize the WM_SETTINGCHANGE event. Thank you. With best regards. Petr. From magnus.ihse.bursie at oracle.com Wed Feb 19 03:59:41 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Wed, 19 Feb 2014 12:59:41 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <5301D36F.3060702@oracle.com> References: <20140203174327.GA9174@redhat.com> <20140205151517.GA9621@redhat.com> <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> Message-ID: <53049CAD.6030005@oracle.com> On 2014-02-17 10:16, Erik Joelsson wrote: > At least to me this looks good, but better let Magnus and Andrew have > their say too. Looks good to me! /Magnus From omajid at redhat.com Wed Feb 19 08:16:28 2014 From: omajid at redhat.com (Omair Majid) Date: Wed, 19 Feb 2014 11:16:28 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <53049CAD.6030005@oracle.com> References: <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> Message-ID: <20140219161628.GA19966@redhat.com> * Magnus Ihse Bursie [2014-02-19 06:59]: > On 2014-02-17 10:16, Erik Joelsson wrote: > >At least to me this looks good, but better let Magnus and Andrew > >have their say too. > > Looks good to me! Thanks for the reviews, everyone! I have filed https://bugs.openjdk.java.net/browse/JDK-8035341 to track the issue. Can someone please point me some docs that explains what I need to do to to this bug once I have pushed the fix? Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From iris.clark at oracle.com Wed Feb 19 10:58:09 2014 From: iris.clark at oracle.com (Iris Clark) Date: Wed, 19 Feb 2014 10:58:09 -0800 (PST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140219161628.GA19966@redhat.com> References: <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> Message-ID: <7d73e3b2-d442-48d4-95e3-d444569ddc86@default> Hi, Omair. > Can someone please point me some docs that explains what I need to do to this bug once I have pushed the fix? The short answer is "nothing, the bug will be automatically updated". A slightly longer answer may be found on this page: http://openjdk.java.net/sponsor/ See the last sentence of step 3 and all of step 4. Thanks, iris -----Original Message----- From: Omair Majid [mailto:omajid at redhat.com] Sent: Wednesday, February 19, 2014 8:16 AM To: Magnus Ihse Bursie Cc: awt-dev; build-dev; Erik Joelsson Subject: Re: RFR: Allow using a system installed libpng * Magnus Ihse Bursie [2014-02-19 06:59]: > On 2014-02-17 10:16, Erik Joelsson wrote: > >At least to me this looks good, but better let Magnus and Andrew have > >their say too. > > Looks good to me! Thanks for the reviews, everyone! I have filed https://bugs.openjdk.java.net/browse/JDK-8035341 to track the issue. Can someone please point me some docs that explains what I need to do to to this bug once I have pushed the fix? Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From anthony.petrov at oracle.com Thu Feb 20 00:45:55 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Thu, 20 Feb 2014 12:45:55 +0400 Subject: [9] Review Request: JDK-8032960 Running forms URL throws NullPointerException in Javaconsole. In-Reply-To: <0EB4849B-CA97-4429-8A4E-D6CCDD002BF1@oracle.com> References: <0EB4849B-CA97-4429-8A4E-D6CCDD002BF1@oracle.com> Message-ID: <5305C0C3.2090102@oracle.com> Hi Petr, The fire...() method is now invoked on the Toolkit thread, and I see that the Toolkit.DesktopPropertyChangeSupport.firePropertyChange() will fire the event on the current thread if the toolkit thread belongs to the current app context. The question is: are we 100% sure that on MS Windows the AWT Toolkit thread *never* belongs to a user app context? Even if we're running in an unusual threading mode (like the one for FX where we combine the EDT and the FX toolkit thread)? If this is so, meaning that we always only postEvent() from the T.DPCS.fire...() method on Windows, then I'm fine with the fix. -- best regards, Anthony On 2/19/2014 3:29 PM, Petr Pchelko wrote: > Hello, AWT Team. > > Please review the fix for the issue: > https://bugs.openjdk.java.net/browse/JDK-8032960 > The fix is available at: > http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.00/ > > The problem: > The Toolkit thread does not have an AppContext so we can't use EventQueue.invokeLater on it. > > The solution: > Remove invokeLater. This is safe, because the updateProperties is thread safe. The result of this call is a post of a PropertyChangeEvent for each AppContext in the application. > > The test: > Hard to create, because we can't synthesize the WM_SETTINGCHANGE event. > > Thank you. > With best regards. Petr. > From anthony.petrov at oracle.com Thu Feb 20 00:47:55 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Thu, 20 Feb 2014 12:47:55 +0400 Subject: RFR: Allow using a system installed libpng In-Reply-To: <20140219161628.GA19966@redhat.com> References: <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> Message-ID: <5305C13B.4080307@oracle.com> Hi Omair, > Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) If you change client code, then the fix should go to the client repo to avoid merge conflicts and allow for more manual testing prior to integrating the changes into the master repo. -- best regards, Anthony On 2/19/2014 8:16 PM, Omair Majid wrote: > * Magnus Ihse Bursie [2014-02-19 06:59]: >> On 2014-02-17 10:16, Erik Joelsson wrote: >>> At least to me this looks good, but better let Magnus and Andrew >>> have their say too. >> >> Looks good to me! > > Thanks for the reviews, everyone! > > I have filed https://bugs.openjdk.java.net/browse/JDK-8035341 to track > the issue. Can someone please point me some docs that explains what I > need to do to to this bug once I have pushed the fix? > > Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) > > Thanks, > Omair > From alexandr.scherbatiy at oracle.com Thu Feb 20 01:51:18 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 20 Feb 2014 13:51:18 +0400 Subject: [7u] Review request for 7171045 [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag. In-Reply-To: <52F9F190.6090503@oracle.com> References: <52F9F190.6090503@oracle.com> Message-ID: <5305D016.1080501@oracle.com> Could you look at the JDK-8012026 fix to investigate, should the NSTrackingActiveInActiveApp option be changed to NSTrackingActiveAlways for the resetTrackingRect method in the AWTView.m file for the backport? http://mail.openjdk.java.net/pipermail/awt-dev/2013-August/005347.html http://cr.openjdk.java.net/~pchelko/8012026/webrev.00/ Thanks, Alexandr. On 2/11/2014 1:46 PM, dmitry markov wrote: > Hello, > > Could you review a back-port of 7171045 to JDK 7u, please? The > back-port and the main fix integrated into JDK 8 are slightly different. > > bug: http://bugs.sun.com/view_bug.do?bug_id=7171045 > webrev for jdk7u: > http://cr.openjdk.java.net/~dmarkov/7171045/jdk7u/webrev.00/ > jdk8 changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1 > technical review for jdk8: > http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003238.html > > Please note: the fix for 7171045 was partly backported to JDK 7u (see > http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003376.html > for details). However, some problems related to this case still take > place on JDK 7u. So it is necessary to backport full changeset > integrated into JDK 8. > > Thanks, > Dmitry From petr.pchelko at oracle.com Thu Feb 20 02:09:53 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Thu, 20 Feb 2014 14:09:53 +0400 Subject: [7u] Review request for 7171045 [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag. In-Reply-To: <5305D016.1080501@oracle.com> References: <52F9F190.6090503@oracle.com> <5305D016.1080501@oracle.com> Message-ID: Hello, Alexander. We should either combine these 2 fixes together or back port them separately. I don?t think it?s a good idea to mix different fixes in a single back port. It could be a good to also back port 8012026, but as a separate fix. >> The back-port and the main fix integrated into JDK 8 are slightly different. Dmitry, could you pleas tell what?s the difference? Thank you. With best regards. Petr. 20 ????. 2014 ?., ? 1:51 ????? ???????, Alexander Scherbatiy ???????(?): > > Could you look at the JDK-8012026 fix to investigate, should the NSTrackingActiveInActiveApp option be changed to NSTrackingActiveAlways > for the resetTrackingRect method in the AWTView.m file for the backport? > http://mail.openjdk.java.net/pipermail/awt-dev/2013-August/005347.html > http://cr.openjdk.java.net/~pchelko/8012026/webrev.00/ > > Thanks, > Alexandr. > > On 2/11/2014 1:46 PM, dmitry markov wrote: >> Hello, >> >> Could you review a back-port of 7171045 to JDK 7u, please? The back-port and the main fix integrated into JDK 8 are slightly different. >> >> bug: http://bugs.sun.com/view_bug.do?bug_id=7171045 >> webrev for jdk7u: http://cr.openjdk.java.net/~dmarkov/7171045/jdk7u/webrev.00/ >> jdk8 changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1 >> technical review for jdk8: http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003238.html >> >> Please note: the fix for 7171045 was partly backported to JDK 7u (see http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003376.html for details). However, some problems related to this case still take place on JDK 7u. So it is necessary to backport full changeset integrated into JDK 8. >> >> Thanks, >> Dmitry > From magnus.ihse.bursie at oracle.com Thu Feb 20 02:35:23 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Thu, 20 Feb 2014 11:35:23 +0100 Subject: RFR: Allow using a system installed libpng In-Reply-To: <5305C13B.4080307@oracle.com> References: <52F4D650.8020301@oracle.com> <1377400522.783775.1392054218172.JavaMail.zimbra@redhat.com> <52F9FF04.8050204@oracle.com> <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> <5305C13B.4080307@oracle.com> Message-ID: <5305DA6B.7010607@oracle.com> On 2014-02-20 09:47, Anthony Petrov wrote: > Hi Omair, > >> Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) > > If you change client code, then the fix should go to the client repo > to avoid merge conflicts and allow for more manual testing prior to > integrating the changes into the master repo. From my point of view, you can go either way. The changes are mostly in the build code, except for an include statement. But if the AWT folks feel more confident that way, sure, you can go via client. Just a note: Since you are updating the generated-configure.sh, someone with access to the closed sources will need to push a follow-up (the same bug number can be used) with an updated version of the closed generated-configure.sh. If you go in via the client forest, I'd prefer if someone from client did that. /Magnus From dmitry.markov at oracle.com Thu Feb 20 03:40:48 2014 From: dmitry.markov at oracle.com (dmitry markov) Date: Thu, 20 Feb 2014 15:40:48 +0400 Subject: [7u] Review request for 7171045 [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag. In-Reply-To: References: <52F9F190.6090503@oracle.com> <5305D016.1080501@oracle.com> Message-ID: <5305E9C0.6040909@oracle.com> Hello Alexander, Petr, Thank you for review. I agree, the option NSTrackingActiveInActiveApp should be changed to NSTrackingActiveAlways. If it is better to back port the changes for JDK-8012026 under separate fix, I can do it. The difference between this backport and main fix is the changes in CViewPlatformEmbeddedFrame.java. The original changeset integrated into JDK 8 (http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1) does not have them, since this file was added later. Thanks, Dmitry ** On 20/02/2014 14:09, Petr Pchelko wrote: > Hello, Alexander. > > We should either combine these 2 fixes together or back port them separately. I don?t think it?s a good idea to mix different fixes in a single back port. > It could be a good to also back port 8012026, but as a separate fix. > >>> The back-port and the main fix integrated into JDK 8 are slightly different. > Dmitry, could you pleas tell what?s the difference? > > Thank you. > With best regards. Petr. > > > 20 ????. 2014 ?., ? 1:51 ????? ???????, Alexander Scherbatiy ???????(?): > >> Could you look at the JDK-8012026 fix to investigate, should the NSTrackingActiveInActiveApp option be changed to NSTrackingActiveAlways >> for the resetTrackingRect method in the AWTView.m file for the backport? >> http://mail.openjdk.java.net/pipermail/awt-dev/2013-August/005347.html >> http://cr.openjdk.java.net/~pchelko/8012026/webrev.00/ >> >> Thanks, >> Alexandr. >> >> On 2/11/2014 1:46 PM, dmitry markov wrote: >>> Hello, >>> >>> Could you review a back-port of 7171045 to JDK 7u, please? The back-port and the main fix integrated into JDK 8 are slightly different. >>> >>> bug: http://bugs.sun.com/view_bug.do?bug_id=7171045 >>> webrev for jdk7u: http://cr.openjdk.java.net/~dmarkov/7171045/jdk7u/webrev.00/ >>> jdk8 changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1 >>> technical review for jdk8: http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003238.html >>> >>> Please note: the fix for 7171045 was partly backported to JDK 7u (see http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003376.html for details). However, some problems related to this case still take place on JDK 7u. So it is necessary to backport full changeset integrated into JDK 8. >>> >>> Thanks, >>> Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140220/931630ec/attachment.html From petr.pchelko at oracle.com Thu Feb 20 03:48:08 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Thu, 20 Feb 2014 15:48:08 +0400 Subject: [7u] Review request for 7171045 [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag. In-Reply-To: <5305E9C0.6040909@oracle.com> References: <52F9F190.6090503@oracle.com> <5305D016.1080501@oracle.com> <5305E9C0.6040909@oracle.com> Message-ID: Hello, Dmitry. > The difference between this backport and main fix is the changes in CViewPlatformEmbeddedFrame.java. The original changeset integrated into JDK 8 (http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1) does not have them, since this file was added later. Thank you. > If it is better to back port the changes for JDK-8012026 under separate fix, I can do it. Could you please do that? It was a CAP bug, so it was quite important. The fix looks good to me. With best regards. Petr. 20 ????. 2014 ?., ? 3:40 ????? ???????, dmitry markov ???????(?): > Hello Alexander, Petr, > > Thank you for review. > I agree, the option NSTrackingActiveInActiveApp should be changed to NSTrackingActiveAlways. If it is better to back port the changes for JDK-8012026 under separate fix, I can do it. > > The difference between this backport and main fix is the changes in CViewPlatformEmbeddedFrame.java. The original changeset integrated into JDK 8 (http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1) does not have them, since this file was added later. > > Thanks, > Dmitry > > On 20/02/2014 14:09, Petr Pchelko wrote: >> Hello, Alexander. >> >> We should either combine these 2 fixes together or back port them separately. I don?t think it?s a good idea to mix different fixes in a single back port. >> It could be a good to also back port 8012026, but as a separate fix. >> >>>> The back-port and the main fix integrated into JDK 8 are slightly different. >> Dmitry, could you pleas tell what?s the difference? >> >> Thank you. >> With best regards. Petr. >> >> >> 20 ????. 2014 ?., ? 1:51 ????? ???????, Alexander Scherbatiy ???????(?): >> >>> Could you look at the JDK-8012026 fix to investigate, should the NSTrackingActiveInActiveApp option be changed to NSTrackingActiveAlways >>> for the resetTrackingRect method in the AWTView.m file for the backport? >>> http://mail.openjdk.java.net/pipermail/awt-dev/2013-August/005347.html >>> http://cr.openjdk.java.net/~pchelko/8012026/webrev.00/ >>> >>> Thanks, >>> Alexandr. >>> >>> On 2/11/2014 1:46 PM, dmitry markov wrote: >>>> Hello, >>>> >>>> Could you review a back-port of 7171045 to JDK 7u, please? The back-port and the main fix integrated into JDK 8 are slightly different. >>>> >>>> bug: http://bugs.sun.com/view_bug.do?bug_id=7171045 >>>> webrev for jdk7u: http://cr.openjdk.java.net/~dmarkov/7171045/jdk7u/webrev.00/ >>>> jdk8 changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1 >>>> technical review for jdk8: http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003238.html >>>> >>>> Please note: the fix for 7171045 was partly backported to JDK 7u (see http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003376.html for details). However, some problems related to this case still take place on JDK 7u. So it is necessary to backport full changeset integrated into JDK 8. >>>> >>>> Thanks, >>>> Dmitry > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140220/bb8c94f4/attachment-0001.html From alexandr.scherbatiy at oracle.com Thu Feb 20 04:10:16 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 20 Feb 2014 16:10:16 +0400 Subject: [7u] Review request for 7171045 [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag. In-Reply-To: <5305E9C0.6040909@oracle.com> References: <52F9F190.6090503@oracle.com> <5305D016.1080501@oracle.com> <5305E9C0.6040909@oracle.com> Message-ID: <5305F0A8.5040400@oracle.com> The fix looks good for me. Thanks, Alexandr. On 2/20/2014 3:40 PM, dmitry markov wrote: > Hello Alexander, Petr, > > Thank you for review. > I agree, the option NSTrackingActiveInActiveApp should be changed to > NSTrackingActiveAlways. If it is better to back port the changes for > JDK-8012026 under separate fix, I can do it. > > The difference between this backport and main fix is the changes in > CViewPlatformEmbeddedFrame.java. The original changeset integrated > into JDK 8 (http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1) > does not have them, since this file was added later. > > Thanks, > Dmitry > > On 20/02/2014 14:09, Petr Pchelko wrote: >> Hello, Alexander. >> >> We should either combine these 2 fixes together or back port them separately. I don?t think it?s a good idea to mix different fixes in a single back port. >> It could be a good to also back port 8012026, but as a separate fix. >> >>>> The back-port and the main fix integrated into JDK 8 are slightly different. >> Dmitry, could you pleas tell what?s the difference? >> >> Thank you. >> With best regards. Petr. >> >> >> 20 ????. 2014 ?., ? 1:51 ????? ???????, Alexander Scherbatiy ???????(?): >> >>> Could you look at the JDK-8012026 fix to investigate, should the NSTrackingActiveInActiveApp option be changed to NSTrackingActiveAlways >>> for the resetTrackingRect method in the AWTView.m file for the backport? >>> http://mail.openjdk.java.net/pipermail/awt-dev/2013-August/005347.html >>> http://cr.openjdk.java.net/~pchelko/8012026/webrev.00/ >>> >>> Thanks, >>> Alexandr. >>> >>> On 2/11/2014 1:46 PM, dmitry markov wrote: >>>> Hello, >>>> >>>> Could you review a back-port of 7171045 to JDK 7u, please? The back-port and the main fix integrated into JDK 8 are slightly different. >>>> >>>> bug:http://bugs.sun.com/view_bug.do?bug_id=7171045 >>>> webrev for jdk7u:http://cr.openjdk.java.net/~dmarkov/7171045/jdk7u/webrev.00/ >>>> jdk8 changeset:http://hg.openjdk.java.net/jdk8/awt/jdk/rev/e23311e924b1 >>>> technical review for jdk8:http://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003238.html >>>> >>>> Please note: the fix for 7171045 was partly backported to JDK 7u (seehttp://mail.openjdk.java.net/pipermail/awt-dev/2012-August/003376.html for details). However, some problems related to this case still take place on JDK 7u. So it is necessary to backport full changeset integrated into JDK 8. >>>> >>>> Thanks, >>>> Dmitry > From gnu.andrew at redhat.com Thu Feb 20 07:30:50 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Thu, 20 Feb 2014 10:30:50 -0500 (EST) Subject: RFR: Allow using a system installed libpng In-Reply-To: <5305C13B.4080307@oracle.com> References: <52F4D650.8020301@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> <5305C13B.4080307@oracle.com> Message-ID: <590004832.6651990.1392910250344.JavaMail.zimbra@redhat.com> ----- Original Message ----- > Hi Omair, > > > Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) > > If you change client code, then the fix should go to the client repo to > avoid merge conflicts and allow for more manual testing prior to > integrating the changes into the master repo. Perhaps this would be an appropriate point to clarify what constitutes 'client code'? > > -- > best regards, > Anthony > > On 2/19/2014 8:16 PM, Omair Majid wrote: > > * Magnus Ihse Bursie [2014-02-19 06:59]: > >> On 2014-02-17 10:16, Erik Joelsson wrote: > >>> At least to me this looks good, but better let Magnus and Andrew > >>> have their say too. > >> > >> Looks good to me! > > > > Thanks for the reviews, everyone! > > > > I have filed https://bugs.openjdk.java.net/browse/JDK-8035341 to track > > the issue. Can someone please point me some docs that explains what I > > need to do to to this bug once I have pushed the fix? > > > > Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) > > > > Thanks, > > Omair > > > Thanks, -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From omajid at redhat.com Thu Feb 20 07:38:21 2014 From: omajid at redhat.com (Omair Majid) Date: Thu, 20 Feb 2014 10:38:21 -0500 Subject: RFR: Allow using a system installed libpng In-Reply-To: <5305DA6B.7010607@oracle.com> References: <820684394.2412316.1392227222561.JavaMail.zimbra@redhat.com> <52FBFA7C.2020100@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> <5305C13B.4080307@oracle.com> <5305DA6B.7010607@oracle.com> Message-ID: <20140220153821.GA2186@redhat.com> * Magnus Ihse Bursie [2014-02-20 05:35]: > From my point of view, you can go either way. The changes are mostly > in the build code, except for an include statement. But if the AWT > folks feel more confident that way, sure, you can go via client. Pushed: http://hg.openjdk.java.net/jdk9/client/rev/bfc1c131e540 http://hg.openjdk.java.net/jdk9/client/jdk/rev/5e503831b142 > Just a note: Since you are updating the generated-configure.sh, > someone with access to the closed sources will need to push a > follow-up (the same bug number can be used) with an updated version > of the closed generated-configure.sh. If you go in via the client > forest, I'd prefer if someone from client did that. Please let me know if there is anything I can do to help. Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From james.graham at oracle.com Thu Feb 20 14:47:28 2014 From: james.graham at oracle.com (Jim Graham) Date: Thu, 20 Feb 2014 14:47:28 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <5302182D.3070600@oracle.com> References: <52A723B8.7090705@oracle.com> <52A7A319.80001@oracle.com> <52A82DE8.4070707@oracle.com> <52A840AE.2010000@oracle.com> <52A9D341.2070008@oracle.com> <52AA0C32.504@oracle.com> <52AA0E11.3060706@oracle.com> <52AA39A2.4060503@oracle.com> <52AA3E92.7040302@oracle.com> <52B09644.6050201@oracle.com> <52B0F447.2020207@oracle.com> <52DE761E.2000201@oracle.com> <52E192F0.7010107@oracle.com> <52E27CDA.40703@oracle.com> <52E31866.3010508@oracle.com> <52E7CE5B.4070101@oracle.com> <52EAD304.2090809@oracle.com> <52EBB516.70906@oracle.com> <52EC4F5E.7060906@oracle.com> <52EFA980.6000404@oracle.com> <52F580C1.3020906@oracle.com> <52F8DE2A.4080304@oracle.com> <52F962CD.2050301@oracle.com> <52F96AE2.10106@oracle.com> <52FA67A8.1010600@oracle.com> <52FA7DCD.80405@oracle.com> <52FCC28D.5010007@oracle.com> <52FD4CB6.2090805@oracle.com> <52FDC1D1.8050907@oracle.com> <52FEBC4E.9010202@oracle.com> <5302182D.3070600@oracle.com> Message-ID: <53068600.80501@oracle.com> Yes, approved. ...jim On 2/17/14 6:09 AM, Anton V. Tarasov wrote: > Jim, so this is ready for a push then. > > Thanks! > Anton. > > On 15.02.2014 5:01, Jim Graham wrote: >> I don't need to see an update for that. I didn't read the entire >> webrev, but I looked at this one piece of code and if that was the >> only thing changed then I think that dealt with the outstanding issues... >> >> ...jim >> >> On 2/13/14 11:12 PM, Anton V. Tarasov wrote: >>> On 14.02.2014 2:52, Jim Graham wrote: >>>> >>>> >>>> On 2/13/14 5:03 AM, Anton V. Tarasov wrote: >>>>> Hi Jim, >>>>> >>>>> Please, look at the update: >>>>> >>>>> http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.5 >>>>> >>>>> Here I'm correcting the rect after the transform in SG2D: >>>>> >>>>> 2123 // In case of negative scale transform, reflect the rect >>>>> coords. >>>>> 2124 if (w < 0) { >>>>> 2125 w *= -1; >>>>> 2126 x -= w; >>>>> 2127 } >>>>> 2128 if (h < 0) { >>>>> 2129 h *= -1; >>>>> 2130 y -= h; >>>>> 2131 } >>>>> >>>>> >>>>> The blit direction (dx, dy) remains transformed. Is this the right >>>>> behavior from your perspective? >>>> >>>> Yes, that looks good. I wonder if the "w *= -1" results in a multiply >>>> byte code whereas "w = -w" would avoid the multiply? >>>> >>>> ...jim >>> >>> Jim, >>> >>> Yes, this indeed results in different byte code instructions (imult & >>> ineg). Just for curiosity I did some measuring which showed negatioation >>> worked 10% faster :) >>> Well, I'll fix it but let me please not send an update... >>> >>> Thanks! >>> Anton. >>> > From amling at palantir.com Wed Feb 19 14:25:38 2014 From: amling at palantir.com (Keith Amling) Date: Wed, 19 Feb 2014 14:25:38 -0800 Subject: EventQueue NPE? In-Reply-To: <530474AF.7050205@oracle.com> References: <20140219040301.GL9822@palantir.com> <530474AF.7050205@oracle.com> Message-ID: <20140219222538.GN9822@palantir.com> Mmm, based on the trail of bugs cited on this thread sounds like it's very much known and dealt with which is great. Unfortunately, for us upgrading in the short term (and especially as far as JDK 8 where one of those is marked fixed) is beyond hopeless so it sounds like we're SOL. Keith Thus spake Alexander Scherbatiy, at Wed, Feb 19, 2014 at 01:09:03PM +0400: > Date: Wed, 19 Feb 2014 13:09:03 +0400 > From: Alexander Scherbatiy > To: Keith Amling > CC: swing-dev at openjdk.java.net, "awt-dev at openjdk.java.net" > > Subject: Re: EventQueue NPE? > > On 2/19/2014 8:03 AM, Keith Amling wrote: > >I may be barking up the wrong tree e-mailing an OpenJDK list when I've > >only reproduced this against an Oracle JDK (1.7.0_25, and in particular > >it doesn't reproduce against 1.7.0_21), but the attached file produces > >NPEs [1] via EventQueue.isDispatchThread() fairly regularly with an > >argument of 10 [threads] and can even produce it with just 2 (although > >less often). > This is an interesting exception. I am able to reproduce it with > the JDK 7u51 but > not able to reproduce it with the JDK 8. > > Could you check that the issue is not reproduced on your side > with the latest JDK 8: > https://urldefense.proofpoint.com/v1/url?u=https://jdk8.java.net/download.html&k=fDZpZZQMmYwf27OU23GmAQ%3D%3D%0A&r=BTdtcPIZXD8V7r6BhVE1Cy1S1ITG2lF8LZPYHbBpv%2B0%3D%0A&m=bNoFskKfZDc6dI4KQbzRlnScA6f5c6N035%2BomhAi8Zc%3D%0A&s=cdc869cdb6dce557a5465ba8a3d3456f6539687ed519fa62f33c56711028e3ea > > > > >We've had even weirder NPEs [2] in the code behind that but I have yet > >to distill them to a repro unfortunately. > We have several reports about this NPE like: > https://urldefense.proofpoint.com/v1/url?u=https://bugs.openjdk.java.net/browse/JDK-8019272&k=fDZpZZQMmYwf27OU23GmAQ%3D%3D%0A&r=BTdtcPIZXD8V7r6BhVE1Cy1S1ITG2lF8LZPYHbBpv%2B0%3D%0A&m=bNoFskKfZDc6dI4KQbzRlnScA6f5c6N035%2BomhAi8Zc%3D%0A&s=f59a532890c08269ae9600a7e97f8fdc8b538659b054bc66b296ba03fe63f85d > > It should have been already fixed in JDK 7u60 and in the JDK 8. > > Thanks, > Alexandr. > > > >Are either of these known? Is there something we should be doing in our > >rather multi-threaded environment to protect this code? > > > >Keith > > > >[1] E.g.: > > > >>java.lang.NullPointerException > >> at java.awt.EventQueue.isDispatchThread(EventQueue.java:1014) > >> at EQNPE$1.run(EQNPE.java:23) > >[2] Ending in: > > > >>java.lang.NullPointerException > >> at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1011) > >> at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1007) > >> at sun.awt.HeadlessToolkit.getSystemEventQueueImpl(HeadlessToolkit.java:352) > >> at java.awt.Toolkit.getSystemEventQueue(Toolkit.java:1717) > >> > From anthony.petrov at oracle.com Fri Feb 21 03:43:36 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Fri, 21 Feb 2014 15:43:36 +0400 Subject: RFR: Allow using a system installed libpng In-Reply-To: <590004832.6651990.1392910250344.JavaMail.zimbra@redhat.com> References: <52F4D650.8020301@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> <5305C13B.4080307@oracle.com> <590004832.6651990.1392910250344.JavaMail.zimbra@redhat.com> Message-ID: <53073BE8.7030305@oracle.com> Hi Andrew, "Client code" is basically anything in 2D, AWT, i18n, beans, a11y, ImageIO, Sound, or Swing. I.e., anything related to GUI/desktop. In this particular case Omair is changing the SplashScreen code which belongs to AWT, hence the choice of the client repo for integration. -- best regards, Anthony On 2/20/2014 7:30 PM, Andrew Hughes wrote: > ----- Original Message ----- >> Hi Omair, >> >>> Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) >> >> If you change client code, then the fix should go to the client repo to >> avoid merge conflicts and allow for more manual testing prior to >> integrating the changes into the master repo. > > Perhaps this would be an appropriate point to clarify what constitutes > 'client code'? > >> >> -- >> best regards, >> Anthony >> >> On 2/19/2014 8:16 PM, Omair Majid wrote: >>> * Magnus Ihse Bursie [2014-02-19 06:59]: >>>> On 2014-02-17 10:16, Erik Joelsson wrote: >>>>> At least to me this looks good, but better let Magnus and Andrew >>>>> have their say too. >>>> >>>> Looks good to me! >>> >>> Thanks for the reviews, everyone! >>> >>> I have filed https://bugs.openjdk.java.net/browse/JDK-8035341 to track >>> the issue. Can someone please point me some docs that explains what I >>> need to do to to this bug once I have pushed the fix? >>> >>> Should I be pushing this to jdk9/dev ? (Or to jdk9/client?) >>> >>> Thanks, >>> Omair >>> >> > > Thanks, > From Alan.Bateman at oracle.com Fri Feb 21 04:00:07 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Feb 2014 12:00:07 +0000 Subject: RFR: Allow using a system installed libpng In-Reply-To: <53073BE8.7030305@oracle.com> References: <52F4D650.8020301@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> <5305C13B.4080307@oracle.com> <590004832.6651990.1392910250344.JavaMail.zimbra@redhat.com> <53073BE8.7030305@oracle.com> Message-ID: <53073FC7.2030204@oracle.com> On 21/02/2014 11:43, Anthony Petrov wrote: > Hi Andrew, > > "Client code" is basically anything in 2D, AWT, i18n, beans, a11y, > ImageIO, Sound, or Swing. I.e., anything related to GUI/desktop. > > In this particular case Omair is changing the SplashScreen code which > belongs to AWT, hence the choice of the client repo for integration. > Hopefully in time it will be possible to drop jdk9/client and have the changes to the client libraries pushed to jdk9/dev along with everything else. This would make things a lot simpler to understand and would also ensure that jdk9/dev always has the latest bits. I would expect it would reduce the integration effort too. -Alan. From Sergey.Bylokhov at oracle.com Fri Feb 21 05:47:10 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 21 Feb 2014 17:47:10 +0400 Subject: [9] Review request for 8032078: CPlatformWindow.setWindowState throws RuntimeException, if windowState=ICONIFIED|MAXIMIZED_BOTH In-Reply-To: <53046DB1.10500@oracle.com> References: <52DE59BE.80907@oracle.com> <607D029B-D860-4E41-80DC-FAE824071E22@oracle.com> <52E26E0C.7090501@oracle.com> <53020BF2.7090407@oracle.com> <53036D46.2030303@oracle.com> <53036FB8.9040407@oracle.com> <53046DB1.10500@oracle.com> Message-ID: <530758DE.2090009@oracle.com> Hello, Anton. The fix looks good. On 19.02.2014 12:39, Anton Litvinov wrote: > Hello Sergey, > > Thank you for the review of the corrected version of the fix. It is a > good idea to verify workability of "setVisible" method, but I think > that "setVisible" method is not related to the original bug and we > should not include testing of this method into the fix. Also for me it > is not clear, what exactly should be tested in "setVisible" method > test, because: > > - "Frame.state" field is changed immediately during the call > "Frame.setExtendedState" for both visible and invisible frames. > - According to the documentation of "Frame.setExtendedState" method, > when "setVisible(true)" is called, the frame will only attempt to > apply the state and reception of any > "WindowEvent.WINDOW_STATE_CHANGED" events is not guaranteed. > > I suggest to create a separate bug on creation of the test for > verification of "setVisible" method, if it is necessary to verify this > method and, if no analogous regression tests exist currently. > > Thank you, > Anton > > On 2/18/2014 6:35 PM, Sergey Bylokhov wrote: >> Hi, Anton. >> The fix looks good to me. But since you change setVisible() method >> you need to check it in the test too. >> >> On 18.02.2014 18:25, Anton Litvinov wrote: >>> Hello Sergey, >>> >>> Thank you for the review of this fix. The fix was corrected to >>> address your remarks. Could you please review the new version of the >>> fix. >>> >>> Webrev: http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.01 >>> >>> Changes in the fix are following: >>> >>> 1. Check for a compound state with ICONIFIED bit was moved from >>> "switch" block of "CPlatformWindow.setWindowState" method to the >>> separate "if" statement before "switch" block. >>> 2. The same pattern was applied also to "CPlatformWindow.setVisible" >>> method. >>> 3. The comment was changed. >>> 4. The regression test was changed to also check cases with >>> undecorated frame and to verify that changes between the states >>> "ICONIFIED | MAXIMIZED_BOTH <--> NORMAL, ICONIFIED, MAXIMIZED_BOTH" >>> are committed properly and do not raise exceptions. >>> >>> Thank you, >>> Anton >>> On 2/17/2014 5:17 PM, Sergey Bylokhov wrote: >>>> Hi, Anton. >>>> I suppose that CPW should have the same behavior on setVisible() >>>> and setExtendedState() for compound states? >>>> Also I suggest to change comment to describe that on macosx we >>>> support ICONIFY state only for compounds states, currently the >>>> comment is quite obvious. Probably the code could be improved and >>>> we can change windowState to ICONIFY before the switch for compound >>>> states? >>>> >>>> On 24.01.2014 17:43, Anton Litvinov wrote: >>>>> Hello Petr, >>>>> >>>>> Thank you very much for review of this fix. I am not sure that the >>>>> behavior of "ICONIFIED | MAXIMIZED_BOTH" should be completely the >>>>> same as "ICONIFIED" on OS X, but I think that in this bitwise mask >>>>> the most important bit is "ICONIFIED". And, if this compound state >>>>> is valid, then as a result the window should be minimized. >>>>> >>>>> This combination of flags is handled absolutely differently in >>>>> Windows, Solaris/Linux implementation of JDK. Particularly on >>>>> Windows the frame becomes minimized and will be always maximized, >>>>> if the frame's icon on the taskbar is clicked. But >>>>> "Frame.getExtendedState", "WFramePeer.getState()" will not always >>>>> return "ICONIFIED | MAXIMIZED_BOTH", instead of this "ICONIFIED" >>>>> will be returned, when before a call to "Frame.setExtendedState" >>>>> method "Frame.state" was not "MAXIMIZED_BOTH". >>>>> >>>>> The common feature of Windows and Solaris/Linux code is the fact >>>>> that the implementation of "java.awt.peer.FramePeer.setState" does >>>>> not throw an exception unlike OS X code. >>>>> >>>>> Yes, this bug may be fixed in "Frame.isFrameStateSupported", but >>>>> the change will require introduction of code checking, either it >>>>> is executed on OS X platform or not, because this method should >>>>> not be changed for other platforms, since they depend on it for a >>>>> long time since 2004, when it was introduced by the fix for the >>>>> bug JDK-4987087. From my opinion, making >>>>> "Frame.isFrameStateSupported" return false for this compound state >>>>> on OS X platform will make the code of this method not truly >>>>> shared and will not let code calling "Frame.setExtendedState" with >>>>> the state "ICONIFIED | MAXIMIZED_BOTH" to minimize the frame. >>>>> >>>>> Thank you, >>>>> Anton >>>>> >>>>> On 1/21/2014 4:26 PM, Petr Pchelko wrote: >>>>>> Hello, Anton. >>>>>> >>>>>> Are we sure that the behavior of ICONIFIED | MAXIMIZED_BOTH >>>>>> should be the same as just ICONIFIED? >>>>>> What does this combination of flags do on other platforms? >>>>>> >>>>>> I would expect that if the frame is not maximized, this >>>>>> combination would iconify it, but when you deiconify the frame >>>>>> should go to maximized state. However, I?m quite sure you can?t >>>>>> do it like this on Mac OS X, because we use the native >>>>>> zoom mechanism for maximization and do not have enough control >>>>>> over it. So, in my opinion this should be fixed by >>>>>> making Frame.isFrameStateSupported return false for this >>>>>> combination. What do you think? >>>>>> >>>>>> With best regards. Petr. >>>>>> >>>>>> 21 ???. 2014 ?., ? 3:27 ????? ???????, Anton >>>>>> Litvinov ???????(?): >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Could you please review the following fix for the bug. >>>>>>> >>>>>>> Bug:https://bugs.openjdk.java.net/browse/JDK-8032078 >>>>>>> Webrev:http://cr.openjdk.java.net/~alitvinov/8032078/jdk9/webrev.00 >>>>>>> >>>>>>> The bug consists in undocumented throwing of "RuntimeException" >>>>>>> from the method "Frame.setExtendedState" for the compound state >>>>>>> "ICONIFIED | MAXIMIZED_BOTH" that is supported according to a >>>>>>> result of "Frame.isFrameStateSupported" method call on OS X. >>>>>>> >>>>>>> The solution adds handling of the mask "ICONIFIED | >>>>>>> MAXIMIZED_BOTH" to "switch" block of the method >>>>>>> "sun.lwawt.macosx.CPlatformWindow.setWindowState" which >>>>>>> duplicates existing handling of the state "ICONIFIED" and >>>>>>> prevents from throwing of the exception. >>>>>>> >>>>>>> Thank you, >>>>>>> Anton >>>>> >>>> >>>> >>> >> >> > -- Best regards, Sergey. From petr.pchelko at oracle.com Fri Feb 21 06:51:43 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Fri, 21 Feb 2014 18:51:43 +0400 Subject: [9] Review request for JDK-8017472 [macosx] Transparency demo is not correctly dragged on the second monitor In-Reply-To: <52F8AE6F.6090203@oracle.com> References: <52F88D38.80903@oracle.com> <52F8A712.1010304@oracle.com> <52F8AB6F.9050301@oracle.com> <52F8AE6F.6090203@oracle.com> Message-ID: Hello, Alexander. The fix looks good. With best regards. Petr. On 10.02.2014, at 14:48, Sergey Bylokhov wrote: > Hi, Alexander. > The fix looks good. > > On 10.02.2014 14:35, Alexander Zvegintsev wrote: >> Hi Sergey, >> >> thanks for the review, updated test is located here: >> http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/01 >> >> Thanks, >> >> Alexander. >> >> On 02/10/2014 02:16 PM, Sergey Bylokhov wrote: >>> Hi, Alexander. >>> The fix looks good. >>> A few notes about the test: >>> - You should use realSync+sleep after setVisible(). >>> - The native system can change the size of the frame after setVisble(); >>> >>> On 10.02.2014 12:26, Alexander Zvegintsev wrote: >>>> Hello AWT team, >>>> >>>> please review fix >>>> http://cr.openjdk.java.net/~azvegint/jdk/9/8017472/00/ >>>> for >>>> https://bugs.openjdk.java.net/browse/JDK-8017472 >>>> >>>> Another issue was closed as a duplicate of this one, but it has a better self-explaining title: >>>> MouseEvent has wrong coordinates when using multiple monitors >>>> >>>> From mainScreen documentation[1]: >>>>> The main screen is not necessarily the same screen that contains the menu bar or has its origin at (0, 0). >>>>> The main screen refers to the screen containing the window that is currently receiving keyboard events. >>>> >>>> absY should be calculated relative to a primary screen >>>> >>>> According to documentation[2] primary screen can be obtained by call [[NSScreen screens] objectAtIndex:0]: >>>> The screen at index 0 in the returned array corresponds to the primary screen of the user?s system. >>>> [1]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/mainScreen >>>> [2]https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScreen/screens >>>> >>> >>> >> > > > -- > Best regards, Sergey. > From victor.dyakov at oracle.com Fri Feb 21 08:33:59 2014 From: victor.dyakov at oracle.com (Victor D'yakov) Date: Fri, 21 Feb 2014 20:33:59 +0400 Subject: RFR: Allow using a system installed libpng In-Reply-To: <53073FC7.2030204@oracle.com> References: <52F4D650.8020301@oracle.com> <20140212225513.GB6766@redhat.com> <1288166584.3419430.1392353961435.JavaMail.zimbra@redhat.com> <20140214172747.GE2406@redhat.com> <5301D36F.3060702@oracle.com> <53049CAD.6030005@oracle.com> <20140219161628.GA19966@redhat.com> <5305C13B.4080307@oracle.com> <590004832.6651990.1392910250344.JavaMail.zimbra@redhat.com> <53073BE8.7030305@oracle.com> <53073FC7.2030204@oracle.com> Message-ID: <53077FF7.4080305@oracle.com> Added 2D Victor On 21.02.2014 16:00, Alan Bateman wrote: > On 21/02/2014 11:43, Anthony Petrov wrote: >> Hi Andrew, >> >> "Client code" is basically anything in 2D, AWT, i18n, beans, a11y, >> ImageIO, Sound, or Swing. I.e., anything related to GUI/desktop. >> >> In this particular case Omair is changing the SplashScreen code which >> belongs to AWT, hence the choice of the client repo for integration. >> > Hopefully in time it will be possible to drop jdk9/client and have the > changes to the client libraries pushed to jdk9/dev along with > everything else. This would make things a lot simpler to understand > and would also ensure that jdk9/dev always has the latest bits. I > would expect it would reduce the integration effort too. > > -Alan. > From james.graham at oracle.com Fri Feb 21 15:54:06 2014 From: james.graham at oracle.com (Jim Graham) Date: Fri, 21 Feb 2014 15:54:06 -0800 Subject: [OpenJDK 2D-Dev] [9] Review request for 8029339 Custom MultiResolution image support on HiDPI displays In-Reply-To: <53037D3D.80709@oracle.com> References: <52D51764.8020103@oracle.com> <52DF2F98.3030503@oracle.com> <52F4BCEB.9040702@oracle.com> <52F5782A.9060300@oracle.com> <52FB7E3E.6050000@oracle.com> <52FC14EC.9080503@oracle.com> <53037D3D.80709@oracle.com> Message-ID: <5307E71E.50607@oracle.com> Hi Alexandr, On 2/18/14 7:33 AM, Alexander Scherbatiy wrote: > Hi Jim, > > Let's divide the discussion into two part. > > 1. Where it is better to hold resolution variants? > Putting resolution variants in Image class brings some questions like: > - Some type of images do not need to have resolution variants > - Should resolution variants have the same type as the base image? > - getResolutionVariants() method can return copy of the original list > so add/removeRV methods should be also added. > > There are pros and cons for placing resolution variants to Image > class or to a separate intreface. I agree that this could be a separate interface. In my examples below I was just sticking them inside an "Image{}" to show where they lived in the set of involved objects, not a specific recommendation that they actually be new methods on the base class itself. I probably should have put a comment there about that. With respect to add/remove - that is assuming a need for manual construction of an image set, right? Forgive me if I'm forgetting something, but I seem to recall that manual Multi-Res images was proposed as a way for developers to introduce @2x support themselves, but if we are internally managing @2x and -DPI variants for them, then I'm not sure if there is actual developer need to manually construct their own. Am I forgetting something? > 2. Using scale factor/image sizes/scaled image sizes to retreive a > resolution variant. > > May be it is better to have a structure that provide all necessary > information to query the resolution variant: scale factor, draw area > width/height, transformed area width/height? > > For example: > --------------------- > public interface MultiResolutionImage { > > interface DrawAreaInfo { > > float getScaleFactor(); > float getAreaWidth(); > float getAreaHeight(); > float getTransformedAreaWidth(); > float getTransformedAreaHeight(); > } > > public Image getResolutionVariant(DrawAreaInfo drawAreaInfo) ; > public List getResolutionVariants(); > } > --------------------- The problem with a constructor is that this is something that is (potentially) done on every drawImage() call, which means we are inviting GC into the equation. If we can come up with a simple "just a couple/3/4 numbers" way to embed that data into a method call argument list then we can make this lighter weight. What about simply having floating point (double) dimensions on the rendered size plus a single floating point "logical DPI" for the screen? If the image is known (either passed as an argument or the method is called on the image), then it can provide the original WH. > The MultiResolutionImage default implementation could allow to use > different strategies like scale factor/transfom/OS based > to query a resolution variant. The OS based strategy can be used by > default. For Mac policy, all we need is the transformed dimensions, which can be passed in as FP for generality. For Windows policy, all we need is logical DPI for the screen. What other information would we need, or would an algorithm like to use, that can't be computed from those 2 pieces? ...jim > Thanks, > Alexandr. > > > On 2/13/2014 4:42 AM, Jim Graham wrote: >> On 2/12/14 5:59 AM, Alexander Scherbatiy wrote: >>> On 2/8/2014 4:19 AM, Jim Graham wrote: >>>> The primary thing that I was concerned about was the presence of >>>> integers in the API when Windows uses non-integer multiples >>> It would make sense to pass real numbers to the >>> getResolutionVariant() method if the difference between resolution >>> variants sizes is 1. >>> It seems that it is not a common case. >> >> I was thinking of other API that is related to this, such as the API >> that queries the scaling factor from a SurfaceManager. I seem to >> remember some integer return values in that, but Windows might have >> the answer 1.4 or 1.8, depending on the screen scaling factor that was >> determined from the UI. >> >> In terms of the getResolutionVariant() method here, those non-integer >> screen scaling factors don't directly impact this API. But, we have >> some issues with the use of integers there from other sources: >> >> - That API assumes that the caller will determine the pixel size >> needed, but the actual media choice is determined with different >> techniques on Mac and Windows so this means that the caller will have >> to worry about platform conventions. Is that the right tradeoff? >> >> - The technique recommended for Mac involves computing the precise >> size desired using the current transform, which may be a floating >> point value, so the integer values used in this API are already >> approximations and there is no documentation on how to generate the >> proper integer. In particular, the current code in SG2D naively uses >> a cast to integer to determine the values to supply which means a >> transformed size of W+0.5 will be truncated to W and the lower >> resolution image will be used. Does that conform to Mac guidelines? Do >> they require the truncated size to reach W+1 before the next size is >> used? Passing in float or double values would sidestep all of that >> since then the comparisons would be done with full precision, but as >> long as we can determine a "best practices compatible with all >> platforms" rule on how to round to integers, then integers are OK there. >> >> - The Windows document you cite below suggests that the determination >> should be made by looking at the Screen DPI and choosing the next >> higher media variant based on that screen DPI. They do not specify >> choosing media based on the current transform as is done for Mac. If >> we stick with supplying values that are used to determine which media >> to use, then on Windows we should not take the transform into account, >> but instead query the SurfaceManager for the scale factor and only >> transform by those values (even if the current transform was manually >> overridden to identity). >> >> There are pros and cons to both approaches. >> >> Mac ensures that you are always using the best media for any given >> render operation. >> >> But, Windows ensure more consistency in the face of other scaling. >> >> The thing to consider is that if you have a 500x500 image with a >> 1000x1000 variant and you rendering it at 500x500 and then 501x501, >> that first jump will be fairly jarring as the scaled version of the >> 1000x1000 will not look precisely like the original 500x500 did. With >> @2x images only, this effect is minimized so the advantage of always >> using "the best media for a given render operation" may outweigh the >> inconsistency issue. But, on Windows where the media are 1.4x or 1.8x >> in size, a downscaled image will start to show more interpolation >> noise and so the balance of the two choices may shift more towards not >> wanting a jarring shift. >> >> We might want one or more of the following: >> >> - Developer chooses policy (TX_AWARE, DPI_AWARE, ALWAYS_LARGEST, NONE, >> PLATFORM) where the last policy would use TX_AWARE on Mac and >> DPI_AWARE on Windows >> >> - We create our own policy and always use it (TX_AWARE? or DPI_AWARE?) >> >> - We create our own policy that dynamically chooses one of the above >> strategies depending on platform or available media or ??? >> >> - We could create an optional interface for them to install their own >> algorithm as well. I think it would work best as a delegate interface >> that one installs into Image so that it can be used with any image >> without having to subclass (it wouldn't really have much to do for >> BufferedImages or VolatileImages, though): >> >> class Image { >> void setResolutionHelper(ImageResolutionHelper foo); >> List getResolutionVariants(); >> } >> >> or: >> >> class Graphics { >> void setResolutionHelper(ImageResolutionHelper foo); >> } >> >> or - anywhere else it could be installed more centrally (per App >> context)? >> >> and the interface would be something like one of these variants: >> >> interface ImageResolutionHelper { >> // This version would prevent substituting a random image: >> // They have to return an index into the List for that >> image... >> public int chooseVariant(Image img, double dpi, number w, number h); >> >> or: >> >> // This version would allow substituting an arbitrary image: >> public Image getVariant(Image img, double dpi, number w, number h); >> } >> >> Since they would be in full control of the policy, though, we would >> unfortunately always have to call this, there would be no more testing >> in SG2D to see "if" we need to deal with DPI, though perhaps we could >> document some internal conditions in which we do not call it for >> common cases (but that would have to be well agreed not to get in the >> way of reasonable uses of the API and well documented)? >> >> Note that we would have to do a security audit to make sure that >> random image substitution couldn't allow any sort of "screen phishing" >> exploit. >> >> ...jim >> >>>> and also what policy they use for choosing scaled images. >>>> >>>> I don't see a mention of taking the current transform into account, >>>> just physical issues like screen DPI and form factor. They talk about >>>> resolution plateaus and in their recommendations section they tell the >>>> developer to use a particular property that tells them the screen >>>> resolution to figure out which image to load if they are loading >>>> manually. There is no discussion about dynamically loading multiple >>>> versions of the image based on a dynamic program-applied transform >>>> factor as is done on MacOS. >>>> >>>> Also, they tell developers to draw images to a specific size rather >>>> than using auto-sizing. That begs the question as to how they >>>> interpret a call to draw an image just using a location in the >>>> presence of various DPI factors. >>> There is an interesting doc that describes how to write DPI-aware >>> Win32 applications: >>> http://msdn.microsoft.com/en-us/library/dd464646%28v=vs.85%29.aspx >>> It is suggested to handle WM_DPICHANGED message, load the graphic >>> that has slightly greater resolution to the current DPI and use >>> StretchBlt >>> to scale down the image. >>> >>> Thanks, >>> Alexandr. >>> >>>> >>>> ...jim >>>> >>>> On 2/7/14 3:00 AM, Alexander Scherbatiy wrote: >>>>> On 1/22/2014 6:40 AM, Jim Graham wrote: >>>>>> Hi Alexander, >>>>>> >>>>>> Before we get too far down the road on this API, I think we >>>>>> understand >>>>>> the way in which MacOS processes multi-resolution images for HiDPI >>>>>> screens, but have we investigated the processes that Windows uses >>>>>> under Windows 8? My impression is that Windows 8 has included a >>>>>> number of new techniques for dealing with the high resolution >>>>>> displays >>>>>> that it will run on in the Windows tablet and mobile industries and >>>>>> that these will also come into play as 4K displays (already >>>>>> available) >>>>>> become more common on the desktop. We should make sure that what we >>>>>> come up with here can provide native compatibility with either >>>>>> platform's policies and standard practices. >>>>>> >>>>>> If you've investigated the MS policies I'd like to see a summary so >>>>>> that we can consider them as we review this API... >>>>> There is the Windows Guidelines for scaling to pixel density: >>>>> http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx >>>>> which says that Windows has automatic resource loading that >>>>> supports >>>>> three version of images scaling (100%, 140%, and 180%) >>>>> -------------------------------- >>>>> Without scaling, as the pixel density of a display device >>>>> increases, the >>>>> physical sizes of objects on screen get smaller. >>>>> When UI would otherwise be too small to touch and when text gets too >>>>> small to read, >>>>> Windows scales the system and app UI to one of the following scaling >>>>> plateaus: >>>>> >>>>> 1.0 (100%, no scaling is applied) >>>>> 1.4 (140% scaling) >>>>> 1.8 (180% scaling) >>>>> >>>>> Windows determines which scaling plateau to use based on the physical >>>>> screen size, the screen resolution, the DPI of the screen, and form >>>>> factor. >>>>> >>>>> Use resource loading for bitmap images in the app package For bitmap >>>>> images stored >>>>> in the app package, provide a separate image for each scaling >>>>> factor(100%, 140%, and 180%), >>>>> and name your image files using the "scale" naming convention >>>>> described >>>>> below. >>>>> Windows loads the right image for the current scale automatically. >>>>> -------------------------------- >>>>> >>>>> The image name convention for the various scales is: >>>>> images/logo.scale-100.png >>>>> images/logo.scale-140.png >>>>> images/logo.scale-180.png >>>>> >>>>> The 'ms-appx:///images/logo.png' uri is used to load the image >>>>> in an >>>>> application. >>>>> >>>>> If we want to support this in the same way as it is done for Mac >>>>> OS X >>>>> the WToolkit should return MultiResolution image in case if the >>>>> loaded image has .scale-* qualifiers. >>>>> The Graphics class can request an image with necessary resolution >>>>> from the MultiResolution image. >>>>> >>>>> It seems that nothing should be changed in the MultiResolution >>>>> interface in this case. >>>>> >>>>> Thanks, >>>>> Alexandr. >>>>>> >>>>>> ...jim >>>>>> >>>>>> On 1/14/14 2:54 AM, Alexander Scherbatiy wrote: >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Could you review the fix: >>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8029339 >>>>>>> webrev: http://cr.openjdk.java.net/~alexsch/8029339/webrev.00 >>>>>>> >>>>>>> This is a proposal to introduce an API that allows to create a >>>>>>> custom >>>>>>> multi resolution image. >>>>>>> >>>>>>> I. It seems reasonable that the API should provide two basic >>>>>>> operations: >>>>>>> >>>>>>> 1. Get the resolution variant based on the requested image >>>>>>> width and >>>>>>> height: >>>>>>> - Image getResolutionVariant(int width, int height) >>>>>>> >>>>>>> Usually the system provides the scale factor which represents >>>>>>> the >>>>>>> number of pixels corresponding to each linear unit on the display. >>>>>>> However, it has sense to combine the scale factor and the >>>>>>> current >>>>>>> transformations to get the actual image size to be displayed. >>>>>>> >>>>>>> 2. Get all provided resolution variants: >>>>>>> - List getResolutionVariants() >>>>>>> >>>>>>> There are several uses cases: >>>>>>> - Create a new multi-resolution image based on the given >>>>>>> multi-resolution image. >>>>>>> - Pass to the native system the multi-resolution image. For >>>>>>> example, >>>>>>> a use can set to the system the custom multi-resolution cursor. >>>>>>> >>>>>>> II. There are some possible ways where the new API can be added >>>>>>> >>>>>>> 1. java.awt.Image. >>>>>>> >>>>>>> The 2 new methods can be added to the Image class. A user can >>>>>>> override >>>>>>> the getResolutionVariant() and getResolutionVariants() methods to >>>>>>> provide the resolution variants >>>>>>> or there can be default implementations of these methods if a >>>>>>> user >>>>>>> puts resolution variants >>>>>>> to the list in the sorted order. >>>>>>> >>>>>>> To check that the image has resolution variants the following >>>>>>> statement can be used: image.getResolutionVariants().size() != 1 >>>>>>> >>>>>>> The disadvantage is that there is an overhead that the Image >>>>>>> class >>>>>>> should contain the List object and not all >>>>>>> images can have resolution variants. >>>>>>> >>>>>>> 2. Introduce new MultiResolutionImage interface. >>>>>>> >>>>>>> A user should extend Image class and implement the >>>>>>> MultiResolutionImage interface. >>>>>>> >>>>>>> For example: >>>>>>> --------------------- >>>>>>> public class CustomMultiResolutionImage extends BufferedImage >>>>>>> implements MultiResolutionImage { >>>>>>> >>>>>>> Image highResolutionImage; >>>>>>> >>>>>>> public CustomMultiResolutionImage(BufferedImage baseImage, >>>>>>> BufferedImage highResolutionImage) { >>>>>>> super(baseImage.getWidth(), baseImage.getHeight(), >>>>>>> baseImage.getType()); >>>>>>> this.highResolutionImage = highResolutionImage; >>>>>>> Graphics g = getGraphics(); >>>>>>> g.drawImage(baseImage, 0, 0, null); >>>>>>> g.dispose(); >>>>>>> } >>>>>>> >>>>>>> @Override >>>>>>> public Image getResolutionVariant(int width, int height) { >>>>>>> return ((width <= getWidth() && height <= getHeight())) >>>>>>> ? this : highResolutionImage; >>>>>>> } >>>>>>> >>>>>>> @Override >>>>>>> public List getResolutionVariants() { >>>>>>> return Arrays.asList(this, highResolutionImage); >>>>>>> } >>>>>>> } >>>>>>> --------------------- >>>>>>> >>>>>>> The current fix adds the MultiResolutionImage interface and public >>>>>>> resolution variant rendering hints. >>>>>>> >>>>>>> Thanks, >>>>>>> Alexandr. >>>>>>> >>>>> >>> > From petr.pchelko at oracle.com Mon Feb 24 01:02:13 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Mon, 24 Feb 2014 13:02:13 +0400 Subject: [9] Review request: JDK-8035640 JNU_CHECK_EXCEPTION should support c++ JNI syntax Message-ID: Hello, Please review the fix for the issue: https://bugs.openjdk.java.net/browse/JDK-8035640 The fix is available at: http://cr.openjdk.java.net/~pchelko/9/8035640/webrev.00/ In AWT code we have quite a lot of C++ sources, but JNU_CHECK_EXCEPTION macros could not be used there, because the JNI syntax is different in C++. If approved I'll integrate this fix into the client forest, because we need this in client to fix parfait issues. Thank you, With best regards. Petr. From Alan.Bateman at oracle.com Mon Feb 24 04:10:03 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 24 Feb 2014 12:10:03 +0000 Subject: [9] Review request: JDK-8035640 JNU_CHECK_EXCEPTION should support c++ JNI syntax In-Reply-To: References: Message-ID: <530B369B.3050707@oracle.com> On 24/02/2014 09:02, Petr Pchelko wrote: > Hello, > > Please review the fix for the issue: > https://bugs.openjdk.java.net/browse/JDK-8035640 > The fix is available at: > http://cr.openjdk.java.net/~pchelko/9/8035640/webrev.00/ > > In AWT code we have quite a lot of C++ sources, but JNU_CHECK_EXCEPTION macros could not be used there, because the JNI syntax is different in C++. > If approved I'll integrate this fix into the client forest, because we need this in client to fix parfait issues. > > Thank you, > With best regards. Petr. This looks okay to me. One suggestion is to use #endif /* __cplusplus */ so that it's consistent with the other usages (also makes it a bit easier when there are nested ifdefs). As regards logistics then jdk9/dev might be the more suitable forest to push this to. I suggest this because it looks to me that jdk9/client is pulling down changes from jdk9/dev very regularly (which is good). On the other hand there doesn't appear to be regular integrations from jdk9/client to jdk9/dev yet. I see changes in jdk9/client from mid-December that has still not been pushed to jdk9/dev. It's just a suggestion to ensure that the changes get to both forests in timely manner. -Alan. From petr.pchelko at oracle.com Mon Feb 24 04:21:46 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Mon, 24 Feb 2014 16:21:46 +0400 Subject: [9] Review request: JDK-8035640 JNU_CHECK_EXCEPTION should support c++ JNI syntax In-Reply-To: <530B369B.3050707@oracle.com> References: <530B369B.3050707@oracle.com> Message-ID: Hello, Alan. Thank you for the review. > This looks okay to me. One suggestion is to use #endif /* __cplusplus */ so that it's consistent with the other usages (also makes it a bit easier when there are nested ifdefs). Updated the fix: http://cr.openjdk.java.net/~pchelko/9/8035640/webrev.01/ > As regards logistics then jdk9/dev might be the more suitable forest to push this to. I suggest this because it looks to me that jdk9/client is pulling down changes from jdk9/dev very regularly (which is good). On the other hand there doesn't appear to be regular integrations from jdk9/client to jdk9/dev yet. I see changes in jdk9/client from mid-December that has still not been pushed to jdk9/dev. It's just a suggestion to ensure that the changes get to both forests in timely manner. No problem. I think we could easily wait until the next integration while dependent fixes are being reviewed. I'll push this into dev forest. With best regards. Petr. On 24.02.2014, at 16:10, Alan Bateman wrote: > On 24/02/2014 09:02, Petr Pchelko wrote: >> Hello, >> >> Please review the fix for the issue: >> https://bugs.openjdk.java.net/browse/JDK-8035640 >> The fix is available at: >> http://cr.openjdk.java.net/~pchelko/9/8035640/webrev.00/ >> >> In AWT code we have quite a lot of C++ sources, but JNU_CHECK_EXCEPTION macros could not be used there, because the JNI syntax is different in C++. >> If approved I'll integrate this fix into the client forest, because we need this in client to fix parfait issues. >> >> Thank you, >> With best regards. Petr. > This looks okay to me. One suggestion is to use #endif /* __cplusplus */ so that it's consistent with the other usages (also makes it a bit easier when there are nested ifdefs). > > As regards logistics then jdk9/dev might be the more suitable forest to push this to. I suggest this because it looks to me that jdk9/client is pulling down changes from jdk9/dev very regularly (which is good). On the other hand there doesn't appear to be regular integrations from jdk9/client to jdk9/dev yet. I see changes in jdk9/client from mid-December that has still not been pushed to jdk9/dev. It's just a suggestion to ensure that the changes get to both forests in timely manner. > > -Alan. From anthony.petrov at oracle.com Mon Feb 24 04:21:00 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Mon, 24 Feb 2014 16:21:00 +0400 Subject: [9] Review request: JDK-8035640 JNU_CHECK_EXCEPTION should support c++ JNI syntax In-Reply-To: References: <530B369B.3050707@oracle.com> Message-ID: <530B392C.8060106@oracle.com> Hi Petr, The fix looks fine to me. -- best regards, Anthony On 2/24/2014 4:21 PM, Petr Pchelko wrote: > Hello, Alan. > > Thank you for the review. > >> This looks okay to me. One suggestion is to use #endif /* __cplusplus */ so that it's consistent with the other usages (also makes it a bit easier when there are nested ifdefs). > Updated the fix: http://cr.openjdk.java.net/~pchelko/9/8035640/webrev.01/ > >> As regards logistics then jdk9/dev might be the more suitable forest to push this to. I suggest this because it looks to me that jdk9/client is pulling down changes from jdk9/dev very regularly (which is good). On the other hand there doesn't appear to be regular integrations from jdk9/client to jdk9/dev yet. I see changes in jdk9/client from mid-December that has still not been pushed to jdk9/dev. It's just a suggestion to ensure that the changes get to both forests in timely manner. > No problem. I think we could easily wait until the next integration while dependent fixes are being reviewed. I'll push this into dev forest. > > With best regards. Petr. > > On 24.02.2014, at 16:10, Alan Bateman wrote: > >> On 24/02/2014 09:02, Petr Pchelko wrote: >>> Hello, >>> >>> Please review the fix for the issue: >>> https://bugs.openjdk.java.net/browse/JDK-8035640 >>> The fix is available at: >>> http://cr.openjdk.java.net/~pchelko/9/8035640/webrev.00/ >>> >>> In AWT code we have quite a lot of C++ sources, but JNU_CHECK_EXCEPTION macros could not be used there, because the JNI syntax is different in C++. >>> If approved I'll integrate this fix into the client forest, because we need this in client to fix parfait issues. >>> >>> Thank you, >>> With best regards. Petr. >> This looks okay to me. One suggestion is to use #endif /* __cplusplus */ so that it's consistent with the other usages (also makes it a bit easier when there are nested ifdefs). >> >> As regards logistics then jdk9/dev might be the more suitable forest to push this to. I suggest this because it looks to me that jdk9/client is pulling down changes from jdk9/dev very regularly (which is good). On the other hand there doesn't appear to be regular integrations from jdk9/client to jdk9/dev yet. I see changes in jdk9/client from mid-December that has still not been pushed to jdk9/dev. It's just a suggestion to ensure that the changes get to both forests in timely manner. >> >> -Alan. > From petr.pchelko at oracle.com Mon Feb 24 05:48:17 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Mon, 24 Feb 2014 17:48:17 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <5303501D.9010108@oracle.com> References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> <52FDF0C0.6070200@oracle.com> <52FDFB29.4060901@oracle.com> <53021EDB.5010807@oracle.com> <5303501D.9010108@oracle.com> Message-ID: <41B9887A-4242-466C-9743-A0CF4304B53E@oracle.com> Hello, Alexander. The fix looks good to me. With best regards. Petr. On 18.02.2014, at 16:20, Sergey Bylokhov wrote: > Hi, Alexander. > The fix looks good then. > > On 17.02.2014 18:38, Alexander Scherbatiy wrote: >> On 2/14/2014 3:16 PM, Sergey Bylokhov wrote: >>> On 2/14/14 2:32 PM, Alexander Scherbatiy wrote: >>>> On 2/14/2014 2:12 AM, Sergey Bylokhov wrote: >>>>> Hi, Alexander. >>>>> Did you check option of loading of the picture on demand?Since most of the time x2 version is useless on non hdpi and vice versa. >>> Yes but in this particular case menu items will be painted in one particular scale only. >> >> I have created the separate issue on it: 8035069 [macosx] Loading resolution variants by demand >> https://bugs.openjdk.java.net/browse/JDK-8035069 >> >> Thanks, >> Alexandr. >>>> It's not quite true. >>>> MacOSX choses a necessary image representation based on the current transformations. Setting current transformation to scale 2x leads >>>> that the high resolution image is drawn even on non HiDPI display. >>>> >>>> There is a similar mechanism for the MultiResolution toolkit images. The base image is drawn in case if the high-resolution image has not been loaded yet. >>>> It has an issue that if there is no one more repaint event the image with high resolution is not shown. >>>> >>>> I would suggest to move this topic to a separate issue. >>>> >>>> Thanks, >>>> Alexandr. >>>> >>>>> >>>>> On 13.02.2014 18:04, Alexander Scherbatiy wrote: >>>>>> >>>>>> Hello, >>>>>> >>>>>> Could you review the fix: >>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8031573 >>>>>> webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 >>>>>> >>>>>> The NSMenu* system icons are templates and do not have image representations. >>>>>> >>>>>> The fix retrieves images with original and double size from an NSImage and put them to a MultiResolution image. >>>>>> The fix also adds sun.awt.image.MultiResolutionBufferedImage class which can be used uniformly for a Multiresolution image creation. >>>>>> >>>>>> The fix is independent of the fix 8033534 Get MultiResolution image from native system >>>>>> http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html >>>>>> because CImage.createImageFromName(imageName) never returns a MultiResolution image for templates. >>>>>> But the fix 8033534 can be updated to use the MultiResolutionBufferedImage. >>>>>> >>>>>> Thanks, >>>>>> Alexandr. >>>>>> >>>>> >>>>> >>>> >>> >>> >> > > > -- > Best regards, Sergey. > From hs at tagtraum.com Mon Feb 24 05:59:27 2014 From: hs at tagtraum.com (Hendrik Schreiber) Date: Mon, 24 Feb 2014 14:59:27 +0100 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <41B9887A-4242-466C-9743-A0CF4304B53E@oracle.com> References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> <52FDF0C0.6070200@oracle.com> <52FDFB29.4060901@oracle.com> <53021EDB.5010807@oracle.com> <5303501D.9010108@oracle.com> <41B9887A-4242-466C-9743-A0CF4304B53E@oracle.com> Message-ID: Hey guys, will this fix cover JTree folder icons as well? I.e. javax.swing.UIManager.getIcon("Tree.closedIcon") returns something that is rendered in HiDPI on a a HiDPI display? Or would that be a separate issue? Thanks, -hendrik On Feb 24, 2014, at 14:48, Petr Pchelko wrote: > Hello, Alexander. > > The fix looks good to me. > > With best regards. Petr. > > On 18.02.2014, at 16:20, Sergey Bylokhov wrote: > >> Hi, Alexander. >> The fix looks good then. >> >> On 17.02.2014 18:38, Alexander Scherbatiy wrote: >>> On 2/14/2014 3:16 PM, Sergey Bylokhov wrote: >>>> On 2/14/14 2:32 PM, Alexander Scherbatiy wrote: >>>>> On 2/14/2014 2:12 AM, Sergey Bylokhov wrote: >>>>>> Hi, Alexander. >>>>>> Did you check option of loading of the picture on demand?Since most of the time x2 version is useless on non hdpi and vice versa. >>>> Yes but in this particular case menu items will be painted in one particular scale only. >>> >>> I have created the separate issue on it: 8035069 [macosx] Loading resolution variants by demand >>> https://bugs.openjdk.java.net/browse/JDK-8035069 >>> >>> Thanks, >>> Alexandr. >>>>> It's not quite true. >>>>> MacOSX choses a necessary image representation based on the current transformations. Setting current transformation to scale 2x leads >>>>> that the high resolution image is drawn even on non HiDPI display. >>>>> >>>>> There is a similar mechanism for the MultiResolution toolkit images. The base image is drawn in case if the high-resolution image has not been loaded yet. >>>>> It has an issue that if there is no one more repaint event the image with high resolution is not shown. >>>>> >>>>> I would suggest to move this topic to a separate issue. >>>>> >>>>> Thanks, >>>>> Alexandr. >>>>> >>>>>> >>>>>> On 13.02.2014 18:04, Alexander Scherbatiy wrote: >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Could you review the fix: >>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8031573 >>>>>>> webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 >>>>>>> >>>>>>> The NSMenu* system icons are templates and do not have image representations. >>>>>>> >>>>>>> The fix retrieves images with original and double size from an NSImage and put them to a MultiResolution image. >>>>>>> The fix also adds sun.awt.image.MultiResolutionBufferedImage class which can be used uniformly for a Multiresolution image creation. >>>>>>> >>>>>>> The fix is independent of the fix 8033534 Get MultiResolution image from native system >>>>>>> http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html >>>>>>> because CImage.createImageFromName(imageName) never returns a MultiResolution image for templates. >>>>>>> But the fix 8033534 can be updated to use the MultiResolutionBufferedImage. >>>>>>> >>>>>>> Thanks, >>>>>>> Alexandr. >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>> >> >> >> -- >> Best regards, Sergey. >> > From petr.pchelko at oracle.com Tue Feb 25 02:31:56 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Tue, 25 Feb 2014 14:31:56 +0400 Subject: Proposal: Make JNU_Throw* clear a pending exception Message-ID: Hello, Core and AWT teams. In AWT we have a lot of pending exception warnings which are now being fixed. A big fraction of this warnings is about a pending JNI exception at a call to JNU_Throw*. Why don?t we add an env->ExceptionClear() call in the beginning of each JNU_Throw function? It is absolutely safe because: 1. We are rethrowing an exception an loosing the original one anyway. 2. In case there?s no pending exception the ExceptionClear is a no-op. If we do this the code would become much cleaner, because currently we have to manually clear a pending exception before every call to JNU_Throw*. What do you think about this proposal? Thank you. With best regards. Petr. From Alan.Bateman at oracle.com Tue Feb 25 02:42:33 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 25 Feb 2014 10:42:33 +0000 Subject: Proposal: Make JNU_Throw* clear a pending exception In-Reply-To: References: Message-ID: <530C7399.7050706@oracle.com> On 25/02/2014 10:31, Petr Pchelko wrote: > Hello, Core and AWT teams. > > In AWT we have a lot of pending exception warnings which are now being fixed. A big fraction of this warnings is about a pending JNI exception at a call to JNU_Throw*. > Why don?t we add an env->ExceptionClear() call in the beginning of each JNU_Throw function? It is absolutely safe because: > 1. We are rethrowing an exception an loosing the original one anyway. > 2. In case there?s no pending exception the ExceptionClear is a no-op. > > If we do this the code would become much cleaner, because currently we have to manually clear a pending exception before every call to JNU_Throw*. > > What do you think about this proposal? > I can see how this might be attractive but doesn't it mean you are suppressing an important exception? We've fixed many areas in the last few weeks and I think a common case was just that whoever wrote the original code didn't realize that some JNI functions having a pending exception when they fail. In those cases then often it is a simple matter of just returning from the JNI function (maybe after some clean-up). Are the examples that you are looking at along these lines? I guess I'm mostly interested to know whether the JNU_Throw usages are needed or not. -Alan. From alexandr.scherbatiy at oracle.com Tue Feb 25 02:53:37 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Tue, 25 Feb 2014 14:53:37 +0400 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> <52FDF0C0.6070200@oracle.com> <52FDFB29.4060901@oracle.com> <53021EDB.5010807@oracle.com> <5303501D.9010108@oracle.com> <41B9887A-4242-466C-9743-A0CF4304B53E@oracle.com> Message-ID: <530C7631.7020601@oracle.com> On 2/24/2014 5:59 PM, Hendrik Schreiber wrote: > Hey guys, > > will this fix cover JTree folder icons as well? I.e. javax.swing.UIManager.getIcon("Tree.closedIcon") returns something that is rendered in HiDPI on a a HiDPI display? This should have been already fixed as part of the issue 8024926 [macosx] AquaIcon HiDPI support https://bugs.openjdk.java.net/browse/JDK-8024926 Thanks, Alexandr. > > Or would that be a separate issue? > > Thanks, > > -hendrik > > > On Feb 24, 2014, at 14:48, Petr Pchelko wrote: > >> Hello, Alexander. >> >> The fix looks good to me. >> >> With best regards. Petr. >> >> On 18.02.2014, at 16:20, Sergey Bylokhov wrote: >> >>> Hi, Alexander. >>> The fix looks good then. >>> >>> On 17.02.2014 18:38, Alexander Scherbatiy wrote: >>>> On 2/14/2014 3:16 PM, Sergey Bylokhov wrote: >>>>> On 2/14/14 2:32 PM, Alexander Scherbatiy wrote: >>>>>> On 2/14/2014 2:12 AM, Sergey Bylokhov wrote: >>>>>>> Hi, Alexander. >>>>>>> Did you check option of loading of the picture on demand?Since most of the time x2 version is useless on non hdpi and vice versa. >>>>> Yes but in this particular case menu items will be painted in one particular scale only. >>>> I have created the separate issue on it: 8035069 [macosx] Loading resolution variants by demand >>>> https://bugs.openjdk.java.net/browse/JDK-8035069 >>>> >>>> Thanks, >>>> Alexandr. >>>>>> It's not quite true. >>>>>> MacOSX choses a necessary image representation based on the current transformations. Setting current transformation to scale 2x leads >>>>>> that the high resolution image is drawn even on non HiDPI display. >>>>>> >>>>>> There is a similar mechanism for the MultiResolution toolkit images. The base image is drawn in case if the high-resolution image has not been loaded yet. >>>>>> It has an issue that if there is no one more repaint event the image with high resolution is not shown. >>>>>> >>>>>> I would suggest to move this topic to a separate issue. >>>>>> >>>>>> Thanks, >>>>>> Alexandr. >>>>>> >>>>>>> On 13.02.2014 18:04, Alexander Scherbatiy wrote: >>>>>>>> Hello, >>>>>>>> >>>>>>>> Could you review the fix: >>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8031573 >>>>>>>> webrev: http://cr.openjdk.java.net/~alexsch/8031573/webrev.00 >>>>>>>> >>>>>>>> The NSMenu* system icons are templates and do not have image representations. >>>>>>>> >>>>>>>> The fix retrieves images with original and double size from an NSImage and put them to a MultiResolution image. >>>>>>>> The fix also adds sun.awt.image.MultiResolutionBufferedImage class which can be used uniformly for a Multiresolution image creation. >>>>>>>> >>>>>>>> The fix is independent of the fix 8033534 Get MultiResolution image from native system >>>>>>>> http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006991.html >>>>>>>> because CImage.createImageFromName(imageName) never returns a MultiResolution image for templates. >>>>>>>> But the fix 8033534 can be updated to use the MultiResolutionBufferedImage. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Alexandr. >>>>>>>> >>>>>>> >>>>> >>> >>> -- >>> Best regards, Sergey. >>> From hs at tagtraum.com Tue Feb 25 02:55:42 2014 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 25 Feb 2014 11:55:42 +0100 Subject: [9] Review request for 8031573 [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered in high resolution on Retina In-Reply-To: <530C7631.7020601@oracle.com> References: <52FCD0F9.3000001@oracle.com> <52FD434B.4060002@oracle.com> <52FDF0C0.6070200@oracle.com> <52FDFB29.4060901@oracle.com> <53021EDB.5010807@oracle.com> <5303501D.9010108@oracle.com> <41B9887A-4242-466C-9743-A0CF4304B53E@oracle.com> <530C7631.7020601@oracle.com> Message-ID: On Feb 25, 2014, at 11:53, Alexander Scherbatiy wrote: > On 2/24/2014 5:59 PM, Hendrik Schreiber wrote: >> Hey guys, >> >> will this fix cover JTree folder icons as well? I.e. javax.swing.UIManager.getIcon("Tree.closedIcon") returns something that is rendered in HiDPI on a a HiDPI display? > This should have been already fixed as part of the issue 8024926 [macosx] AquaIcon HiDPI support > https://bugs.openjdk.java.net/browse/JDK-8024926 Great! Thanks! -hendrik From petr.pchelko at oracle.com Tue Feb 25 03:26:09 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Tue, 25 Feb 2014 15:26:09 +0400 Subject: Proposal: Make JNU_Throw* clear a pending exception In-Reply-To: <530C7399.7050706@oracle.com> References: <530C7399.7050706@oracle.com> Message-ID: <18CF8FC4-5524-4980-96BF-5A9E361637C0@oracle.com> Hello, Alan. > I can see how this might be attractive but doesn't it mean you are suppressing an important exception? In case we?ve already got into the JNU_Throw we will throw a new exception and override the original one anyway. However I agree that this might suppress the warning for the code analysis tools. > Are the examples that you are looking at along these lines? There are a number of examples when JNU_Throw is used to: 1. Replace the message of an original exception: src/share/native/sun/awt/image/awt_ImageRep.c:192 There are a few such places. 2. Rethrow some meaningful exception if the call to some function failed: src/windows/native/sun/windows/awt_Window.cpp:2861 This is a much more common use case. In this case we have a return code from some method and we do not care if it was failed because of JNI exception or for some other reason. This is the main case where we need to add env->ExceptionClear() everywhere. 3. Quite common is to use it in the initIDs method to rethrow NoSuchFieldError: src/share/native/sun/awt/image/BufImgSurfaceData.c:77 This one is questionable, I think that rethrowing is not needed here at all, the original exception is much more informative. 4. Where currently are throwing an exception with pure JNI, but it could be replaces with JNU: src/windows/native/sun/windows/awt_PrintJob.cpp:1365 Similar to #2. With best regards. Petr. 25 ????. 2014 ?., ? 2:42 ????? ???????, Alan Bateman ???????(?): > On 25/02/2014 10:31, Petr Pchelko wrote: >> Hello, Core and AWT teams. >> >> In AWT we have a lot of pending exception warnings which are now being fixed. A big fraction of this warnings is about a pending JNI exception at a call to JNU_Throw*. >> Why don?t we add an env->ExceptionClear() call in the beginning of each JNU_Throw function? It is absolutely safe because: >> 1. We are rethrowing an exception an loosing the original one anyway. >> 2. In case there?s no pending exception the ExceptionClear is a no-op. >> >> If we do this the code would become much cleaner, because currently we have to manually clear a pending exception before every call to JNU_Throw*. >> >> What do you think about this proposal? >> > I can see how this might be attractive but doesn't it mean you are suppressing an important exception? We've fixed many areas in the last few weeks and I think a common case was just that whoever wrote the original code didn't realize that some JNI functions having a pending exception when they fail. In those cases then often it is a simple matter of just returning from the JNI function (maybe after some clean-up). Are the examples that you are looking at along these lines? I guess I'm mostly interested to know whether the JNU_Throw usages are needed or not. > > -Alan. From chris.hegarty at oracle.com Tue Feb 25 03:35:53 2014 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 25 Feb 2014 11:35:53 +0000 Subject: Proposal: Make JNU_Throw* clear a pending exception In-Reply-To: <18CF8FC4-5524-4980-96BF-5A9E361637C0@oracle.com> References: <530C7399.7050706@oracle.com> <18CF8FC4-5524-4980-96BF-5A9E361637C0@oracle.com> Message-ID: <530C8019.40309@oracle.com> On 25/02/14 11:26, Petr Pchelko wrote: > Hello, Alan. > >> I can see how this might be attractive but doesn't it mean you are suppressing an important exception? > In case we?ve already got into the JNU_Throw we will throw a new exception and override the original one anyway. However I agree that this might suppress the warning for the code analysis tools. > >> Are the examples that you are looking at along these lines? > There are a number of examples when JNU_Throw is used to: > 1. Replace the message of an original exception: src/share/native/sun/awt/image/awt_ImageRep.c:192 > There are a few such places. > > 2. Rethrow some meaningful exception if the call to some function failed: src/windows/native/sun/windows/awt_Window.cpp:2861 > This is a much more common use case. In this case we have a return code from some method and we do not care if it was failed because of JNI exception or for some other reason. This is the main case where we need to add env->ExceptionClear() everywhere. > > 3. Quite common is to use it in the initIDs method to rethrow NoSuchFieldError: src/share/native/sun/awt/image/BufImgSurfaceData.c:77 > This one is questionable, I think that rethrowing is not needed here at all, the original exception is much more informative. Agreed. Similar to NetworkInterface.c Line:172 http://hg.openjdk.java.net/jdk9/dev/jdk/file/6ee5c47bdba7/src/solaris/native/java/net/NetworkInterface.c#172 -Chris. > 4. Where currently are throwing an exception with pure JNI, but it could be replaces with JNU: src/windows/native/sun/windows/awt_PrintJob.cpp:1365 > Similar to #2. > > With best regards. Petr. > > 25 ????. 2014 ?., ? 2:42 ????? ???????, Alan Bateman ???????(?): > >> On 25/02/2014 10:31, Petr Pchelko wrote: >>> Hello, Core and AWT teams. >>> >>> In AWT we have a lot of pending exception warnings which are now being fixed. A big fraction of this warnings is about a pending JNI exception at a call to JNU_Throw*. >>> Why don?t we add an env->ExceptionClear() call in the beginning of each JNU_Throw function? It is absolutely safe because: >>> 1. We are rethrowing an exception an loosing the original one anyway. >>> 2. In case there?s no pending exception the ExceptionClear is a no-op. >>> >>> If we do this the code would become much cleaner, because currently we have to manually clear a pending exception before every call to JNU_Throw*. >>> >>> What do you think about this proposal? >>> >> I can see how this might be attractive but doesn't it mean you are suppressing an important exception? We've fixed many areas in the last few weeks and I think a common case was just that whoever wrote the original code didn't realize that some JNI functions having a pending exception when they fail. In those cases then often it is a simple matter of just returning from the JNI function (maybe after some clean-up). Are the examples that you are looking at along these lines? I guess I'm mostly interested to know whether the JNU_Throw usages are needed or not. >> >> -Alan. > From roger.riggs at oracle.com Tue Feb 25 06:14:08 2014 From: roger.riggs at oracle.com (roger riggs) Date: Tue, 25 Feb 2014 09:14:08 -0500 Subject: Proposal: Make JNU_Throw* clear a pending exception In-Reply-To: <530C8019.40309@oracle.com> References: <530C7399.7050706@oracle.com> <18CF8FC4-5524-4980-96BF-5A9E361637C0@oracle.com> <530C8019.40309@oracle.com> Message-ID: <530CA530.5070904@oracle.com> In some cases, I would expect that the exception being overridden would/should become the 'cause' of the new exception so it is not cleared but chained. Does JNI support that? On the original issue, discarding of exceptions should be explicit not implicit. Keep (or insert) the exceptionClear(). Roger On 2/25/2014 6:35 AM, Chris Hegarty wrote: > > > On 25/02/14 11:26, Petr Pchelko wrote: >> Hello, Alan. >> >>> I can see how this might be attractive but doesn't it mean you are >>> suppressing an important exception? >> In case we?ve already got into the JNU_Throw we will throw a new >> exception and override the original one anyway. However I agree that >> this might suppress the warning for the code analysis tools. >> >>> Are the examples that you are looking at along these lines? >> There are a number of examples when JNU_Throw is used to: >> 1. Replace the message of an original exception: >> src/share/native/sun/awt/image/awt_ImageRep.c:192 >> There are a few such places. >> >> 2. Rethrow some meaningful exception if the call to some function >> failed: src/windows/native/sun/windows/awt_Window.cpp:2861 >> This is a much more common use case. In this case we have a return >> code from some method and we do not care if it was failed because of >> JNI exception or for some other reason. This is the main case where >> we need to add env->ExceptionClear() everywhere. >> >> 3. Quite common is to use it in the initIDs method to rethrow >> NoSuchFieldError: src/share/native/sun/awt/image/BufImgSurfaceData.c:77 >> This one is questionable, I think that rethrowing is not needed here >> at all, the original exception is much more informative. > > Agreed. Similar to NetworkInterface.c Line:172 > > http://hg.openjdk.java.net/jdk9/dev/jdk/file/6ee5c47bdba7/src/solaris/native/java/net/NetworkInterface.c#172 > > > -Chris. > >> 4. Where currently are throwing an exception with pure JNI, but it >> could be replaces with JNU: >> src/windows/native/sun/windows/awt_PrintJob.cpp:1365 >> Similar to #2. >> >> With best regards. Petr. >> >> 25 ????. 2014 ?., ? 2:42 ????? ???????, Alan Bateman >> ???????(?): >> >>> On 25/02/2014 10:31, Petr Pchelko wrote: >>>> Hello, Core and AWT teams. >>>> >>>> In AWT we have a lot of pending exception warnings which are now >>>> being fixed. A big fraction of this warnings is about a pending JNI >>>> exception at a call to JNU_Throw*. >>>> Why don?t we add an env->ExceptionClear() call in the beginning of >>>> each JNU_Throw function? It is absolutely safe because: >>>> 1. We are rethrowing an exception an loosing the original one anyway. >>>> 2. In case there?s no pending exception the ExceptionClear is a no-op. >>>> >>>> If we do this the code would become much cleaner, because currently >>>> we have to manually clear a pending exception before every call to >>>> JNU_Throw*. >>>> >>>> What do you think about this proposal? >>>> >>> I can see how this might be attractive but doesn't it mean you are >>> suppressing an important exception? We've fixed many areas in the >>> last few weeks and I think a common case was just that whoever wrote >>> the original code didn't realize that some JNI functions having a >>> pending exception when they fail. In those cases then often it is a >>> simple matter of just returning from the JNI function (maybe after >>> some clean-up). Are the examples that you are looking at along these >>> lines? I guess I'm mostly interested to know whether the JNU_Throw >>> usages are needed or not. >>> >>> -Alan. >> From alexandr.scherbatiy at oracle.com Wed Feb 26 04:08:53 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 26 Feb 2014 16:08:53 +0400 Subject: [9] Review request for 8033534 Get MultiResolution image from native system In-Reply-To: References: <52F0E01B.3050004@oracle.com> <52F0E466.6040002@oracle.com> <52F8D9C2.70600@oracle.com> Message-ID: <530DD955.5010702@oracle.com> Hello, Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8033534/webrev.02/ This is the same fix. The only difference is that the MultiResolutionBufferedImage class is used from the fix JDK-8035069. Thanks, Alexandr. On 2/10/2014 7:05 PM, Scott Palmer wrote: > Just to be clear, "the image representations are chosen to be closest > to the requested size" is not accurate. > This change returns the smallest image representation that is greater > than or equal to the requested size. (Which I believe is the correct > thing to do.) > A smaller image representation may be closer to the requested size, > but it makes more sense to return a larger image since scaling down to > size should produce better results than scaling up. > > Scott > > > On Mon, Feb 10, 2014 at 8:53 AM, Alexander Scherbatiy > > wrote: > > > Could you review the updated fix: > http://cr.openjdk.java.net/~alexsch/8033534/webrev.01 > > > - The image representations are chosen to be closest to the > requested size. > > Thanks, > Alexandr. > > > On 2/4/2014 5:00 PM, Sergey Bylokhov wrote: > > Hi, Alexander. > I think that getResolutionVariant should return an image which > is close as much as possible to the requested size. > > On 04.02.2014 16:42, Alexander Scherbatiy wrote: > > > Hello, > > Could you review the fix: > bug: https://bugs.openjdk.java.net/browse/JDK-8033534 > webrev: > http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 > > > - The method that gets a sorted array of NSImage > representaion pixel sizes for the given image size is added > - A MultiResolution image is created if an NSImage has > several representations for the given image size > > Thanks, > Alexandr. > > > > > From petr.pchelko at oracle.com Wed Feb 26 04:54:25 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Wed, 26 Feb 2014 16:54:25 +0400 Subject: [9] Review request for 8033534 Get MultiResolution image from native system In-Reply-To: <530DD955.5010702@oracle.com> References: <52F0E01B.3050004@oracle.com> <52F0E466.6040002@oracle.com> <52F8D9C2.70600@oracle.com> <530DD955.5010702@oracle.com> Message-ID: Hello, Alexander. I have a couple of comments: 1. You could replace the first loop with indexOfObjectPassingTest method.. Not sure if this would look cleaner, up to you. 2. I suppose JNFNewObjectArray could throw the OOM and we would get a parfait warning, could you please add CHECK_NULL_RETURN after it. 3. In CImage.java you are setting the currentImageIndex to the biggest image representation smaller that the one requested and this representation would be used as a base one in the MultiResolutionBufferedImage. However in MultiResolutionBufferedImage getResolutionVariant you are returning the smallest variant bigger than the requested one. Is this correct? Thank you. With best regards. Petr. On 26.02.2014, at 16:08, Alexander Scherbatiy wrote: > > Hello, > > Could you review the updated fix: > http://cr.openjdk.java.net/~alexsch/8033534/webrev.02/ > > This is the same fix. The only difference is that the MultiResolutionBufferedImage class is used from the fix JDK-8035069. > > Thanks, > Alexandr. > > > On 2/10/2014 7:05 PM, Scott Palmer wrote: >> Just to be clear, "the image representations are chosen to be closest to the requested size" is not accurate. >> This change returns the smallest image representation that is greater than or equal to the requested size. (Which I believe is the correct thing to do.) >> A smaller image representation may be closer to the requested size, but it makes more sense to return a larger image since scaling down to size should produce better results than scaling up. >> >> Scott >> >> >> On Mon, Feb 10, 2014 at 8:53 AM, Alexander Scherbatiy > wrote: >> >> >> Could you review the updated fix: >> http://cr.openjdk.java.net/~alexsch/8033534/webrev.01 >> >> >> - The image representations are chosen to be closest to the >> requested size. >> >> Thanks, >> Alexandr. >> >> >> On 2/4/2014 5:00 PM, Sergey Bylokhov wrote: >> >> Hi, Alexander. >> I think that getResolutionVariant should return an image which >> is close as much as possible to the requested size. >> >> On 04.02.2014 16:42, Alexander Scherbatiy wrote: >> >> >> Hello, >> >> Could you review the fix: >> bug: https://bugs.openjdk.java.net/browse/JDK-8033534 >> webrev: >> http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 >> >> >> - The method that gets a sorted array of NSImage >> representaion pixel sizes for the given image size is added >> - A MultiResolution image is created if an NSImage has >> several representations for the given image size >> >> Thanks, >> Alexandr. >> >> >> >> >> > From alexandr.scherbatiy at oracle.com Wed Feb 26 06:40:38 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 26 Feb 2014 18:40:38 +0400 Subject: [9] Review request for 8033534 Get MultiResolution image from native system In-Reply-To: References: <52F0E01B.3050004@oracle.com> <52F0E466.6040002@oracle.com> <52F8D9C2.70600@oracle.com> <530DD955.5010702@oracle.com> Message-ID: <530DFCE6.2020508@oracle.com> Hello, Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8033534/webrev.03/ On 2/26/2014 4:54 PM, Petr Pchelko wrote: > Hello, Alexander. > > I have a couple of comments: > > 1. You could replace the first loop with indexOfObjectPassingTest method.. Not sure if this would look cleaner, up to you. Updated. There is one more way to use one loop instead of two. All of them does not look simple. > > 2. I suppose JNFNewObjectArray could throw the OOM and we would get a parfait warning, could you please add CHECK_NULL_RETURN after it. CHECK_NULL_RETURN is added. > 3. In CImage.java you are setting the currentImageIndex to the biggest image representation smaller that the one requested and this representation > would be used as a base one in the MultiResolutionBufferedImage. However in MultiResolutionBufferedImage getResolutionVariant you are returning > the smallest variant bigger than the requested one. Is this correct? I think that it is correct. Assume that an image with size 300x300 is requested but there are only resolution variants with sizes [250x250] and [350x350]. The resolution variant with [350x350] size is used as the base image. Now we need to draw the image to region [300x300]. The resolution variant with size [350x350] will be used from the MultiResolution image. Thanks, Alexandr. > > Thank you. > With best regards. Petr. > > On 26.02.2014, at 16:08, Alexander Scherbatiy wrote: > >> Hello, >> >> Could you review the updated fix: >> http://cr.openjdk.java.net/~alexsch/8033534/webrev.02/ >> >> This is the same fix. The only difference is that the MultiResolutionBufferedImage class is used from the fix JDK-8035069. >> >> Thanks, >> Alexandr. >> >> >> On 2/10/2014 7:05 PM, Scott Palmer wrote: >>> Just to be clear, "the image representations are chosen to be closest to the requested size" is not accurate. >>> This change returns the smallest image representation that is greater than or equal to the requested size. (Which I believe is the correct thing to do.) >>> A smaller image representation may be closer to the requested size, but it makes more sense to return a larger image since scaling down to size should produce better results than scaling up. >>> >>> Scott >>> >>> >>> On Mon, Feb 10, 2014 at 8:53 AM, Alexander Scherbatiy > wrote: >>> >>> >>> Could you review the updated fix: >>> http://cr.openjdk.java.net/~alexsch/8033534/webrev.01 >>> >>> >>> - The image representations are chosen to be closest to the >>> requested size. >>> >>> Thanks, >>> Alexandr. >>> >>> >>> On 2/4/2014 5:00 PM, Sergey Bylokhov wrote: >>> >>> Hi, Alexander. >>> I think that getResolutionVariant should return an image which >>> is close as much as possible to the requested size. >>> >>> On 04.02.2014 16:42, Alexander Scherbatiy wrote: >>> >>> >>> Hello, >>> >>> Could you review the fix: >>> bug: https://bugs.openjdk.java.net/browse/JDK-8033534 >>> webrev: >>> http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 >>> >>> >>> - The method that gets a sorted array of NSImage >>> representaion pixel sizes for the given image size is added >>> - A MultiResolution image is created if an NSImage has >>> several representations for the given image size >>> >>> Thanks, >>> Alexandr. >>> >>> >>> >>> >>> From petr.pchelko at oracle.com Wed Feb 26 08:27:37 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Wed, 26 Feb 2014 20:27:37 +0400 Subject: [9] Review request for 8033534 Get MultiResolution image from native system In-Reply-To: <530DFCE6.2020508@oracle.com> References: <52F0E01B.3050004@oracle.com> <52F0E466.6040002@oracle.com> <52F8D9C2.70600@oracle.com> <530DD955.5010702@oracle.com> <530DFCE6.2020508@oracle.com> Message-ID: <63F14163-B0A7-4E5C-8F4C-F1A0C52E177D@oracle.com> Hello, Alexander. The fix look good to me. With best regards. Petr. 26 ????. 2014 ?., ? 6:40 ????? ???????, Alexander Scherbatiy ???????(?): > > Hello, > > Could you review the updated fix: > http://cr.openjdk.java.net/~alexsch/8033534/webrev.03/ > > On 2/26/2014 4:54 PM, Petr Pchelko wrote: >> Hello, Alexander. >> >> I have a couple of comments: >> >> 1. You could replace the first loop with indexOfObjectPassingTest method.. Not sure if this would look cleaner, up to you. > Updated. There is one more way to use one loop instead of two. All of them does not look simple. > >> 2. I suppose JNFNewObjectArray could throw the OOM and we would get a parfait warning, could you please add CHECK_NULL_RETURN after it. > CHECK_NULL_RETURN is added. >> 3. In CImage.java you are setting the currentImageIndex to the biggest image representation smaller that the one requested and this representation >> would be used as a base one in the MultiResolutionBufferedImage. However in MultiResolutionBufferedImage getResolutionVariant you are returning >> the smallest variant bigger than the requested one. Is this correct? > I think that it is correct. Assume that an image with size 300x300 is requested but there are only resolution variants with sizes [250x250] and [350x350]. > The resolution variant with [350x350] size is used as the base image. Now we need to draw the image to region [300x300]. The resolution variant > with size [350x350] will be used from the MultiResolution image. > > Thanks, > Alexandr. > > >> >> Thank you. >> With best regards. Petr. >> >> On 26.02.2014, at 16:08, Alexander Scherbatiy wrote: >> >>> Hello, >>> >>> Could you review the updated fix: >>> http://cr.openjdk.java.net/~alexsch/8033534/webrev.02/ >>> >>> This is the same fix. The only difference is that the MultiResolutionBufferedImage class is used from the fix JDK-8035069. >>> >>> Thanks, >>> Alexandr. >>> >>> >>> On 2/10/2014 7:05 PM, Scott Palmer wrote: >>>> Just to be clear, "the image representations are chosen to be closest to the requested size" is not accurate. >>>> This change returns the smallest image representation that is greater than or equal to the requested size. (Which I believe is the correct thing to do.) >>>> A smaller image representation may be closer to the requested size, but it makes more sense to return a larger image since scaling down to size should produce better results than scaling up. >>>> >>>> Scott >>>> >>>> >>>> On Mon, Feb 10, 2014 at 8:53 AM, Alexander Scherbatiy > wrote: >>>> >>>> >>>> Could you review the updated fix: >>>> http://cr.openjdk.java.net/~alexsch/8033534/webrev.01 >>>> >>>> >>>> - The image representations are chosen to be closest to the >>>> requested size. >>>> >>>> Thanks, >>>> Alexandr. >>>> >>>> >>>> On 2/4/2014 5:00 PM, Sergey Bylokhov wrote: >>>> >>>> Hi, Alexander. >>>> I think that getResolutionVariant should return an image which >>>> is close as much as possible to the requested size. >>>> >>>> On 04.02.2014 16:42, Alexander Scherbatiy wrote: >>>> >>>> >>>> Hello, >>>> >>>> Could you review the fix: >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8033534 >>>> webrev: >>>> http://cr.openjdk.java.net/~alexsch/8033534/webrev.00 >>>> >>>> >>>> - The method that gets a sorted array of NSImage >>>> representaion pixel sizes for the given image size is added >>>> - A MultiResolution image is created if an NSImage has >>>> several representations for the given image size >>>> >>>> Thanks, >>>> Alexandr. >>>> >>>> >>>> >>>> >>>> > From alexandr.scherbatiy at oracle.com Thu Feb 27 04:54:42 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 27 Feb 2014 16:54:42 +0400 Subject: [OpenJDK 2D-Dev] [9] Review request for 8029339 Custom MultiResolution image support on HiDPI displays In-Reply-To: <5307E71E.50607@oracle.com> References: <52D51764.8020103@oracle.com> <52DF2F98.3030503@oracle.com> <52F4BCEB.9040702@oracle.com> <52F5782A.9060300@oracle.com> <52FB7E3E.6050000@oracle.com> <52FC14EC.9080503@oracle.com> <53037D3D.80709@oracle.com> <5307E71E.50607@oracle.com> Message-ID: <530F3592.40600@oracle.com> On 2/22/2014 3:54 AM, Jim Graham wrote: > Hi Alexandr, > > On 2/18/14 7:33 AM, Alexander Scherbatiy wrote: >> Hi Jim, >> >> Let's divide the discussion into two part. >> >> 1. Where it is better to hold resolution variants? >> Putting resolution variants in Image class brings some questions >> like: >> - Some type of images do not need to have resolution variants >> - Should resolution variants have the same type as the base image? >> - getResolutionVariants() method can return copy of the original list >> so add/removeRV methods should be also added. >> >> There are pros and cons for placing resolution variants to Image >> class or to a separate intreface. > > I agree that this could be a separate interface. In my examples below > I was just sticking them inside an "Image{}" to show where they lived > in the set of involved objects, not a specific recommendation that > they actually be new methods on the base class itself. I probably > should have put a comment there about that. > > With respect to add/remove - that is assuming a need for manual > construction of an image set, right? Forgive me if I'm forgetting > something, but I seem to recall that manual Multi-Res images was > proposed as a way for developers to introduce @2x support themselves, > but if we are internally managing @2x and -DPI variants for them, then > I'm not sure if there is actual developer need to manually construct > their own. Am I forgetting something? The NSImage has addRepresentation/removeRepresentation methods to work with image representations on Mac OS X. The java.awt.Image class should provide similar functionality to have the possibilities as Cocoa on HiDPI displays. > >> 2. Using scale factor/image sizes/scaled image sizes to retreive a >> resolution variant. >> >> May be it is better to have a structure that provide all necessary >> information to query the resolution variant: scale factor, draw area >> width/height, transformed area width/height? >> >> For example: >> --------------------- >> public interface MultiResolutionImage { >> >> interface DrawAreaInfo { >> >> float getScaleFactor(); >> float getAreaWidth(); >> float getAreaHeight(); >> float getTransformedAreaWidth(); >> float getTransformedAreaHeight(); >> } >> >> public Image getResolutionVariant(DrawAreaInfo drawAreaInfo) ; >> public List getResolutionVariants(); >> } >> --------------------- > > The problem with a constructor is that this is something that is > (potentially) done on every drawImage() call, which means we are > inviting GC into the equation. If we can come up with a simple "just > a couple/3/4 numbers" way to embed that data into a method call > argument list then we can make this lighter weight. > > What about simply having floating point (double) dimensions on the > rendered size There should be a way to choose a resolution variant based on requested drawing size or transformed drawing size. At least a current transformation should be included too. > plus a single floating point "logical DPI" for the screen? There is the ID2D1Factory::GetDesktopDpi method which returns dpiX and dpiY. http://msdn.microsoft.com/en-us/library/windows/apps/dd371316 That means that logicalDPIX/Y can have different values. At least it is described in the http://msdn.microsoft.com/en-us/library/windows/apps/ff684173 "To get the DPI setting, call the ID2D1Factory::GetDesktopDpi method. The DPI is returned as two floating-point values, one for the x-axis and one for the y-axis. In theory, these values can differ. Calculate a separate scaling factor for each axis." The getResolutionVariant method could look like: -------------------------------------- public Image getResolutionVariant(float logicalDPIX, float logicalDPIY, float widthX, float widthY, AffineTransform transform); -------------------------------------- > If the image is known (either passed as an argument or the method is > called on the image), then it can provide the original WH. > >> The MultiResolutionImage default implementation could allow to use >> different strategies like scale factor/transfom/OS based >> to query a resolution variant. The OS based strategy can be used by >> default. > > For Mac policy, all we need is the transformed dimensions, which can > be passed in as FP for generality. For Windows policy, all we need is > logical DPI for the screen. What other information would we need, or > would an algorithm like to use, that can't be computed from those 2 > pieces? The aim is to provide a base class that can be used to create a MultiResolutionImage like: http://hg.openjdk.java.net/jdk9/client/jdk/diff/ae53ebce5fa3/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java A developer should be able to implement a custom algorithm to query a resolution variant. It can be done by overriding the getResolutionVariant image: ----------------------- Image mrImage = new MultiResolutionBufferedImage(){ @Override public Image getResolutionVariant(...) { // Custom logic here } }; ----------------------- Or it can be done by using resolution variant choosers so a developer can implement custom resolution variant query: ----------------------- public class MultiResolutionBufferedImage implements MultiResolutionImage{ interface ResolutionVariantChooser{ Image getResolutionVariant(dpi, size,..., List resolutionVariants); } ResolutionVariantChooser TRANSFORM_BASED = null; ResolutionVariantChooser DPI_BASED = null; ResolutionVariantChooser rvChooser; @Override public Image getResolutionVariant(dpi, size,...,) { return rvChooser.getResolutionVariant(dpi, size,..., getResolutionVariants()); } } ----------------------- Thanks, Alexandr. > > ...jim > >> Thanks, >> Alexandr. >> >> >> On 2/13/2014 4:42 AM, Jim Graham wrote: >>> On 2/12/14 5:59 AM, Alexander Scherbatiy wrote: >>>> On 2/8/2014 4:19 AM, Jim Graham wrote: >>>>> The primary thing that I was concerned about was the presence of >>>>> integers in the API when Windows uses non-integer multiples >>>> It would make sense to pass real numbers to the >>>> getResolutionVariant() method if the difference between resolution >>>> variants sizes is 1. >>>> It seems that it is not a common case. >>> >>> I was thinking of other API that is related to this, such as the API >>> that queries the scaling factor from a SurfaceManager. I seem to >>> remember some integer return values in that, but Windows might have >>> the answer 1.4 or 1.8, depending on the screen scaling factor that was >>> determined from the UI. >>> >>> In terms of the getResolutionVariant() method here, those non-integer >>> screen scaling factors don't directly impact this API. But, we have >>> some issues with the use of integers there from other sources: >>> >>> - That API assumes that the caller will determine the pixel size >>> needed, but the actual media choice is determined with different >>> techniques on Mac and Windows so this means that the caller will have >>> to worry about platform conventions. Is that the right tradeoff? >>> >>> - The technique recommended for Mac involves computing the precise >>> size desired using the current transform, which may be a floating >>> point value, so the integer values used in this API are already >>> approximations and there is no documentation on how to generate the >>> proper integer. In particular, the current code in SG2D naively uses >>> a cast to integer to determine the values to supply which means a >>> transformed size of W+0.5 will be truncated to W and the lower >>> resolution image will be used. Does that conform to Mac guidelines? Do >>> they require the truncated size to reach W+1 before the next size is >>> used? Passing in float or double values would sidestep all of that >>> since then the comparisons would be done with full precision, but as >>> long as we can determine a "best practices compatible with all >>> platforms" rule on how to round to integers, then integers are OK >>> there. >>> >>> - The Windows document you cite below suggests that the determination >>> should be made by looking at the Screen DPI and choosing the next >>> higher media variant based on that screen DPI. They do not specify >>> choosing media based on the current transform as is done for Mac. If >>> we stick with supplying values that are used to determine which media >>> to use, then on Windows we should not take the transform into account, >>> but instead query the SurfaceManager for the scale factor and only >>> transform by those values (even if the current transform was manually >>> overridden to identity). >>> >>> There are pros and cons to both approaches. >>> >>> Mac ensures that you are always using the best media for any given >>> render operation. >>> >>> But, Windows ensure more consistency in the face of other scaling. >>> >>> The thing to consider is that if you have a 500x500 image with a >>> 1000x1000 variant and you rendering it at 500x500 and then 501x501, >>> that first jump will be fairly jarring as the scaled version of the >>> 1000x1000 will not look precisely like the original 500x500 did. With >>> @2x images only, this effect is minimized so the advantage of always >>> using "the best media for a given render operation" may outweigh the >>> inconsistency issue. But, on Windows where the media are 1.4x or 1.8x >>> in size, a downscaled image will start to show more interpolation >>> noise and so the balance of the two choices may shift more towards not >>> wanting a jarring shift. >>> >>> We might want one or more of the following: >>> >>> - Developer chooses policy (TX_AWARE, DPI_AWARE, ALWAYS_LARGEST, NONE, >>> PLATFORM) where the last policy would use TX_AWARE on Mac and >>> DPI_AWARE on Windows >>> >>> - We create our own policy and always use it (TX_AWARE? or DPI_AWARE?) >>> >>> - We create our own policy that dynamically chooses one of the above >>> strategies depending on platform or available media or ??? >>> >>> - We could create an optional interface for them to install their own >>> algorithm as well. I think it would work best as a delegate interface >>> that one installs into Image so that it can be used with any image >>> without having to subclass (it wouldn't really have much to do for >>> BufferedImages or VolatileImages, though): >>> >>> class Image { >>> void setResolutionHelper(ImageResolutionHelper foo); >>> List getResolutionVariants(); >>> } >>> >>> or: >>> >>> class Graphics { >>> void setResolutionHelper(ImageResolutionHelper foo); >>> } >>> >>> or - anywhere else it could be installed more centrally (per App >>> context)? >>> >>> and the interface would be something like one of these variants: >>> >>> interface ImageResolutionHelper { >>> // This version would prevent substituting a random image: >>> // They have to return an index into the List for that >>> image... >>> public int chooseVariant(Image img, double dpi, number w, number >>> h); >>> >>> or: >>> >>> // This version would allow substituting an arbitrary image: >>> public Image getVariant(Image img, double dpi, number w, number h); >>> } >>> >>> Since they would be in full control of the policy, though, we would >>> unfortunately always have to call this, there would be no more testing >>> in SG2D to see "if" we need to deal with DPI, though perhaps we could >>> document some internal conditions in which we do not call it for >>> common cases (but that would have to be well agreed not to get in the >>> way of reasonable uses of the API and well documented)? >>> >>> Note that we would have to do a security audit to make sure that >>> random image substitution couldn't allow any sort of "screen phishing" >>> exploit. >>> >>> ...jim >>> >>>>> and also what policy they use for choosing scaled images. >>>>> >>>>> I don't see a mention of taking the current transform into account, >>>>> just physical issues like screen DPI and form factor. They talk about >>>>> resolution plateaus and in their recommendations section they tell >>>>> the >>>>> developer to use a particular property that tells them the screen >>>>> resolution to figure out which image to load if they are loading >>>>> manually. There is no discussion about dynamically loading multiple >>>>> versions of the image based on a dynamic program-applied transform >>>>> factor as is done on MacOS. >>>>> >>>>> Also, they tell developers to draw images to a specific size rather >>>>> than using auto-sizing. That begs the question as to how they >>>>> interpret a call to draw an image just using a location in the >>>>> presence of various DPI factors. >>>> There is an interesting doc that describes how to write >>>> DPI-aware >>>> Win32 applications: >>>> http://msdn.microsoft.com/en-us/library/dd464646%28v=vs.85%29.aspx >>>> It is suggested to handle WM_DPICHANGED message, load the >>>> graphic >>>> that has slightly greater resolution to the current DPI and use >>>> StretchBlt >>>> to scale down the image. >>>> >>>> Thanks, >>>> Alexandr. >>>> >>>>> >>>>> ...jim >>>>> >>>>> On 2/7/14 3:00 AM, Alexander Scherbatiy wrote: >>>>>> On 1/22/2014 6:40 AM, Jim Graham wrote: >>>>>>> Hi Alexander, >>>>>>> >>>>>>> Before we get too far down the road on this API, I think we >>>>>>> understand >>>>>>> the way in which MacOS processes multi-resolution images for HiDPI >>>>>>> screens, but have we investigated the processes that Windows uses >>>>>>> under Windows 8? My impression is that Windows 8 has included a >>>>>>> number of new techniques for dealing with the high resolution >>>>>>> displays >>>>>>> that it will run on in the Windows tablet and mobile industries and >>>>>>> that these will also come into play as 4K displays (already >>>>>>> available) >>>>>>> become more common on the desktop. We should make sure that >>>>>>> what we >>>>>>> come up with here can provide native compatibility with either >>>>>>> platform's policies and standard practices. >>>>>>> >>>>>>> If you've investigated the MS policies I'd like to see a summary so >>>>>>> that we can consider them as we review this API... >>>>>> There is the Windows Guidelines for scaling to pixel density: >>>>>> http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx >>>>>> which says that Windows has automatic resource loading that >>>>>> supports >>>>>> three version of images scaling (100%, 140%, and 180%) >>>>>> -------------------------------- >>>>>> Without scaling, as the pixel density of a display device >>>>>> increases, the >>>>>> physical sizes of objects on screen get smaller. >>>>>> When UI would otherwise be too small to touch and when text gets too >>>>>> small to read, >>>>>> Windows scales the system and app UI to one of the following scaling >>>>>> plateaus: >>>>>> >>>>>> 1.0 (100%, no scaling is applied) >>>>>> 1.4 (140% scaling) >>>>>> 1.8 (180% scaling) >>>>>> >>>>>> Windows determines which scaling plateau to use based on the >>>>>> physical >>>>>> screen size, the screen resolution, the DPI of the screen, and form >>>>>> factor. >>>>>> >>>>>> Use resource loading for bitmap images in the app package For bitmap >>>>>> images stored >>>>>> in the app package, provide a separate image for each scaling >>>>>> factor(100%, 140%, and 180%), >>>>>> and name your image files using the "scale" naming convention >>>>>> described >>>>>> below. >>>>>> Windows loads the right image for the current scale automatically. >>>>>> -------------------------------- >>>>>> >>>>>> The image name convention for the various scales is: >>>>>> images/logo.scale-100.png >>>>>> images/logo.scale-140.png >>>>>> images/logo.scale-180.png >>>>>> >>>>>> The 'ms-appx:///images/logo.png' uri is used to load the image >>>>>> in an >>>>>> application. >>>>>> >>>>>> If we want to support this in the same way as it is done for Mac >>>>>> OS X >>>>>> the WToolkit should return MultiResolution image in case if the >>>>>> loaded image has .scale-* qualifiers. >>>>>> The Graphics class can request an image with necessary resolution >>>>>> from the MultiResolution image. >>>>>> >>>>>> It seems that nothing should be changed in the MultiResolution >>>>>> interface in this case. >>>>>> >>>>>> Thanks, >>>>>> Alexandr. >>>>>>> >>>>>>> ...jim >>>>>>> >>>>>>> On 1/14/14 2:54 AM, Alexander Scherbatiy wrote: >>>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> Could you review the fix: >>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8029339 >>>>>>>> webrev: http://cr.openjdk.java.net/~alexsch/8029339/webrev.00 >>>>>>>> >>>>>>>> This is a proposal to introduce an API that allows to create a >>>>>>>> custom >>>>>>>> multi resolution image. >>>>>>>> >>>>>>>> I. It seems reasonable that the API should provide two basic >>>>>>>> operations: >>>>>>>> >>>>>>>> 1. Get the resolution variant based on the requested image >>>>>>>> width and >>>>>>>> height: >>>>>>>> - Image getResolutionVariant(int width, int height) >>>>>>>> >>>>>>>> Usually the system provides the scale factor which represents >>>>>>>> the >>>>>>>> number of pixels corresponding to each linear unit on the display. >>>>>>>> However, it has sense to combine the scale factor and the >>>>>>>> current >>>>>>>> transformations to get the actual image size to be displayed. >>>>>>>> >>>>>>>> 2. Get all provided resolution variants: >>>>>>>> - List getResolutionVariants() >>>>>>>> >>>>>>>> There are several uses cases: >>>>>>>> - Create a new multi-resolution image based on the given >>>>>>>> multi-resolution image. >>>>>>>> - Pass to the native system the multi-resolution image. For >>>>>>>> example, >>>>>>>> a use can set to the system the custom multi-resolution cursor. >>>>>>>> >>>>>>>> II. There are some possible ways where the new API can be added >>>>>>>> >>>>>>>> 1. java.awt.Image. >>>>>>>> >>>>>>>> The 2 new methods can be added to the Image class. A user can >>>>>>>> override >>>>>>>> the getResolutionVariant() and getResolutionVariants() >>>>>>>> methods to >>>>>>>> provide the resolution variants >>>>>>>> or there can be default implementations of these methods if a >>>>>>>> user >>>>>>>> puts resolution variants >>>>>>>> to the list in the sorted order. >>>>>>>> >>>>>>>> To check that the image has resolution variants the following >>>>>>>> statement can be used: image.getResolutionVariants().size() != 1 >>>>>>>> >>>>>>>> The disadvantage is that there is an overhead that the Image >>>>>>>> class >>>>>>>> should contain the List object and not all >>>>>>>> images can have resolution variants. >>>>>>>> >>>>>>>> 2. Introduce new MultiResolutionImage interface. >>>>>>>> >>>>>>>> A user should extend Image class and implement the >>>>>>>> MultiResolutionImage interface. >>>>>>>> >>>>>>>> For example: >>>>>>>> --------------------- >>>>>>>> public class CustomMultiResolutionImage extends BufferedImage >>>>>>>> implements MultiResolutionImage { >>>>>>>> >>>>>>>> Image highResolutionImage; >>>>>>>> >>>>>>>> public CustomMultiResolutionImage(BufferedImage >>>>>>>> baseImage, >>>>>>>> BufferedImage highResolutionImage) { >>>>>>>> super(baseImage.getWidth(), baseImage.getHeight(), >>>>>>>> baseImage.getType()); >>>>>>>> this.highResolutionImage = highResolutionImage; >>>>>>>> Graphics g = getGraphics(); >>>>>>>> g.drawImage(baseImage, 0, 0, null); >>>>>>>> g.dispose(); >>>>>>>> } >>>>>>>> >>>>>>>> @Override >>>>>>>> public Image getResolutionVariant(int width, int >>>>>>>> height) { >>>>>>>> return ((width <= getWidth() && height <= >>>>>>>> getHeight())) >>>>>>>> ? this : highResolutionImage; >>>>>>>> } >>>>>>>> >>>>>>>> @Override >>>>>>>> public List getResolutionVariants() { >>>>>>>> return Arrays.asList(this, highResolutionImage); >>>>>>>> } >>>>>>>> } >>>>>>>> --------------------- >>>>>>>> >>>>>>>> The current fix adds the MultiResolutionImage interface and >>>>>>>> public >>>>>>>> resolution variant rendering hints. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Alexandr. >>>>>>>> >>>>>> >>>> >> From petr.pchelko at oracle.com Thu Feb 27 06:18:20 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Thu, 27 Feb 2014 18:18:20 +0400 Subject: [9] Review Request: JDK-8032960 Running forms URL throws NullPointerException in Javaconsole. In-Reply-To: <5305C0C3.2090102@oracle.com> References: <0EB4849B-CA97-4429-8A4E-D6CCDD002BF1@oracle.com> <5305C0C3.2090102@oracle.com> Message-ID: <8E3C5B81-008B-4898-AD2A-EEAEDEE25931@oracle.com> Hello, Anthony. You were right, in case the Toolkit thread has an AppContext we should invoke the updateProperties through invokeLater as the DesktopPropertyChangeSupport could invoke a propertyChangeListener directly. Please see the updated fix here: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.01/ I've also added an automatic test, but it's quite complicated. With best regards. Petr. On 20.02.2014, at 12:45, Anthony Petrov wrote: > Hi Petr, > > The fire...() method is now invoked on the Toolkit thread, and I see that the Toolkit.DesktopPropertyChangeSupport.firePropertyChange() will fire the event on the current thread if the toolkit thread belongs to the current app context. > > The question is: are we 100% sure that on MS Windows the AWT Toolkit thread *never* belongs to a user app context? Even if we're running in an unusual threading mode (like the one for FX where we combine the EDT and the FX toolkit thread)? > > If this is so, meaning that we always only postEvent() from the T.DPCS.fire...() method on Windows, then I'm fine with the fix. > > -- > best regards, > Anthony > > On 2/19/2014 3:29 PM, Petr Pchelko wrote: >> Hello, AWT Team. >> >> Please review the fix for the issue: >> https://bugs.openjdk.java.net/browse/JDK-8032960 >> The fix is available at: >> http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.00/ >> >> The problem: >> The Toolkit thread does not have an AppContext so we can't use EventQueue.invokeLater on it. >> >> The solution: >> Remove invokeLater. This is safe, because the updateProperties is thread safe. The result of this call is a post of a PropertyChangeEvent for each AppContext in the application. >> >> The test: >> Hard to create, because we can't synthesize the WM_SETTINGCHANGE event. >> >> Thank you. >> With best regards. Petr. >> From petr.pchelko at oracle.com Thu Feb 27 07:01:38 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Thu, 27 Feb 2014 19:01:38 +0400 Subject: [9] Review Request: JDK-8032960 Running forms URL throws NullPointerException in Javaconsole. In-Reply-To: <8E3C5B81-008B-4898-AD2A-EEAEDEE25931@oracle.com> References: <0EB4849B-CA97-4429-8A4E-D6CCDD002BF1@oracle.com> <5305C0C3.2090102@oracle.com> <8E3C5B81-008B-4898-AD2A-EEAEDEE25931@oracle.com> Message-ID: After an offline discussion with Sergey I've got a new version of he fix: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.02/ Looks like previously the DesktopPropertyChangeSupport was intended to be called only on some EDT. But now we have to call it on a Toolkit thread, so I've removed the short path, so it now always posts an events and never calls listeners directly. With best regards. Petr. On 27.02.2014, at 18:18, Petr Pchelko wrote: > Hello, Anthony. > > You were right, in case the Toolkit thread has an AppContext we should invoke the updateProperties through invokeLater as the DesktopPropertyChangeSupport could invoke a propertyChangeListener directly. > > Please see the updated fix here: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.01/ > > I've also added an automatic test, but it's quite complicated. > > With best regards. Petr. > > On 20.02.2014, at 12:45, Anthony Petrov wrote: > >> Hi Petr, >> >> The fire...() method is now invoked on the Toolkit thread, and I see that the Toolkit.DesktopPropertyChangeSupport.firePropertyChange() will fire the event on the current thread if the toolkit thread belongs to the current app context. >> >> The question is: are we 100% sure that on MS Windows the AWT Toolkit thread *never* belongs to a user app context? Even if we're running in an unusual threading mode (like the one for FX where we combine the EDT and the FX toolkit thread)? >> >> If this is so, meaning that we always only postEvent() from the T.DPCS.fire...() method on Windows, then I'm fine with the fix. >> >> -- >> best regards, >> Anthony >> >> On 2/19/2014 3:29 PM, Petr Pchelko wrote: >>> Hello, AWT Team. >>> >>> Please review the fix for the issue: >>> https://bugs.openjdk.java.net/browse/JDK-8032960 >>> The fix is available at: >>> http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.00/ >>> >>> The problem: >>> The Toolkit thread does not have an AppContext so we can't use EventQueue.invokeLater on it. >>> >>> The solution: >>> Remove invokeLater. This is safe, because the updateProperties is thread safe. The result of this call is a post of a PropertyChangeEvent for each AppContext in the application. >>> >>> The test: >>> Hard to create, because we can't synthesize the WM_SETTINGCHANGE event. >>> >>> Thank you. >>> With best regards. Petr. >>> > From anthony.petrov at oracle.com Thu Feb 27 12:56:43 2014 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Fri, 28 Feb 2014 00:56:43 +0400 Subject: [9] Review Request: JDK-8032960 Running forms URL throws NullPointerException in Javaconsole. In-Reply-To: References: <0EB4849B-CA97-4429-8A4E-D6CCDD002BF1@oracle.com> <5305C0C3.2090102@oracle.com> <8E3C5B81-008B-4898-AD2A-EEAEDEE25931@oracle.com> Message-ID: <530FA68B.4090404@oracle.com> That is perfect. +1. -- best regards, Anthony On 2/27/2014 7:01 PM, Petr Pchelko wrote: > After an offline discussion with Sergey I've got a new version of he fix: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.02/ > > Looks like previously the DesktopPropertyChangeSupport was intended to be called only on some EDT. But now we have to call it on a Toolkit thread, > so I've removed the short path, so it now always posts an events and never calls listeners directly. > > With best regards. Petr. > > On 27.02.2014, at 18:18, Petr Pchelko wrote: > >> Hello, Anthony. >> >> You were right, in case the Toolkit thread has an AppContext we should invoke the updateProperties through invokeLater as the DesktopPropertyChangeSupport could invoke a propertyChangeListener directly. >> >> Please see the updated fix here: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.01/ >> >> I've also added an automatic test, but it's quite complicated. >> >> With best regards. Petr. >> >> On 20.02.2014, at 12:45, Anthony Petrov wrote: >> >>> Hi Petr, >>> >>> The fire...() method is now invoked on the Toolkit thread, and I see that the Toolkit.DesktopPropertyChangeSupport.firePropertyChange() will fire the event on the current thread if the toolkit thread belongs to the current app context. >>> >>> The question is: are we 100% sure that on MS Windows the AWT Toolkit thread *never* belongs to a user app context? Even if we're running in an unusual threading mode (like the one for FX where we combine the EDT and the FX toolkit thread)? >>> >>> If this is so, meaning that we always only postEvent() from the T.DPCS.fire...() method on Windows, then I'm fine with the fix. >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/19/2014 3:29 PM, Petr Pchelko wrote: >>>> Hello, AWT Team. >>>> >>>> Please review the fix for the issue: >>>> https://bugs.openjdk.java.net/browse/JDK-8032960 >>>> The fix is available at: >>>> http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.00/ >>>> >>>> The problem: >>>> The Toolkit thread does not have an AppContext so we can't use EventQueue.invokeLater on it. >>>> >>>> The solution: >>>> Remove invokeLater. This is safe, because the updateProperties is thread safe. The result of this call is a post of a PropertyChangeEvent for each AppContext in the application. >>>> >>>> The test: >>>> Hard to create, because we can't synthesize the WM_SETTINGCHANGE event. >>>> >>>> Thank you. >>>> With best regards. Petr. >>>> >> > From mike.duigou at oracle.com Thu Feb 27 21:10:24 2014 From: mike.duigou at oracle.com (Mike Duigou) Date: Thu, 27 Feb 2014 21:10:24 -0800 Subject: Proposal: Make JNU_Throw* clear a pending exception In-Reply-To: <530CA530.5070904@oracle.com> References: <530C7399.7050706@oracle.com> <18CF8FC4-5524-4980-96BF-5A9E361637C0@oracle.com> <530C8019.40309@oracle.com> <530CA530.5070904@oracle.com> Message-ID: <96B8D6F9-33A8-4B46-9E28-F53DC10DD127@oracle.com> Or a suppressed exception. Mike On Feb 25 2014, at 06:14 , Roger Riggs wrote: > In some cases, I would expect that the exception being overridden > would/should become the 'cause' of the new exception so it is not cleared > but chained. Does JNI support that? > > On the original issue, discarding of exceptions should be explicit not implicit. > Keep (or insert) the exceptionClear(). > > Roger > > On 2/25/2014 6:35 AM, Chris Hegarty wrote: >> >> >> On 25/02/14 11:26, Petr Pchelko wrote: >>> Hello, Alan. >>> >>>> I can see how this might be attractive but doesn't it mean you are suppressing an important exception? >>> In case we?ve already got into the JNU_Throw we will throw a new exception and override the original one anyway. However I agree that this might suppress the warning for the code analysis tools. >>> >>>> Are the examples that you are looking at along these lines? >>> There are a number of examples when JNU_Throw is used to: >>> 1. Replace the message of an original exception: src/share/native/sun/awt/image/awt_ImageRep.c:192 >>> There are a few such places. >>> >>> 2. Rethrow some meaningful exception if the call to some function failed: src/windows/native/sun/windows/awt_Window.cpp:2861 >>> This is a much more common use case. In this case we have a return code from some method and we do not care if it was failed because of JNI exception or for some other reason. This is the main case where we need to add env->ExceptionClear() everywhere. >>> >>> 3. Quite common is to use it in the initIDs method to rethrow NoSuchFieldError: src/share/native/sun/awt/image/BufImgSurfaceData.c:77 >>> This one is questionable, I think that rethrowing is not needed here at all, the original exception is much more informative. >> >> Agreed. Similar to NetworkInterface.c Line:172 >> >> http://hg.openjdk.java.net/jdk9/dev/jdk/file/6ee5c47bdba7/src/solaris/native/java/net/NetworkInterface.c#172 >> >> -Chris. >> >>> 4. Where currently are throwing an exception with pure JNI, but it could be replaces with JNU: src/windows/native/sun/windows/awt_PrintJob.cpp:1365 >>> Similar to #2. >>> >>> With best regards. Petr. >>> >>> 25 ????. 2014 ?., ? 2:42 ????? ???????, Alan Bateman ???????(?): >>> >>>> On 25/02/2014 10:31, Petr Pchelko wrote: >>>>> Hello, Core and AWT teams. >>>>> >>>>> In AWT we have a lot of pending exception warnings which are now being fixed. A big fraction of this warnings is about a pending JNI exception at a call to JNU_Throw*. >>>>> Why don?t we add an env->ExceptionClear() call in the beginning of each JNU_Throw function? It is absolutely safe because: >>>>> 1. We are rethrowing an exception an loosing the original one anyway. >>>>> 2. In case there?s no pending exception the ExceptionClear is a no-op. >>>>> >>>>> If we do this the code would become much cleaner, because currently we have to manually clear a pending exception before every call to JNU_Throw*. >>>>> >>>>> What do you think about this proposal? >>>>> >>>> I can see how this might be attractive but doesn't it mean you are suppressing an important exception? We've fixed many areas in the last few weeks and I think a common case was just that whoever wrote the original code didn't realize that some JNI functions having a pending exception when they fail. In those cases then often it is a simple matter of just returning from the JNI function (maybe after some clean-up). Are the examples that you are looking at along these lines? I guess I'm mostly interested to know whether the JNU_Throw usages are needed or not. >>>> >>>> -Alan. >>> > From Sergey.Bylokhov at oracle.com Fri Feb 28 12:36:09 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sat, 01 Mar 2014 00:36:09 +0400 Subject: [9] Review Request: JDK-8032960 Running forms URL throws NullPointerException in Javaconsole. In-Reply-To: References: <0EB4849B-CA97-4429-8A4E-D6CCDD002BF1@oracle.com> <5305C0C3.2090102@oracle.com> <8E3C5B81-008B-4898-AD2A-EEAEDEE25931@oracle.com> Message-ID: <5310F339.10203@oracle.com> Hi, Petr. The fix looks good. But a few notes about the test. - There is no @bug. - You should check isFullScreenSupported and isDisplayChangeSupported. On 27.02.2014 19:01, Petr Pchelko wrote: > After an offline discussion with Sergey I've got a new version of he fix: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.02/ > > Looks like previously the DesktopPropertyChangeSupport was intended to be called only on some EDT. But now we have to call it on a Toolkit thread, > so I've removed the short path, so it now always posts an events and never calls listeners directly. > > With best regards. Petr. > > On 27.02.2014, at 18:18, Petr Pchelko wrote: > >> Hello, Anthony. >> >> You were right, in case the Toolkit thread has an AppContext we should invoke the updateProperties through invokeLater as the DesktopPropertyChangeSupport could invoke a propertyChangeListener directly. >> >> Please see the updated fix here: http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.01/ >> >> I've also added an automatic test, but it's quite complicated. >> >> With best regards. Petr. >> >> On 20.02.2014, at 12:45, Anthony Petrov wrote: >> >>> Hi Petr, >>> >>> The fire...() method is now invoked on the Toolkit thread, and I see that the Toolkit.DesktopPropertyChangeSupport.firePropertyChange() will fire the event on the current thread if the toolkit thread belongs to the current app context. >>> >>> The question is: are we 100% sure that on MS Windows the AWT Toolkit thread *never* belongs to a user app context? Even if we're running in an unusual threading mode (like the one for FX where we combine the EDT and the FX toolkit thread)? >>> >>> If this is so, meaning that we always only postEvent() from the T.DPCS.fire...() method on Windows, then I'm fine with the fix. >>> >>> -- >>> best regards, >>> Anthony >>> >>> On 2/19/2014 3:29 PM, Petr Pchelko wrote: >>>> Hello, AWT Team. >>>> >>>> Please review the fix for the issue: >>>> https://bugs.openjdk.java.net/browse/JDK-8032960 >>>> The fix is available at: >>>> http://cr.openjdk.java.net/~pchelko/9/8032960/webrev.00/ >>>> >>>> The problem: >>>> The Toolkit thread does not have an AppContext so we can't use EventQueue.invokeLater on it. >>>> >>>> The solution: >>>> Remove invokeLater. This is safe, because the updateProperties is thread safe. The result of this call is a post of a PropertyChangeEvent for each AppContext in the application. >>>> >>>> The test: >>>> Hard to create, because we can't synthesize the WM_SETTINGCHANGE event. >>>> >>>> Thank you. >>>> With best regards. Petr. >>>> -- Best regards, Sergey.