From james.graham at oracle.com Sat Feb 1 01:35:26 2014 From: james.graham at oracle.com (Jim Graham) Date: Fri, 31 Jan 2014 17:35:26 -0800 Subject: [OpenJDK 2D-Dev] [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting In-Reply-To: <52EBB516.70906@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> Message-ID: <52EC4F5E.7060906@oracle.com> 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. 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... ...jim From Alan.Bateman at oracle.com Sun Feb 2 11:51:46 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 02 Feb 2014 11:51:46 +0000 Subject: [OpenJDK 2D-Dev] 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 suenaga.yasumasa at lab.ntt.co.jp Mon Feb 3 06:12:12 2014 From: suenaga.yasumasa at lab.ntt.co.jp (Yasumasa Suenaga) Date: Mon, 03 Feb 2014 15:12:12 +0900 Subject: [OpenJDK 2D-Dev] JDK-8017773: OpenJDK7 returns incorrect TrueType font metrics Message-ID: <52EF333C.2030208@lab.ntt.co.jp> Hi all, My customer encountered this issue. I think this issue is caused by Bug 1435 [1] and 1659 [2] in IcedTea. I read source code of "freetype-2.5.0-4.fc20" . Bold style should affect Font Glyph only. However, current implementation of OpenJDK affects Font Face. Thus value of Ascent/Descent is incorrect. OracleJDK seems to use sun.font.T2KFontScaler to calculate these values. So this issue occurs in OpenJDK only. I think we need to merge patches of Bug 1435 and 1659 in IcedTea to fix JDK-8017773 . Could you merge these patches ? Please cooperate. Thanks, Yasumasa [1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1435 [2] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1659 ------ D E T A I L S ------ I've created testcase as "JavaApplication1.java" . Result as: OracleJDK 6 Update 31 ---------------- [root at RHEL6-5 font]# /usr/local/jdk1.6.0_31/bin/java JavaApplication1 JDK: 1.6.0_31 VM: Java HotSpot(TM) 64-Bit Server VM java.awt.Font[family=IPAMincho,name=IPAMincho,style=plain,size=50] Ascent: 43.99414 Descent: 6.0058594 java.awt.Font[family=IPAMincho,name=IPAMincho,style=bold,size=50] Ascent: 43.99414 Descent: 6.0058594 ---------------- OpenJDK7 (in RHEL6.5) ---------------- [root at RHEL6-5 font]# java JavaApplication1 JDK: 1.7.0_45 VM: OpenJDK 64-Bit Server VM java.awt.Font[family=IPAMincho,name=IPAMincho,style=plain,size=50] Ascent: 43.99414 Descent: 6.0058594 java.awt.Font[family=IPAMincho,name=IPAMincho,style=bold,size=50] Ascent: 45.60547 Descent: 4.3945312 ---------------- -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: JavaApplication1.java URL: From anton.tarasov at oracle.com Mon Feb 3 14: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 ag at 4js.com Tue Feb 4 11:12:55 2014 From: ag at 4js.com (Alex Geller) Date: Tue, 04 Feb 2014 12:12:55 +0100 Subject: [OpenJDK 2D-Dev] [PATCH] JDK-4627340 : RFE: A way to improve text printing performance for postscript devices (Improved proposal) Message-ID: <52F0CB37.4000902@4js.com> Hi, my OCA submitted on January 10 didn't make its appearance and I am guessing it is because I checked the "Vice president" option by mistake. I have submitted a corrected version and I hope it is OK to continue posting on this topic in spite of that. After some minor adjustments to the patch I improved the test program so that instead of printing a static test document it now reads external files containing arbitrary attributed text. Based on the new version I have created a couple of test documents, compared the output under various settings and performed some benchmarks. The changes to the patch are: - For testing purposes the patch can be activated/deactivated by the temporary system property "PSRenderType3" - I removed the code that allowed to choose different byte encodings for the purpose of yielding a more compact Postscript representation mainly because text extraction via tools like "pstotext" or "ps2pdf" can't work correctly with anything else then Latin1 encoding anyway (Disregarding the option to use CID-Keyed fonts). - I spotted "Font.deriveFont(1000f)" as a source of slowness and replaced it with code that scales the glyphs of the original font instead. The test program can now be invoked with some command line options as list below: $java PSTest -help Usage: java PSTest -help|[-inputFileName file name ("example.xml")] [-latinFontName font name ("SansSerif")] [-asianFontName font name ("WenQuanYi Zen Hei")] [-renderingMethod DrawString|DrawGlyphVector|DrawTextLayout (DrawString)] [-renderIntoBufferedImage true|false (false)] [-useFractionalMetricsForLayoutComputation true|false (true)] [-useFractionalMetricsForPainting true|false (true)] [-useAntiAliasingForLayoutComputation true|false (false)] [-useAntiAliasingForPainting true|false (false)] [-numberOfPrintIterations number (3)] [-paintExpectedStringSizeMarkers number (false)] [-bufferedImageDPI number (300.0)] I created the following test documents: -oracle.xml: This is conversion of the Oracle terms and conditions page (http://www.oracle.com/us/legal/terms/index.html). The document has about 20,000 characters printed on two pages. About 1% of the characters are rendered using the default rendering due to text colorization (FOREGROUND attribute). -t-mobile.xml: This is conversion of the T-Mobile terms and conditions page (http://www.t-mobile.com/Templates/Popup.aspx?PAsset=Ftr_Ftr_TermsAndConditions&print=true). The document has about 56,000 characters printed on eight pages. About 0.1% of the characters are rendered using the default rendering due to underlining (UNDERLINE attribute). -baidu.xml: This is conversion of the Chinese Baidu terms and conditions page (http://adm.baidu.com/contract.html). The document has about 4,000 characters printed on three pages. There are 536 distinct characters in the text. All characters can be rendered using Type-3 fonts. -benchmark1.xml: A document containing a page with 64 lines of 100 'a' characters. This represents the "best case" for the font embedding strategy. -benchmark2.xml: A document containing 64 lines of 100 characters with 10 different characters -benchmark2.xml: A document containing 64 lines of 100 characters with 82 different characters -benchmark4.xml: A document containing a page with 64 lines of 99 'a' characters and one asian character. This is to test the bit set and to force the usage of "glyphshow" instead of the more compact "show" string representation -benchmark5.xml: A document containing a page with 12 lines of unique characters where each line uses an entirely different font. This represents the "worst case" for the font embedding strategy. -benchmark6.xml: Same as benchmark5.xml but just enough non unique characters are added so that size and performance exceed outline drawing. -example.xml: A two paged document that replaces the static document from the previous version. Other files: - results.html: Test results. The results include Java execution time, resulting Postscript file size and the time Ghostscript needed to rasterize the result. - results.txt: Detailed test results - condense.awk: A script that condenses the data in "results.txt" producing "results.html" - runtests.sh: A shellscript that produces "results.txt" and "results.html" - Makefile: A makefile with the targets "run" and "clean" Running the tests: The test are run via "make run" which compiles PSTest.java and then runs the shell script "runtests.sh" which in turn creates the HTML result file "results.html". Two of the tests requires a list of fonts. This list is located in "runtests.sh" and should be adjusted before running. Measuring rasterization time with Ghostscript: If "gs" is installed then the script will measure the time Ghostscript takes to render the document to a 600 DPI raster. As far as I can tell there is no option to perform rasterization only. Instead one has to select an output format where image encoding and file IO does not dominate the results. After some tests I decided to use the "pngmono" option with a scaledown of 3. Regarding the Java performance measurements: The values "Time for first run" and "Time for second run" are obtained by calls to "System.nanoTime()" immediately before and after the code that sets up and executes the print job. The JVM startup, the loading of the document and the computation of the layout are not included in this measure. Each print job is executed twice from the same JVM hence the differentiation between the values "first run" and "second run". The values "Performance for first/second in characters/s" are computed from those time measurements and the document size. Summary of results: The rendering seems to be accurate and the fallback to outline rendering when required works for all tested cases. Suggestions for additional tests are very much appreciated since I have only superficial knowledge in this area. Rendering speed using Ghostview: Font embedding is always faster including in the "worst case" scenario "benchmark5.xml" where there is absolutely no character reuse. Type 3 font embedding is more than 20 times faster on the Latin documents "t-mobile.xml" and "oracle.xml" and even with the Chinese document "baidu.xml" the gain is more than factor 6. In absolute numbers this means that the 8 page document "t-mobile.xml" is rendered in under 2 seconds while it takes about 40 seconds using the current method. Printing that document on my local DELL 2330dn takes 2 minutes using embedded fonts while it takes over 40 minutes using the current method. Rendering speed in Java: There is a large improvement in speed between the first run and consecutive runs using the new font embedding strategy for which I have not yet found an explanation while the effect is not observable when using outline drawing. However, even regarding the slower run only, the new method outperforms the existing method but for the "worst case" scenario where it reaches only about 80 % of the current performance. In all other case the improvement is at least factor 3 and gets better with growing document sizes. For the largest document "t-mobile.xml" the gain is factor 16 so that it is rendered in less then 300 ms while the current method takes over 4 seconds. On a "long running" JVM the gain nearly reached factor 40 so that the performance went from about 18 thousand characters per second to about 700 thousand characters per second. Postscript file size: The examples show an average of about 600 to 700 bytes per character using outlines for Latin text and 1.5 KB per Chinese glyph. Using font embedding the initial character definition has the same size as a outline character but any subsequent character usage requires about 5 bytes for Latin and 20 bytes for Asian text (For non fractional metrics the values roughly double). The values could be further reduced a little by using single character shortcuts for the "show", "glyphshow" and "rmoveto" commands. The files size varies between factor 400 ("best case" document "benchmark1.xml") and a 20 % increase of size ("worst case" document benchmark5.xml). For the two paged latin document "oracle.xml" the gain is more than factor 40 and for the longer document "t-mobile.xml" the gain is more than factor 120 so that the document is 300 KB instead of 35 MB. The Chinese document "baidu.xml" is reduced to about 20 % of the original size. The size difference increases after conversion to PDF so that for example the "t-mobile" document shrinks from 22 MB to less than 100KB. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: PSTest.zip Type: application/zip Size: 65412 bytes Desc: not available URL: From anthony.petrov at oracle.com Tue Feb 4 18: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 joe.darcy at oracle.com Wed Feb 5 00:30:10 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 04 Feb 2014 16:30:10 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033616 : Fix serial lint warnings in javax.imageio.* Message-ID: <52F18612.9080904@oracle.com> Hello, Please review this simple patch to add serialVersionUID fields to several serializable types in javax.imageio. JDK-8033616 : Fix serial lint warnings in javax.imageio.* http://cr.openjdk.java.net/~darcy/8033616.0/ I've verified the serialVersionUID values have been stable across JDK 6 and JDK 8. Full patch below. Thanks, -Joe --- old/src/share/classes/javax/imageio/IIOException.java 2014-02-04 16:24:18.000000000 -0800 +++ new/src/share/classes/javax/imageio/IIOException.java 2014-02-04 16:24:18.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -40,6 +40,7 @@ * */ public class IIOException extends IOException { + private static final long serialVersionUID = -3216210718638985251L; /** * Constructs an IIOException with a given message --- old/src/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java 2014-02-04 16:24:19.000000000 -0800 +++ new/src/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java 2014-02-04 16:24:19.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -44,6 +44,7 @@ * */ public class IIOInvalidTreeException extends IIOException { + private static final long serialVersionUID = -1314083172544132777L; /** * The Node that led to the parsing error, or --- old/src/share/classes/javax/imageio/metadata/IIOMetadataNode.java 2014-02-04 16:24:19.000000000 -0800 +++ new/src/share/classes/javax/imageio/metadata/IIOMetadataNode.java 2014-02-04 16:24:19.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -41,6 +41,7 @@ class IIODOMException extends DOMException { + private static final long serialVersionUID = -4369510142067447468L; public IIODOMException(short code, String message) { super(code, message); --- old/src/share/classes/javax/imageio/spi/DigraphNode.java 2014-02-04 16:24:20.000000000 -0800 +++ new/src/share/classes/javax/imageio/spi/DigraphNode.java 2014-02-04 16:24:20.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -40,6 +40,7 @@ * */ class DigraphNode implements Cloneable, Serializable { + private static final long serialVersionUID = 5308261378582246841L; /** The data associated with this node. */ protected Object data; From joe.darcy at oracle.com Wed Feb 5 07:41:28 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 04 Feb 2014 23:41:28 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font Message-ID: <52F1EB28.8090002@oracle.com> Hello, Please review this change which resolves ~200 raw and unchecked warnings in sun.font. (Afterward, the code is also free the of the "cast" warning.) JDK-8033624 : Fix raw and unchecked lint warnings in sun.font http://cr.openjdk.java.net/~darcy/8033624.0/ Thanks, -Joe From Alan.Bateman at oracle.com Wed Feb 5 08:32:32 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 05 Feb 2014 08:32:32 +0000 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033616 : Fix serial lint warnings in javax.imageio.* In-Reply-To: <52F18612.9080904@oracle.com> References: <52F18612.9080904@oracle.com> Message-ID: <52F1F720.4060007@oracle.com> On 05/02/2014 00:30, Joe Darcy wrote: > Hello, > > Please review this simple patch to add serialVersionUID fields to > several serializable types in javax.imageio. > > JDK-8033616 : Fix serial lint warnings in javax.imageio.* > http://cr.openjdk.java.net/~darcy/8033616.0/ > > I've verified the serialVersionUID values have been stable across JDK > 6 and JDK 8. Looks good to me. -Alan. From Alan.Bateman at oracle.com Wed Feb 5 09:51:10 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 05 Feb 2014 09:51:10 +0000 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F1EB28.8090002@oracle.com> References: <52F1EB28.8090002@oracle.com> Message-ID: <52F2098E.8060300@oracle.com> On 05/02/2014 07:41, Joe Darcy wrote: > Hello, > > Please review this change which resolves ~200 raw and unchecked > warnings in sun.font. (Afterward, the code is also free the of the > "cast" warning.) > > JDK-8033624 : Fix raw and unchecked lint warnings in sun.font > http://cr.openjdk.java.net/~darcy/8033624.0/ I've skimmed through this and I don't see anything obviously wrong. There are a @SuppressWarnings("unchecked") on methods where I wonder if the scope could be reduced but this requires deeper knowledge of this area. -Alan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anton.tarasov at oracle.com Wed Feb 5 16: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 philip.race at oracle.com Wed Feb 5 17:53:28 2014 From: philip.race at oracle.com (Phil Race) Date: Wed, 05 Feb 2014 09:53:28 -0800 Subject: [OpenJDK 2D-Dev] [PATCH] Re: JDK-8012351 In-Reply-To: <52DEAFB1.2020907@sd63.bc.ca> References: <52CB49CF.7050807@sd63.bc.ca> <52DEAFB1.2020907@sd63.bc.ca> Message-ID: <52F27A98.4010400@oracle.com> So that patch wasn't the right thing but as a result of off-list discussion its become clearer how the problem might occur I've updated https://bugs.openjdk.java.net/browse/JDK-8012351 with the evaluation. And I think this is the right fix for it: http://cr.openjdk.java.net/~prr/8012351/ Please review. Randy says it works for him. If anyone else is seeing this problem it would be nice to know if this fixes it for them too - or not ! I never reproduced the problem myself except by 'forcing' Ubuntu Regular to be ignored in fontconfiguration. -phil. On 01/21/2014 09:34 AM, Ryan Tandy wrote: > Dear JDK team, > > Further to my earlier message, please find attached the patch that I > think solves JDK-8012351. I applied this change to the Ubuntu JDK7 > package and made it available at the Launchpad bug for testing; so far > one other user commented that it works for them. > > Can JDK-8012351 be re-opened and this change considered as part of a > possible fix? > From henry.jen at oracle.com Wed Feb 5 20:19:38 2014 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 05 Feb 2014 12:19:38 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio Message-ID: <52F29CDA.9010705@oracle.com> Hi, Please review the webrev to clean up raw and unchecked warnings in com.sun.imageio packag at, http://cr.openjdk.java.net/~henryjen/jdk9/8033716/0/webrev/ The more significant change in this webrev is that I have changed the clone() method of MarkerSegment-derived classes to return exact type rather than Object. Otherwise, it's basically add type information and eliminate cast no longer needed. Cheers, Henry From philip.race at oracle.com Wed Feb 5 23:55:20 2014 From: philip.race at oracle.com (Phil Race) Date: Wed, 05 Feb 2014 15:55:20 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F1EB28.8090002@oracle.com> References: <52F1EB28.8090002@oracle.com> Message-ID: <52F2CF68.9080308@oracle.com> Joe, This help is very much appreciated but can you please re-generate your webrev against jdk9/client and I'll review it then. If this is a problem for you then instead I can take your final patch and commit into the client forest on your behalf. Let me know which you prefer. -phil. On 02/04/2014 11:41 PM, Joe Darcy wrote: > Hello, > > Please review this change which resolves ~200 raw and unchecked > warnings in sun.font. (Afterward, the code is also free the of the > "cast" warning.) > > JDK-8033624 : Fix raw and unchecked lint warnings in sun.font > http://cr.openjdk.java.net/~darcy/8033624.0/ > > Thanks, > > -Joe > From joe.darcy at oracle.com Thu Feb 6 02:01:12 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 05 Feb 2014 18:01:12 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52F29CDA.9010705@oracle.com> References: <52F29CDA.9010705@oracle.com> Message-ID: <52F2ECE8.5020000@oracle.com> Hi Henry, On 02/05/2014 12:19 PM, Henry Jen wrote: > Hi, > > Please review the webrev to clean up raw and unchecked warnings in > com.sun.imageio packag at, > > http://cr.openjdk.java.net/~henryjen/jdk9/8033716/0/webrev/ > > The more significant change in this webrev is that I have changed the > clone() method of MarkerSegment-derived classes to return exact type > rather than Object. Otherwise, it's basically add type information and > eliminate cast no longer needed. > > Cheers, > Henry I looked over the changes and they generally look good. I've taken a closer look at the clone-related changes. The types SOSMarkerSegment, SOFMarkerSegment, MarkerSegment, etc. are call package-private and all have had their Object-returning clone methods replaced with a self-type returning clone method, a covariant override. Since there are no other potential subclasses of these com.sun.* type that would already have had a covariant override of clone, I believe the changes to clone on these three methods is fine. (This avoid the hazards outlined in JDK-7140820: (coll) Add covariant overrides to Collections clone methods.) Thanks, -Joe From joe.darcy at oracle.com Thu Feb 6 07:44:43 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 05 Feb 2014 23:44:43 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F2098E.8060300@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2098E.8060300@oracle.com> Message-ID: <52F33D6B.70403@oracle.com> On 02/05/2014 01:51 AM, Alan Bateman wrote: > On 05/02/2014 07:41, Joe Darcy wrote: >> Hello, >> >> Please review this change which resolves ~200 raw and unchecked >> warnings in sun.font. (Afterward, the code is also free the of the >> "cast" warning.) >> >> JDK-8033624 : Fix raw and unchecked lint warnings in sun.font >> http://cr.openjdk.java.net/~darcy/8033624.0/ > I've skimmed through this and I don't see anything obviously wrong. > There are a @SuppressWarnings("unchecked") on methods where I wonder > if the scope could be reduced but this requires deeper knowledge of > this area. > > -Alan. For the range of @SuppressWarnings("unchecked"), if there was already a declaration handy, I put the annotation on the declaration (minimal scope). If there wasn't a declaration handy and the method was short, say less than 10 lines, I put the annotation on the method. Otherwise, I introduced a new declaration to host the annotation, roughly @SuppressWarnings("unchecked") Foo tmp = .... // generate the value with the unchecked condition existingVariable = tmp; // types match so no warning here -Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alan.Bateman at oracle.com Thu Feb 6 08:43:58 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Feb 2014 08:43:58 +0000 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F33D6B.70403@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2098E.8060300@oracle.com> <52F33D6B.70403@oracle.com> Message-ID: <52F34B4E.5000703@oracle.com> On 06/02/2014 07:44, Joe Darcy wrote: > > For the range of @SuppressWarnings("unchecked"), if there was already > a declaration handy, I put the annotation on the declaration (minimal > scope). If there wasn't a declaration handy and the method was short, > say less than 10 lines, I put the annotation on the method. Otherwise, > I introduced a new declaration to host the annotation, roughly > > @SuppressWarnings("unchecked") > Foo tmp = .... // generate the value with the unchecked condition > existingVariable = tmp; // types match so no warning here Okay, it looks like you've done as much as possible so thumbs up from me. -Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alan.Bateman at oracle.com Thu Feb 6 08:48:01 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Feb 2014 08:48:01 +0000 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F2CF68.9080308@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2CF68.9080308@oracle.com> Message-ID: <52F34C41.8060909@oracle.com> On 05/02/2014 23:55, Phil Race wrote: > Joe, > > This help is very much appreciated but can you please re-generate > your webrev against jdk9/client and I'll review it then. > If this is a problem for you then instead I can take your final patch and > commit into the client forest on your behalf. > Let me know which you prefer. All of these cleanups have (so far anyway) been pushed to jdk9/dev but there is clearly confusion as to where changes to AWT/Swing/2D/other code should be pushed. I hijacked one of Joe's recent reviews to restart that discussion: http://mail.openjdk.java.net/pipermail/2d-dev/2014-January/004181.html but I didn't see any replies except from Joe. -Alan. From joe.darcy at oracle.com Thu Feb 6 17:54:53 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 06 Feb 2014 09:54:53 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F34C41.8060909@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2CF68.9080308@oracle.com> <52F34C41.8060909@oracle.com> Message-ID: <52F3CC6D.3070402@oracle.com> On 02/06/2014 12:48 AM, Alan Bateman wrote: > On 05/02/2014 23:55, Phil Race wrote: >> Joe, >> >> This help is very much appreciated but can you please re-generate >> your webrev against jdk9/client and I'll review it then. >> If this is a problem for you then instead I can take your final patch >> and >> commit into the client forest on your behalf. >> Let me know which you prefer. > All of these cleanups have (so far anyway) been pushed to jdk9/dev but > there is clearly confusion as to where changes to AWT/Swing/2D/other > code should be pushed. I hijacked one of Joe's recent reviews to > restart that discussion: > > http://mail.openjdk.java.net/pipermail/2d-dev/2014-January/004181.html > > but I didn't see any replies except from Joe. > > -Alan. For the files involved in this review, when I checked late last night, the unmodified versions of the files were identical in the dev and client forests. I've been using the results of an (unfortunately Oracle-internal only) CI job run against the dev forest to track how we are doing on warnings. Since December 2013, progress has been steady, with ~800 warnings being removed from client code. My preference is to push this fix into dev and the for the maintainers of the client forest to sync it down. Unless there is a prompt and regular integration of client into dev, I don't want to first push these cleanup fixes to the client forest since there won't be prompt registration of the reduced warnings and because it would complicate efforts to fix all the warnings in a category and then enable checks in the build. The goal here is not just to eliminate the warnings, but to eliminate them and make sure they cannot come back :-) -Joe From philip.race at oracle.com Thu Feb 6 19:01:32 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 06 Feb 2014 11:01:32 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F3CC6D.3070402@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2CF68.9080308@oracle.com> <52F34C41.8060909@oracle.com> <52F3CC6D.3070402@oracle.com> Message-ID: <52F3DC0C.5020202@oracle.com> Joe, We will get an integration going soon, so you won't have to wait too long. Its more important to be consistent in that we get the client code in the client forest. We already had to deal with a merge problem due to changes to client code made in dev. So from now on if you have changes to client code, the client team's polite request is you make them in the client forest after appropriate review. -phil. On 2/6/2014 9:54 AM, Joe Darcy wrote: > On 02/06/2014 12:48 AM, Alan Bateman wrote: >> On 05/02/2014 23:55, Phil Race wrote: >>> Joe, >>> >>> This help is very much appreciated but can you please re-generate >>> your webrev against jdk9/client and I'll review it then. >>> If this is a problem for you then instead I can take your final >>> patch and >>> commit into the client forest on your behalf. >>> Let me know which you prefer. >> All of these cleanups have (so far anyway) been pushed to jdk9/dev >> but there is clearly confusion as to where changes to >> AWT/Swing/2D/other code should be pushed. I hijacked one of Joe's >> recent reviews to restart that discussion: >> >> http://mail.openjdk.java.net/pipermail/2d-dev/2014-January/004181.html >> >> but I didn't see any replies except from Joe. >> >> -Alan. > > For the files involved in this review, when I checked late last night, > the unmodified versions of the files were identical in the dev and > client forests. > > I've been using the results of an (unfortunately Oracle-internal only) > CI job run against the dev forest to track how we are doing on > warnings. Since December 2013, progress has been steady, with ~800 > warnings being removed from client code. > > My preference is to push this fix into dev and the for the maintainers > of the client forest to sync it down. Unless there is a prompt and > regular integration of client into dev, I don't want to first push > these cleanup fixes to the client forest since there won't be prompt > registration of the reduced warnings and because it would complicate > efforts to fix all the warnings in a category and then enable checks > in the build. > > The goal here is not just to eliminate the warnings, but to eliminate > them and make sure they cannot come back :-) > > -Joe From Alan.Bateman at oracle.com Thu Feb 6 19:12:53 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Feb 2014 19:12:53 +0000 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F3DC0C.5020202@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2CF68.9080308@oracle.com> <52F34C41.8060909@oracle.com> <52F3CC6D.3070402@oracle.com> <52F3DC0C.5020202@oracle.com> Message-ID: <52F3DEB5.9040401@oracle.com> On 06/02/2014 19:01, Phil Race wrote: > Joe, > > We will get an integration going soon, so you won't have to wait too > long. > Its more important to be consistent in that we get the client code in > the client forest. > We already had to deal with a merge problem due to changes to client > code made in dev. Assuming this was the SecurityManager change then this involved changes to both core and client libraries and we pushed it to jdk9/dev in mid-December. It's not too often that there are changes like this but in this case then it was important to get into jdk9/dev. It was very unfortunate that it wasn't pulled in jdk9/client for several weeks. Hopefully jdk9/client will be kept up to date going forward, also that it will push to jdk9/dev on a regular basis. -Alan From joe.darcy at oracle.com Thu Feb 6 19:15:56 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 06 Feb 2014 11:15:56 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F3DEB5.9040401@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2CF68.9080308@oracle.com> <52F34C41.8060909@oracle.com> <52F3CC6D.3070402@oracle.com> <52F3DC0C.5020202@oracle.com> <52F3DEB5.9040401@oracle.com> Message-ID: <52F3DF6C.6050706@oracle.com> On 02/06/2014 11:12 AM, Alan Bateman wrote: > On 06/02/2014 19:01, Phil Race wrote: >> Joe, >> >> We will get an integration going soon, so you won't have to wait too >> long. >> Its more important to be consistent in that we get the client code in >> the client forest. >> We already had to deal with a merge problem due to changes to client >> code made in dev. > Assuming this was the SecurityManager change then this involved > changes to both core and client libraries and we pushed it to jdk9/dev > in mid-December. It's not too often that there are changes like this > but in this case then it was important to get into jdk9/dev. It was > very unfortunate that it wasn't pulled in jdk9/client for several > weeks. Hopefully jdk9/client will be kept up to date going forward, > also that it will push to jdk9/dev on a regular basis. > Yes, with the current model, unless there are changes in the client repo that need to be isolated while being stabilized, the client forest should be sync'ed with dev regularly, closer to daily rather than weekly or monthly. -Joe From philip.race at oracle.com Thu Feb 6 19:12:38 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 06 Feb 2014 11:12:38 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F3DEB5.9040401@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2CF68.9080308@oracle.com> <52F34C41.8060909@oracle.com> <52F3CC6D.3070402@oracle.com> <52F3DC0C.5020202@oracle.com> <52F3DEB5.9040401@oracle.com> Message-ID: <52F3DEA6.5070906@oracle.com> There will be cases where its not practical or possible to separate changes. The other example I can cite is the AIX port changes which are coming in all together. But they should be considered the exception rather than the rule. In those cases you will want to consider which is the overall most appropriate location to push them. -phil. On 02/06/2014 11:12 AM, Alan Bateman wrote: > On 06/02/2014 19:01, Phil Race wrote: >> Joe, >> >> We will get an integration going soon, so you won't have to wait too >> long. >> Its more important to be consistent in that we get the client code in >> the client forest. >> We already had to deal with a merge problem due to changes to client >> code made in dev. > Assuming this was the SecurityManager change then this involved > changes to both core and client libraries and we pushed it to jdk9/dev > in mid-December. It's not too often that there are changes like this > but in this case then it was important to get into jdk9/dev. It was > very unfortunate that it wasn't pulled in jdk9/client for several > weeks. Hopefully jdk9/client will be kept up to date going forward, > also that it will push to jdk9/dev on a regular basis. > > -Alan From joe.darcy at oracle.com Thu Feb 6 19:20:31 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 06 Feb 2014 11:20:31 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F3DC0C.5020202@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2CF68.9080308@oracle.com> <52F34C41.8060909@oracle.com> <52F3CC6D.3070402@oracle.com> <52F3DC0C.5020202@oracle.com> Message-ID: <52F3E07F.9010507@oracle.com> On 02/06/2014 11:01 AM, Phil Race wrote: > Joe, > > We will get an integration going soon, so you won't have to wait too > long. > Its more important to be consistent in that we get the client code in > the client forest. > We already had to deal with a merge problem due to changes to client > code made in dev. > So from now on if you have changes to client code, the client team's > polite request is > you make them in the client forest after appropriate review. Well, if all the client library (2D, awt, swing) changes went the dev forest directly, that would be another way to get consistency ;-) As many of the files I'm changing as part of the warnings cleanup have been untouched for five, ten, or in sometimes fifteen years, I would appreciate prompt reviews, especially when the changes are broken into small, easy to review portions: http://mail.openjdk.java.net/pipermail/awt-dev/2014-February/006934.html -Joe > > -phil. > > On 2/6/2014 9:54 AM, Joe Darcy wrote: >> On 02/06/2014 12:48 AM, Alan Bateman wrote: >>> On 05/02/2014 23:55, Phil Race wrote: >>>> Joe, >>>> >>>> This help is very much appreciated but can you please re-generate >>>> your webrev against jdk9/client and I'll review it then. >>>> If this is a problem for you then instead I can take your final >>>> patch and >>>> commit into the client forest on your behalf. >>>> Let me know which you prefer. >>> All of these cleanups have (so far anyway) been pushed to jdk9/dev >>> but there is clearly confusion as to where changes to >>> AWT/Swing/2D/other code should be pushed. I hijacked one of Joe's >>> recent reviews to restart that discussion: >>> >>> http://mail.openjdk.java.net/pipermail/2d-dev/2014-January/004181.html >>> >>> but I didn't see any replies except from Joe. >>> >>> -Alan. >> >> For the files involved in this review, when I checked late last >> night, the unmodified versions of the files were identical in the >> dev and client forests. >> >> I've been using the results of an (unfortunately Oracle-internal >> only) CI job run against the dev forest to track how we are doing on >> warnings. Since December 2013, progress has been steady, with ~800 >> warnings being removed from client code. >> >> My preference is to push this fix into dev and the for the >> maintainers of the client forest to sync it down. Unless there is a >> prompt and regular integration of client into dev, I don't want to >> first push these cleanup fixes to the client forest since there won't >> be prompt registration of the reduced warnings and because it would >> complicate efforts to fix all the warnings in a category and then >> enable checks in the build. >> >> The goal here is not just to eliminate the warnings, but to eliminate >> them and make sure they cannot come back :-) >> >> -Joe > From philip.race at oracle.com Thu Feb 6 22:31:23 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 06 Feb 2014 14:31:23 -0800 Subject: [OpenJDK 2D-Dev] RFR: Fix for 8032693 : javax.print.PrintService does not find any CUPS-Printers on Linux Message-ID: <52F40D3B.9060602@oracle.com> http://cr.openjdk.java.net/~prr/8032693/ This is a fix for https://bugs.openjdk.java.net/browse/JDK-8032693 It was introduced by the JDK 8 b115 fix for https://bugs.openjdk.java.net/browse/JDK-8022536 The root of the issue is that if you do not have a default printer set in CUPS then we get an NPE at line 635 (original file) of UnixPrintServiceLookup.java de-referencing the array returned from CUPSPrinter.getDefaultPrinter(). This caused a failure not just locating the default but *any* printer because the NPE went all the way back up to javax.print implementation where it calls getPrintServices() Really preventing that NPE from happening is all there is to the fix But for good measure I 1) Catch such an exception inside refreshServices() so we can continue on 2) Fix the usage of device-uri (should be printer-uri-supported) 3) Add lots more debugging to make it easier to get to the bottom of future problems. I'm pretty confident in this fix since I was able to reproduce the problem by updating CUPS so I had no default and this cures it. I've added a regression test as best I can. Unless you have printers, but have also no default printer its going to pass regardless. -phil From philip.race at oracle.com Fri Feb 7 00:13:51 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 06 Feb 2014 16:13:51 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F2098E.8060300@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2098E.8060300@oracle.com> Message-ID: <52F4253F.6020706@oracle.com> Comments/questions on the changes :- Font2D.java 108 protected Reference lastFontStrike = new SoftReference<>(null); ... 320 lastFontStrike = new SoftReference<>(strike); So the diamond operator can be used in this 2nd case ? Apparently so. I vaguely remember that it used to only be able to infer the type in the first case ? Did it get updated or did I just not realise ?? There are a few places including these :- ----- AttributeValues.java Map imStyles = hl.getStyle(); FontResolver.java 226 public Font getFont(int index, 227 Map attributes) { ---- where its not obvious how you decided the type to use. I know a lot of this code and that they look reasonable but I wouldn't have been confident that there weren't places where we allowed some wider type to be used in these maps. How did you decide on the types and how did you verify it ? > @SuppressWarnings("unchecked") Can you show what thevarious warnings looked like and say why they needed to be suppressed rather than fixed ? Is it anywhere you found it to tricky/impossible to get rid of a cast ? FontScaler.java : Is the whole somewhat ugly re-writing of this so that you have a single expression to which to apply @SuppressWarnings ? If you are going to do that anyway was it worth it ? Can't it just be applied to the static initialiser block ? And at the very least there should be spaces before "?" and ":" to make it easier to read. StrikeCache.java: Disposer.addReference((Reference)(Reference)this, disposer); Why does this look like a cast of an already cast variable ? Looks weird to me. SunFontManager.java lines 2310-2314 look much > 80 chars. We keep all these files <=80 chars wide I find it tricky to catch all those in review but please be conscious of it. I suspect line 2644 in the same file is also too long.Also 3066, 3068, 3128, 3157.. please fix all of these and any others I may have overlooked in this or other files. And don't forget - please re-generate against client, or ask me to push there for you. -phil. On 2/5/2014 1:51 AM, Alan Bateman wrote: > On 05/02/2014 07:41, Joe Darcy wrote: >> Hello, >> >> Please review this change which resolves ~200 raw and unchecked >> warnings in sun.font. (Afterward, the code is also free the of the >> "cast" warning.) >> >> JDK-8033624 : Fix raw and unchecked lint warnings in sun.font >> http://cr.openjdk.java.net/~darcy/8033624.0/ > I've skimmed through this and I don't see anything obviously wrong. > There are a @SuppressWarnings("unchecked") on methods where I wonder > if the scope could be reduced but this requires deeper knowledge of > this area. > > -Alan. From joe.darcy at oracle.com Fri Feb 7 08:30:47 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 07 Feb 2014 00:30:47 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F4253F.6020706@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2098E.8060300@oracle.com> <52F4253F.6020706@oracle.com> Message-ID: <52F499B7.80102@oracle.com> Hello, On 02/06/2014 04:13 PM, Phil Race wrote: > Comments/questions on the changes :- > > Font2D.java > > > 108 protected Reference lastFontStrike = new > SoftReference<>(null); > ... > > > 320 lastFontStrike = new SoftReference<>(strike); > > So the diamond operator can be used in this 2nd case ? Apparently so. Yes; I verified the modified code successfully compiled :-) > I vaguely remember that it used to only be able to infer the type in > the first case ? > Did it get updated or did I just not realise ?? In JDK 7, the compiler could often infer the right type for a diamond in most contexts, but in JDK 8, the inference scheme is more powerful. IIRC, the main difference is that in JDK 8 the compiler can do a better job of inferring diamond when it occurs in a position like an argument in a method call (where there is an interaction between the inference of diamond and the overload resolution logic). > > > There are a few places including these :- > ----- > AttributeValues.java > > Map imStyles = hl.getStyle(); > > FontResolver.java > > > 226 public Font getFont(int index, > 227 Map AttributedCharacterIterator.Attribute, ?> attributes) { > > ---- > > where its not obvious how you decided the type to use. In that particular case, I looked at the return type of the method java.awt.Font.getAttributes(); I did the analogous looking in the other case. > I know a lot of this code and that they look reasonable but I wouldn't > have been confident > that there weren't places where we allowed some wider type to be used > in these maps. > How did you decide on the types and how did you verify it ? The verification occurs by compiling the JDK; if there was a mismatch the compiler would compile. (Since these are sun.* classes, they are officially only supposed to be used inside the JDK.) > > >> @SuppressWarnings("unchecked") > > Can you show what thevarious warnings looked like and say why they > needed to be suppressed rather than fixed ? In AttributeValues, the warning in the original code is: src/share/classes/sun/font/AttributeValues.java:822: warning: [unchecked] unchecked cast av = AttributeValues.fromMap((Map)map); // yuck ^ required: Map found: Map where CAP#1,CAP#2 are fresh type-variables: CAP#1 extends Object from capture of ? CAP#2 extends Object from capture of ? The map value comes in as a parameter of type Map map and then some runtime check verify it is an AttributeMap. This these two unchecked casts are isolated, I didn't think it was worthwhile to try to perform more extensive surgery to try to fix up the types. > Is it anywhere you found it to tricky/impossible to get rid of a cast ? Yes, largely where @SuppressWarning("unchecked") was used :-) One example, in + @SuppressWarnings("unchecked") HashMap ffmapCopy = (HashMap)(fontToFileMap.clone()); the unchecked suppression is needed because the clone method in HashMap is declared to return "Object" rather than "HashMap" even though it does actually return a "HashMap". I looked into changing this in collections, but there are subtle compatibility issues that unfortunately argue for leaving these particular clone methods as returning Object. There are a few occurrences of casting the result of cloning a collection. The appContext mechanism is not fully generics friendly and needed some casts and unchecked suppression. Some code in SunFontManager.java attempted to make generics and arrays play together in an unnatural way and @SuppressWarning("unchecked") was needed to keep the peace without attempting a larger rewrite. > > FontScaler.java : > > Is the whole somewhat ugly re-writing of this so that you have a > single expression > to which to apply @SuppressWarnings ? Basically, but the situation is worse than usual since Class.forName maps a String to a Class and I wanted only one cast to (Class) with a single @SuppressWarnings for that cast. > > If you are going to do that anyway was it worth it ? Can't it just be > applied > to the static initialiser block ? The SuppressWarning declaration cannot be applied to the static initializer block since the block is not the sort of declaration that can host an annotation. > > And at the very least there should be spaces before "?" and ":" to > make it > easier to read. Okay. > > > StrikeCache.java: > > Disposer.addReference((Reference)(Reference)this, disposer); > > Why does this look like a cast of an already cast variable ? Looks > weird to me. The short answer is that a cast through a raw type, "Reference" in this case, is sometimes necessary to convince the compiler you can do something it doesn't think you should be able to do. The "this" value has a type of Reference and that is not directly convertible to Reference. (The Disposer is weirdly typed, basically a type-hetrogenous container, and would have to be more extensively revised to play well with generics.) > > > SunFontManager.java > > lines 2310-2314 look much > 80 chars. We keep all these files <=80 > chars wide > > I find it tricky to catch all those in review but please be conscious > of it. > I suspect line 2644 in the same file is also too long.Also 3066, 3068, > 3128, 3157.. > please fix all of these and any others I may have overlooked in this > or other files. Okay. > > And don't forget - please re-generate against client, or ask me to > push there for you. > > -phil. > Thanks for the review, -Joe From alexandr.scherbatiy at oracle.com Fri Feb 7 11:00:59 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 07 Feb 2014 15:00:59 +0400 Subject: [OpenJDK 2D-Dev] [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 jennifer.godinez at oracle.com Fri Feb 7 17:00:34 2014 From: jennifer.godinez at oracle.com (Jennifer Godinez) Date: Fri, 07 Feb 2014 09:00:34 -0800 Subject: [OpenJDK 2D-Dev] RFR: Fix for 8032693 : javax.print.PrintService does not find any CUPS-Printers on Linux In-Reply-To: <52F40D3B.9060602@oracle.com> References: <52F40D3B.9060602@oracle.com> Message-ID: <52F51132.4060301@oracle.com> Approved. Jennifer On 02/06/2014 02:31 PM, Phil Race wrote: > http://cr.openjdk.java.net/~prr/8032693/ > > This is a fix for https://bugs.openjdk.java.net/browse/JDK-8032693 > > It was introduced by the JDK 8 b115 fix for > https://bugs.openjdk.java.net/browse/JDK-8022536 > > The root of the issue is that if you do not have a default printer set > in CUPS then > we get an NPE at line 635 (original file) of > UnixPrintServiceLookup.java de-referencing > the array returned from CUPSPrinter.getDefaultPrinter(). > > This caused a failure not just locating the default but *any* printer > because > the NPE went all the way back up to javax.print implementation where > it calls > getPrintServices() > > Really preventing that NPE from happening is all there is to the fix > But for good measure I > 1) Catch such an exception inside refreshServices() so we can continue on > 2) Fix the usage of device-uri (should be printer-uri-supported) > 3) Add lots more debugging to make it easier to get to the bottom of > future problems. > > I'm pretty confident in this fix since I was able to reproduce the > problem > by updating CUPS so I had no default and this cures it. > > I've added a regression test as best I can. Unless you have printers, but > have also no default printer its going to pass regardless. > > -phil > From philip.race at oracle.com Fri Feb 7 17:30:18 2014 From: philip.race at oracle.com (Phil Race) Date: Fri, 07 Feb 2014 09:30:18 -0800 Subject: [OpenJDK 2D-Dev] RFR: Fix for 8032693 : javax.print.PrintService does not find any CUPS-Printers on Linux In-Reply-To: <52F51132.4060301@oracle.com> References: <52F40D3B.9060602@oracle.com> <52F51132.4060301@oracle.com> Message-ID: <52F5182A.7030803@oracle.com> 2nd reviewer anyone ? FWIW the external submitter of the bug report confirms this fixes it for him too. -phil. On 2/7/2014 9:00 AM, Jennifer Godinez wrote: > Approved. > > Jennifer > On 02/06/2014 02:31 PM, Phil Race wrote: >> http://cr.openjdk.java.net/~prr/8032693/ >> >> This is a fix for https://bugs.openjdk.java.net/browse/JDK-8032693 >> >> It was introduced by the JDK 8 b115 fix for >> https://bugs.openjdk.java.net/browse/JDK-8022536 >> >> The root of the issue is that if you do not have a default printer >> set in CUPS then >> we get an NPE at line 635 (original file) of >> UnixPrintServiceLookup.java de-referencing >> the array returned from CUPSPrinter.getDefaultPrinter(). >> >> This caused a failure not just locating the default but *any* printer >> because >> the NPE went all the way back up to javax.print implementation where >> it calls >> getPrintServices() >> >> Really preventing that NPE from happening is all there is to the fix >> But for good measure I >> 1) Catch such an exception inside refreshServices() so we can >> continue on >> 2) Fix the usage of device-uri (should be printer-uri-supported) >> 3) Add lots more debugging to make it easier to get to the bottom of >> future problems. >> >> I'm pretty confident in this fix since I was able to reproduce the >> problem >> by updating CUPS so I had no default and this cures it. >> >> I've added a regression test as best I can. Unless you have printers, >> but >> have also no default printer its going to pass regardless. >> >> -phil >> > From Sergey.Bylokhov at oracle.com Fri Feb 7 20:21:46 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sat, 08 Feb 2014 00:21:46 +0400 Subject: [OpenJDK 2D-Dev] RFR: Fix for 8032693 : javax.print.PrintService does not find any CUPS-Printers on Linux In-Reply-To: <52F40D3B.9060602@oracle.com> References: <52F40D3B.9060602@oracle.com> Message-ID: <52F5405A.4060708@oracle.com> Hi , Phil. Why we catch Throwable(OutOfMemoryError)? Probably we can use java generics in defaultMap in CUPSPrinter? Code from the test: 42 if (!os.equals("linux")) { 43 System.out.println("Linux specific test. No need to continue"); 44 } No need to continue... and continue anyway? On 07.02.2014 2:31, Phil Race wrote: > http://cr.openjdk.java.net/~prr/8032693/ > > This is a fix for https://bugs.openjdk.java.net/browse/JDK-8032693 > > It was introduced by the JDK 8 b115 fix for > https://bugs.openjdk.java.net/browse/JDK-8022536 > > The root of the issue is that if you do not have a default printer set > in CUPS then > we get an NPE at line 635 (original file) of > UnixPrintServiceLookup.java de-referencing > the array returned from CUPSPrinter.getDefaultPrinter(). > > This caused a failure not just locating the default but *any* printer > because > the NPE went all the way back up to javax.print implementation where > it calls > getPrintServices() > > Really preventing that NPE from happening is all there is to the fix > But for good measure I > 1) Catch such an exception inside refreshServices() so we can continue on > 2) Fix the usage of device-uri (should be printer-uri-supported) > 3) Add lots more debugging to make it easier to get to the bottom of > future problems. > > I'm pretty confident in this fix since I was able to reproduce the > problem > by updating CUPS so I had no default and this cures it. > > I've added a regression test as best I can. Unless you have printers, but > have also no default printer its going to pass regardless. > > -phil > -- Best regards, Sergey. From philip.race at oracle.com Fri Feb 7 20:35:01 2014 From: philip.race at oracle.com (Phil Race) Date: Fri, 07 Feb 2014 12:35:01 -0800 Subject: [OpenJDK 2D-Dev] RFR: Fix for 8032693 : javax.print.PrintService does not find any CUPS-Printers on Linux In-Reply-To: <52F5405A.4060708@oracle.com> References: <52F40D3B.9060602@oracle.com> <52F5405A.4060708@oracle.com> Message-ID: <52F54375.6020006@oracle.com> On 2/7/2014 12:21 PM, Sergey Bylokhov wrote: > Hi , Phil. > Why we catch Throwable(OutOfMemoryError)? Because I want to be as sure as I can be that we don't get some random error causing us to fail completely as was happening. > Probably we can use java generics in defaultMap in CUPSPrinter? This fix isn't intended as clean-up as I want to directly backport to 8 So aside from fixing the big and very real problem and adding debugging help I don't want to do anything else here. In fact I chopped out a bunch of other clean up I have pending. It'll go in another fix, another day. > > Code from the test: > 42 if (!os.equals("linux")) { > 43 System.out.println("Linux specific test. No need to > continue"); > 44 } > No need to continue... and continue anyway? Oops. Meant to have a return there :) I'll fix before I push. Anything else ? -phil. > > On 07.02.2014 2:31, Phil Race wrote: >> http://cr.openjdk.java.net/~prr/8032693/ >> >> This is a fix for https://bugs.openjdk.java.net/browse/JDK-8032693 >> >> It was introduced by the JDK 8 b115 fix for >> https://bugs.openjdk.java.net/browse/JDK-8022536 >> >> The root of the issue is that if you do not have a default printer >> set in CUPS then >> we get an NPE at line 635 (original file) of >> UnixPrintServiceLookup.java de-referencing >> the array returned from CUPSPrinter.getDefaultPrinter(). >> >> This caused a failure not just locating the default but *any* printer >> because >> the NPE went all the way back up to javax.print implementation where >> it calls >> getPrintServices() >> >> Really preventing that NPE from happening is all there is to the fix >> But for good measure I >> 1) Catch such an exception inside refreshServices() so we can >> continue on >> 2) Fix the usage of device-uri (should be printer-uri-supported) >> 3) Add lots more debugging to make it easier to get to the bottom of >> future problems. >> >> I'm pretty confident in this fix since I was able to reproduce the >> problem >> by updating CUPS so I had no default and this cures it. >> >> I've added a regression test as best I can. Unless you have printers, >> but >> have also no default printer its going to pass regardless. >> >> -phil >> > > From Sergey.Bylokhov at oracle.com Fri Feb 7 20:51:12 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sat, 08 Feb 2014 00:51:12 +0400 Subject: [OpenJDK 2D-Dev] RFR: Fix for 8032693 : javax.print.PrintService does not find any CUPS-Printers on Linux In-Reply-To: <52F54375.6020006@oracle.com> References: <52F40D3B.9060602@oracle.com> <52F5405A.4060708@oracle.com> <52F54375.6020006@oracle.com> Message-ID: <52F54740.7090407@oracle.com> On 08.02.2014 0:35, Phil Race wrote: >> 42 if (!os.equals("linux")) { >> 43 System.out.println("Linux specific test. No need to >> continue"); >> 44 } >> No need to continue... and continue anyway? > > Oops. Meant to have a return there :) > > I'll fix before I push. Anything else ? No. The fix looks good. > > -phil. > >> >> On 07.02.2014 2:31, Phil Race wrote: >>> http://cr.openjdk.java.net/~prr/8032693/ >>> >>> This is a fix for https://bugs.openjdk.java.net/browse/JDK-8032693 >>> >>> It was introduced by the JDK 8 b115 fix for >>> https://bugs.openjdk.java.net/browse/JDK-8022536 >>> >>> The root of the issue is that if you do not have a default printer >>> set in CUPS then >>> we get an NPE at line 635 (original file) of >>> UnixPrintServiceLookup.java de-referencing >>> the array returned from CUPSPrinter.getDefaultPrinter(). >>> >>> This caused a failure not just locating the default but *any* >>> printer because >>> the NPE went all the way back up to javax.print implementation where >>> it calls >>> getPrintServices() >>> >>> Really preventing that NPE from happening is all there is to the fix >>> But for good measure I >>> 1) Catch such an exception inside refreshServices() so we can >>> continue on >>> 2) Fix the usage of device-uri (should be printer-uri-supported) >>> 3) Add lots more debugging to make it easier to get to the bottom of >>> future problems. >>> >>> I'm pretty confident in this fix since I was able to reproduce the >>> problem >>> by updating CUPS so I had no default and this cures it. >>> >>> I've added a regression test as best I can. Unless you have >>> printers, but >>> have also no default printer its going to pass regardless. >>> >>> -phil >>> >> >> > -- Best regards, Sergey. From henry.jen at oracle.com Fri Feb 7 21:54:44 2014 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 07 Feb 2014 13:54:44 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52F2ECE8.5020000@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> Message-ID: <52F55624.3040903@oracle.com> Thanks Joe for reviewing. I would like to get 2d developer review as well before pushing this, let me know if that's not necessary. Also there was a discussion ealier on whether such change should go to client or jdk9/dev repo, do we have a conclusion? Cheers, Henry On 02/05/2014 06:01 PM, Joe Darcy wrote: > Hi Henry, > > On 02/05/2014 12:19 PM, Henry Jen wrote: >> Hi, >> >> Please review the webrev to clean up raw and unchecked warnings in >> com.sun.imageio packag at, >> >> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/0/webrev/ >> >> The more significant change in this webrev is that I have changed the >> clone() method of MarkerSegment-derived classes to return exact type >> rather than Object. Otherwise, it's basically add type information and >> eliminate cast no longer needed. >> >> Cheers, >> Henry > > I looked over the changes and they generally look good. I've taken a > closer look at the clone-related changes. > > The types SOSMarkerSegment, SOFMarkerSegment, MarkerSegment, etc. are > call package-private and all have had their Object-returning clone > methods replaced with a self-type returning clone method, a covariant > override. > > Since there are no other potential subclasses of these com.sun.* type > that would already have had a covariant override of clone, I believe the > changes to clone on these three methods is fine. (This avoid the hazards > outlined in JDK-7140820: (coll) Add covariant overrides to Collections > clone methods.) > > Thanks, > > -Joe From philip.race at oracle.com Fri Feb 7 22:20:42 2014 From: philip.race at oracle.com (Phil Race) Date: Fri, 07 Feb 2014 14:20:42 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52F55624.3040903@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> Message-ID: <52F55C3A.8070806@oracle.com> Yes, it should get 2d review and I will look at this soon as priorities permit but the *conclusion* is that the client team ask that such changes go into the client forest. If this is a problem for you then we will do it on your behalf. We do not want client changes directly into dev. That is a very polite but firm request. -phil. On 2/7/2014 1:54 PM, Henry Jen wrote: > Thanks Joe for reviewing. > > I would like to get 2d developer review as well before pushing this, > let me know if that's not necessary. > > Also there was a discussion ealier on whether such change should go to > client or jdk9/dev repo, do we have a conclusion? > > Cheers, > Henry > > On 02/05/2014 06:01 PM, Joe Darcy wrote: >> Hi Henry, >> >> On 02/05/2014 12:19 PM, Henry Jen wrote: >>> Hi, >>> >>> Please review the webrev to clean up raw and unchecked warnings in >>> com.sun.imageio packag at, >>> >>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/0/webrev/ >>> >>> The more significant change in this webrev is that I have changed the >>> clone() method of MarkerSegment-derived classes to return exact type >>> rather than Object. Otherwise, it's basically add type information and >>> eliminate cast no longer needed. >>> >>> Cheers, >>> Henry >> >> I looked over the changes and they generally look good. I've taken a >> closer look at the clone-related changes. >> >> The types SOSMarkerSegment, SOFMarkerSegment, MarkerSegment, etc. are >> call package-private and all have had their Object-returning clone >> methods replaced with a self-type returning clone method, a covariant >> override. >> >> Since there are no other potential subclasses of these com.sun.* type >> that would already have had a covariant override of clone, I believe the >> changes to clone on these three methods is fine. (This avoid the hazards >> outlined in JDK-7140820: (coll) Add covariant overrides to Collections >> clone methods.) >> >> Thanks, >> >> -Joe From philip.race at oracle.com Fri Feb 7 23:00:14 2014 From: philip.race at oracle.com (Phil Race) Date: Fri, 07 Feb 2014 15:00:14 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52F55624.3040903@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> Message-ID: <52F5657E.70206@oracle.com> BMPMetadata.java 94 // Fields from CommentExtension 95 // List of byte[] 96 public List comments = null; // new ArrayList(); hmm .. how did you decide this was correct, other than trusting the comment? The thing is I can't actually see where this field is used and I'm inclined to think this was a copy/paste from the GIF code. It would seem the right thing to do is delete these lines. In the case of GIFImageMetadata they are used but you left the comments saying // new ArrayList(); since it looks like you use the diamond operator now that should not be completely true. Either remove the comment or, since it seems it was intended to be informative update it to say // new ArrayList<>(); I will have to look at all the subsequent files later .. -phil. On 2/7/2014 1:54 PM, Henry Jen wrote: > Thanks Joe for reviewing. > > I would like to get 2d developer review as well before pushing this, > let me know if that's not necessary. > > Also there was a discussion ealier on whether such change should go to > client or jdk9/dev repo, do we have a conclusion? > > Cheers, > Henry > > On 02/05/2014 06:01 PM, Joe Darcy wrote: >> Hi Henry, >> >> On 02/05/2014 12:19 PM, Henry Jen wrote: >>> Hi, >>> >>> Please review the webrev to clean up raw and unchecked warnings in >>> com.sun.imageio packag at, >>> >>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/0/webrev/ >>> >>> The more significant change in this webrev is that I have changed the >>> clone() method of MarkerSegment-derived classes to return exact type >>> rather than Object. Otherwise, it's basically add type information and >>> eliminate cast no longer needed. >>> >>> Cheers, >>> Henry >> >> I looked over the changes and they generally look good. I've taken a >> closer look at the clone-related changes. >> >> The types SOSMarkerSegment, SOFMarkerSegment, MarkerSegment, etc. are >> call package-private and all have had their Object-returning clone >> methods replaced with a self-type returning clone method, a covariant >> override. >> >> Since there are no other potential subclasses of these com.sun.* type >> that would already have had a covariant override of clone, I believe the >> changes to clone on these three methods is fine. (This avoid the hazards >> outlined in JDK-7140820: (coll) Add covariant overrides to Collections >> clone methods.) >> >> Thanks, >> >> -Joe From joe.darcy at oracle.com Fri Feb 7 23:51:49 2014 From: joe.darcy at oracle.com (Joseph Darcy) Date: Fri, 07 Feb 2014 15:51:49 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52F55C3A.8070806@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F55C3A.8070806@oracle.com> Message-ID: <52F57195.1040403@oracle.com> On 2/7/2014 2:20 PM, Phil Race wrote: > Yes, it should get 2d review and I will look at this soon as priorities > permit but the *conclusion* is that the client team > ask that such changes go into the client forest. If this is a problem for > you then we will do it on your behalf. We do not want client changes > directly into dev. That is a very polite but firm request. If such changes are going to go into the client forest rather than dev, there has to be some bounded timeline for the fixes to get integrated from client into dev. The client and dev forests were created back in December 2013. Since then, there have been two promoted builds of JDK 9. The client forest has not integrated yet into dev; in contrast, the HotSpot forest has integrated into dev at least twice. An implication of using a separate client forest for client library fixes is that the forest has to be actively maintained, both syncing down changes from dev regularly and integrating changes into dev regularly. -Joe > > -phil. > > On 2/7/2014 1:54 PM, Henry Jen wrote: >> Thanks Joe for reviewing. >> >> I would like to get 2d developer review as well before pushing this, >> let me know if that's not necessary. >> >> Also there was a discussion ealier on whether such change should go >> to client or jdk9/dev repo, do we have a conclusion? >> >> Cheers, >> Henry >> >> On 02/05/2014 06:01 PM, Joe Darcy wrote: >>> Hi Henry, >>> >>> On 02/05/2014 12:19 PM, Henry Jen wrote: >>>> Hi, >>>> >>>> Please review the webrev to clean up raw and unchecked warnings in >>>> com.sun.imageio packag at, >>>> >>>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/0/webrev/ >>>> >>>> The more significant change in this webrev is that I have changed the >>>> clone() method of MarkerSegment-derived classes to return exact type >>>> rather than Object. Otherwise, it's basically add type information and >>>> eliminate cast no longer needed. >>>> >>>> Cheers, >>>> Henry >>> >>> I looked over the changes and they generally look good. I've taken a >>> closer look at the clone-related changes. >>> >>> The types SOSMarkerSegment, SOFMarkerSegment, MarkerSegment, etc. are >>> call package-private and all have had their Object-returning clone >>> methods replaced with a self-type returning clone method, a covariant >>> override. >>> >>> Since there are no other potential subclasses of these com.sun.* type >>> that would already have had a covariant override of clone, I believe >>> the >>> changes to clone on these three methods is fine. (This avoid the >>> hazards >>> outlined in JDK-7140820: (coll) Add covariant overrides to Collections >>> clone methods.) >>> >>> Thanks, >>> >>> -Joe > From james.graham at oracle.com Sat Feb 8 00:19:54 2014 From: james.graham at oracle.com (Jim Graham) Date: Fri, 07 Feb 2014 16:19:54 -0800 Subject: [OpenJDK 2D-Dev] [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 henry.jen at oracle.com Sat Feb 8 00:27:14 2014 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 07 Feb 2014 16:27:14 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52F5657E.70206@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> Message-ID: <52F579E2.6020209@oracle.com> On 02/07/2014 03:00 PM, Phil Race wrote: > BMPMetadata.java > > > 94 // Fields from CommentExtension > 95 // List of byte[] > 96 public List comments = null; // new ArrayList(); > > hmm .. how did you decide this was correct, other than trusting the > comment? For this one, I took it from the comment, after verified similar types in GIF. > > The thing is I can't actually see where this field is used and I'm inclined > to think this was a copy/paste from the GIF code. > > It would seem the right thing to do is delete these lines. > It is public, so I don't dare to remove it, although it seems like nothing in com.sun.imageio ever make use of this field. Also, from the BMPMetadataFormat, CommentExtension is a string type, so I am not really sure what's the best to do here. If you think it is safe to remove it, I am more than happy to remove it. > In the case of GIFImageMetadata they are used but you left the comments > saying > > // new ArrayList(); > > since it looks like you use the diamond operator now that should > not be completely true. Either remove the comment or, since it > seems it was intended to be informative update it to say > // new ArrayList<>(); > Agree, I'll remove those comments. > I will have to look at all the subsequent files later .. > Thanks for reviewing it. Cheers, Henry From james.graham at oracle.com Sat Feb 8 00: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 joe.darcy at oracle.com Mon Feb 10 05:12:50 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Sun, 09 Feb 2014 21:12:50 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8034050: Fix serial lint warnings in javax.print Message-ID: <52F85FD2.7070102@oracle.com> Hello, Please review the proposed fix for JDK-8034050: Fix serial lint warnings in javax.print http://cr.openjdk.java.net/~darcy/8034050.0/ I checked that the added serialVerionUID values match the serialver computations for those types on JDK 6 and 8. Thanks, -Joe --- old/src/share/classes/javax/print/DocFlavor.java 2014-02-09 21:09:29.000000000 -0800 +++ new/src/share/classes/javax/print/DocFlavor.java 2014-02-09 21:09:29.000000000 -0800 @@ -1045,6 +1045,7 @@ * @author Alan Kaminsky */ public static class URL extends DocFlavor { + private static final long serialVersionUID = 2936725788144902062L; /** * Constructs a new doc flavor with the given MIME type and a print --- old/src/share/classes/javax/print/PrintException.java 2014-02-09 21:09:30.000000000 -0800 +++ new/src/share/classes/javax/print/PrintException.java 2014-02-09 21:09:29.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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,7 +33,7 @@ * */ public class PrintException extends Exception { - + private static final long serialVersionUID = -5932531546705242471L; /** * Construct a print exception with no detail message. --- old/src/share/classes/javax/print/attribute/AttributeSetUtilities.java 2014-02-09 21:09:30.000000000 -0800 +++ new/src/share/classes/javax/print/attribute/AttributeSetUtilities.java 2014-02-09 21:09:30.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -77,6 +77,7 @@ */ private static class UnmodifiableAttributeSet implements AttributeSet, Serializable { + private static final long serialVersionUID = -6131802583863447813L; private AttributeSet attrset; @@ -147,6 +148,7 @@ private static class UnmodifiableDocAttributeSet extends UnmodifiableAttributeSet implements DocAttributeSet, Serializable { + private static final long serialVersionUID = -6349408326066898956L; public UnmodifiableDocAttributeSet(DocAttributeSet attributeSet) { @@ -161,6 +163,7 @@ extends UnmodifiableAttributeSet implements PrintRequestAttributeSet, Serializable { + private static final long serialVersionUID = 7799373532614825073L; public UnmodifiablePrintRequestAttributeSet (PrintRequestAttributeSet attributeSet) { @@ -175,6 +178,7 @@ extends UnmodifiableAttributeSet implements PrintJobAttributeSet, Serializable { + private static final long serialVersionUID = -8002245296274522112L; public UnmodifiablePrintJobAttributeSet (PrintJobAttributeSet attributeSet) { @@ -189,6 +193,7 @@ extends UnmodifiableAttributeSet implements PrintServiceAttributeSet, Serializable { + private static final long serialVersionUID = -7112165137107826819L; public UnmodifiablePrintServiceAttributeSet (PrintServiceAttributeSet attributeSet) { @@ -291,6 +296,7 @@ */ private static class SynchronizedAttributeSet implements AttributeSet, Serializable { + private static final long serialVersionUID = 8365731020128564925L; private AttributeSet attrset; @@ -357,6 +363,7 @@ private static class SynchronizedDocAttributeSet extends SynchronizedAttributeSet implements DocAttributeSet, Serializable { + private static final long serialVersionUID = 6455869095246629354L; public SynchronizedDocAttributeSet(DocAttributeSet attributeSet) { super(attributeSet); @@ -369,6 +376,7 @@ private static class SynchronizedPrintRequestAttributeSet extends SynchronizedAttributeSet implements PrintRequestAttributeSet, Serializable { + private static final long serialVersionUID = 5671237023971169027L; public SynchronizedPrintRequestAttributeSet (PrintRequestAttributeSet attributeSet) { @@ -382,6 +390,7 @@ private static class SynchronizedPrintJobAttributeSet extends SynchronizedAttributeSet implements PrintJobAttributeSet, Serializable { + private static final long serialVersionUID = 2117188707856965749L; public SynchronizedPrintJobAttributeSet (PrintJobAttributeSet attributeSet) { @@ -395,6 +404,8 @@ private static class SynchronizedPrintServiceAttributeSet extends SynchronizedAttributeSet implements PrintServiceAttributeSet, Serializable { + private static final long serialVersionUID = -2830705374001675073L; + public SynchronizedPrintServiceAttributeSet (PrintServiceAttributeSet attributeSet) { super(attributeSet); --- old/src/share/classes/javax/print/attribute/UnmodifiableSetException.java 2014-02-09 21:09:31.000000000 -0800 +++ new/src/share/classes/javax/print/attribute/UnmodifiableSetException.java 2014-02-09 21:09:30.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ * @since 1.4 */ public class UnmodifiableSetException extends RuntimeException { + private static final long serialVersionUID = 2255250308571511731L; + /** * Constructs an UnsupportedOperationException with no detail message. */ From Alan.Bateman at oracle.com Mon Feb 10 09:16:57 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 10 Feb 2014 09:16:57 +0000 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8034050: Fix serial lint warnings in javax.print In-Reply-To: <52F85FD2.7070102@oracle.com> References: <52F85FD2.7070102@oracle.com> Message-ID: <52F89909.1050209@oracle.com> On 10/02/2014 05:12, Joe Darcy wrote: > Hello, > > Please review the proposed fix for > > JDK-8034050: Fix serial lint warnings in javax.print > http://cr.openjdk.java.net/~darcy/8034050.0/ > > I checked that the added serialVerionUID values match the serialver > computations for those types on JDK 6 and 8. This looks good to me. -Alan From anton.tarasov at oracle.com Mon Feb 10 14: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 jennifer.godinez at oracle.com Mon Feb 10 19:51:12 2014 From: jennifer.godinez at oracle.com (Jennifer Godinez) Date: Mon, 10 Feb 2014 11:51:12 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8034050: Fix serial lint warnings in javax.print In-Reply-To: <52F85FD2.7070102@oracle.com> References: <52F85FD2.7070102@oracle.com> Message-ID: <52F92DB0.3010601@oracle.com> Looks good. Approved. - Jennifer On 2/9/2014 9:12 PM, Joe Darcy wrote: > Hello, > > Please review the proposed fix for > > JDK-8034050: Fix serial lint warnings in javax.print > http://cr.openjdk.java.net/~darcy/8034050.0/ > > I checked that the added serialVerionUID values match the serialver > computations for those types on JDK 6 and 8. > > Thanks, > > -Joe > > --- old/src/share/classes/javax/print/DocFlavor.java 2014-02-09 > 21:09:29.000000000 -0800 > +++ new/src/share/classes/javax/print/DocFlavor.java 2014-02-09 > 21:09:29.000000000 -0800 > @@ -1045,6 +1045,7 @@ > * @author Alan Kaminsky > */ > public static class URL extends DocFlavor { > + private static final long serialVersionUID = > 2936725788144902062L; > > /** > * Constructs a new doc flavor with the given MIME type and a > print > --- old/src/share/classes/javax/print/PrintException.java 2014-02-09 > 21:09:30.000000000 -0800 > +++ new/src/share/classes/javax/print/PrintException.java 2014-02-09 > 21:09:29.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2000, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2000, 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,7 +33,7 @@ > * > */ > public class PrintException extends Exception { > - > + private static final long serialVersionUID = -5932531546705242471L; > > /** > * Construct a print exception with no detail message. > --- > old/src/share/classes/javax/print/attribute/AttributeSetUtilities.java > 2014-02-09 21:09:30.000000000 -0800 > +++ > new/src/share/classes/javax/print/attribute/AttributeSetUtilities.java > 2014-02-09 21:09:30.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2000, 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 > @@ -77,6 +77,7 @@ > */ > private static class UnmodifiableAttributeSet > implements AttributeSet, Serializable { > + private static final long serialVersionUID = > -6131802583863447813L; > > private AttributeSet attrset; > > @@ -147,6 +148,7 @@ > private static class UnmodifiableDocAttributeSet > extends UnmodifiableAttributeSet > implements DocAttributeSet, Serializable { > + private static final long serialVersionUID = > -6349408326066898956L; > > public UnmodifiableDocAttributeSet(DocAttributeSet > attributeSet) { > > @@ -161,6 +163,7 @@ > extends UnmodifiableAttributeSet > implements PrintRequestAttributeSet, Serializable > { > + private static final long serialVersionUID = > 7799373532614825073L; > public UnmodifiablePrintRequestAttributeSet > (PrintRequestAttributeSet attributeSet) { > > @@ -175,6 +178,7 @@ > extends UnmodifiableAttributeSet > implements PrintJobAttributeSet, Serializable > { > + private static final long serialVersionUID = > -8002245296274522112L; > public UnmodifiablePrintJobAttributeSet > (PrintJobAttributeSet attributeSet) { > > @@ -189,6 +193,7 @@ > extends UnmodifiableAttributeSet > implements PrintServiceAttributeSet, Serializable > { > + private static final long serialVersionUID = > -7112165137107826819L; > public UnmodifiablePrintServiceAttributeSet > (PrintServiceAttributeSet attributeSet) { > > @@ -291,6 +296,7 @@ > */ > private static class SynchronizedAttributeSet > implements AttributeSet, Serializable { > + private static final long serialVersionUID = > 8365731020128564925L; > > private AttributeSet attrset; > > @@ -357,6 +363,7 @@ > private static class SynchronizedDocAttributeSet > extends SynchronizedAttributeSet > implements DocAttributeSet, Serializable { > + private static final long serialVersionUID = > 6455869095246629354L; > > public SynchronizedDocAttributeSet(DocAttributeSet > attributeSet) { > super(attributeSet); > @@ -369,6 +376,7 @@ > private static class SynchronizedPrintRequestAttributeSet > extends SynchronizedAttributeSet > implements PrintRequestAttributeSet, Serializable { > + private static final long serialVersionUID = > 5671237023971169027L; > > public SynchronizedPrintRequestAttributeSet > (PrintRequestAttributeSet attributeSet) { > @@ -382,6 +390,7 @@ > private static class SynchronizedPrintJobAttributeSet > extends SynchronizedAttributeSet > implements PrintJobAttributeSet, Serializable { > + private static final long serialVersionUID = > 2117188707856965749L; > > public SynchronizedPrintJobAttributeSet > (PrintJobAttributeSet attributeSet) { > @@ -395,6 +404,8 @@ > private static class SynchronizedPrintServiceAttributeSet > extends SynchronizedAttributeSet > implements PrintServiceAttributeSet, Serializable { > + private static final long serialVersionUID = > -2830705374001675073L; > + > public SynchronizedPrintServiceAttributeSet > (PrintServiceAttributeSet attributeSet) { > super(attributeSet); > --- > old/src/share/classes/javax/print/attribute/UnmodifiableSetException.java > 2014-02-09 21:09:31.000000000 -0800 > +++ > new/src/share/classes/javax/print/attribute/UnmodifiableSetException.java > 2014-02-09 21:09:30.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2001, 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 @@ > * @since 1.4 > */ > public class UnmodifiableSetException extends RuntimeException { > + private static final long serialVersionUID = 2255250308571511731L; > + > /** > * Constructs an UnsupportedOperationException with no detail > message. > */ > From philip.race at oracle.com Mon Feb 10 20:28:49 2014 From: philip.race at oracle.com (Phil Race) Date: Mon, 10 Feb 2014 12:28:49 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8034050: Fix serial lint warnings in javax.print In-Reply-To: <52F89909.1050209@oracle.com> References: <52F85FD2.7070102@oracle.com> <52F89909.1050209@oracle.com> Message-ID: <52F93681.4060506@oracle.com> Ditto. -phil. On 2/10/2014 1:16 AM, Alan Bateman wrote: > On 10/02/2014 05:12, Joe Darcy wrote: >> Hello, >> >> Please review the proposed fix for >> >> JDK-8034050: Fix serial lint warnings in javax.print >> http://cr.openjdk.java.net/~darcy/8034050.0/ >> >> I checked that the added serialVerionUID values match the serialver >> computations for those types on JDK 6 and 8. > This looks good to me. > > -Alan From philip.race at oracle.com Mon Feb 10 20:31:48 2014 From: philip.race at oracle.com (Phil Race) Date: Mon, 10 Feb 2014 12:31:48 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8033624: Fix raw and unchecked lint warnings in sun.font In-Reply-To: <52F499B7.80102@oracle.com> References: <52F1EB28.8090002@oracle.com> <52F2098E.8060300@oracle.com> <52F4253F.6020706@oracle.com> <52F499B7.80102@oracle.com> Message-ID: <52F93734.2000200@oracle.com> OK, modulo the formatting I have no further comments. Some day we may revisit (some of) the code that was tricky to re-write .. -phil. On 2/7/2014 12:30 AM, Joe Darcy wrote: > Hello, > > On 02/06/2014 04:13 PM, Phil Race wrote: >> Comments/questions on the changes :- >> >> Font2D.java >> >> >> 108 protected Reference lastFontStrike = new >> SoftReference<>(null); >> ... >> >> >> 320 lastFontStrike = new SoftReference<>(strike); >> >> So the diamond operator can be used in this 2nd case ? Apparently so. > > Yes; I verified the modified code successfully compiled :-) > >> I vaguely remember that it used to only be able to infer the type in >> the first case ? >> Did it get updated or did I just not realise ?? > > In JDK 7, the compiler could often infer the right type for a diamond > in most contexts, but in JDK 8, the inference scheme is more powerful. > IIRC, the main difference is that in JDK 8 the compiler can do a > better job of inferring diamond when it occurs in a position like an > argument in a method call (where there is an interaction between the > inference of diamond and the overload resolution logic). > >> >> >> There are a few places including these :- >> ----- >> AttributeValues.java >> >> Map imStyles = hl.getStyle(); >> >> FontResolver.java >> >> >> 226 public Font getFont(int index, >> 227 Map> AttributedCharacterIterator.Attribute, ?> attributes) { >> >> ---- >> >> where its not obvious how you decided the type to use. > > In that particular case, I looked at the return type of the method > java.awt.Font.getAttributes(); I did the analogous looking in the > other case. > >> I know a lot of this code and that they look reasonable but I >> wouldn't have been confident >> that there weren't places where we allowed some wider type to be used >> in these maps. >> How did you decide on the types and how did you verify it ? > > The verification occurs by compiling the JDK; if there was a mismatch > the compiler would compile. (Since these are sun.* classes, they are > officially only supposed to be used inside the JDK.) > >> >> >>> @SuppressWarnings("unchecked") >> >> Can you show what thevarious warnings looked like and say why they >> needed to be suppressed rather than fixed ? > > In AttributeValues, the warning in the original code is: > > src/share/classes/sun/font/AttributeValues.java:822: warning: > [unchecked] unchecked cast > av = AttributeValues.fromMap((Map)map); > // yuck > ^ > required: Map > found: Map > where CAP#1,CAP#2 are fresh type-variables: > CAP#1 extends Object from capture of ? > CAP#2 extends Object from capture of ? > > The map value comes in as a parameter of type Map map and then > some runtime check verify it is an AttributeMap. This these two > unchecked casts are isolated, I didn't think it was worthwhile to try > to perform more extensive surgery to try to fix up the types. > >> Is it anywhere you found it to tricky/impossible to get rid of a cast ? > > Yes, largely where @SuppressWarning("unchecked") was used :-) One > example, in > > + @SuppressWarnings("unchecked") > HashMap ffmapCopy = > (HashMap)(fontToFileMap.clone()); > > the unchecked suppression is needed because the clone method in > HashMap is declared to return "Object" rather than "HashMap" > even though it does actually return a "HashMap". I looked into > changing this in collections, but there are subtle compatibility > issues that unfortunately argue for leaving these particular clone > methods as returning Object. > > There are a few occurrences of casting the result of cloning a > collection. > > The appContext mechanism is not fully generics friendly and needed > some casts and unchecked suppression. > > Some code in SunFontManager.java attempted to make generics and arrays > play together in an unnatural way and @SuppressWarning("unchecked") > was needed to keep the peace without attempting a larger rewrite. > >> >> FontScaler.java : >> >> Is the whole somewhat ugly re-writing of this so that you have a >> single expression >> to which to apply @SuppressWarnings ? > > Basically, but the situation is worse than usual since Class.forName > maps a String to a Class and I wanted only one cast to (Class extends FontScaler>) with a single @SuppressWarnings for that cast. > >> >> If you are going to do that anyway was it worth it ? Can't it just >> be applied >> to the static initialiser block ? > > The SuppressWarning declaration cannot be applied to the static > initializer block since the block is not the sort of declaration that > can host an annotation. > >> >> And at the very least there should be spaces before "?" and ":" to >> make it >> easier to read. > > Okay. > >> >> >> StrikeCache.java: >> >> Disposer.addReference((Reference)(Reference)this, disposer); >> >> Why does this look like a cast of an already cast variable ? Looks >> weird to me. > > The short answer is that a cast through a raw type, "Reference" in > this case, is sometimes necessary to convince the compiler you can do > something it doesn't think you should be able to do. The "this" value > has a type of Reference and that is not directly > convertible to Reference. (The Disposer is weirdly typed, > basically a type-hetrogenous container, and would have to be more > extensively revised to play well with generics.) > >> >> >> SunFontManager.java >> >> lines 2310-2314 look much > 80 chars. We keep all these files <=80 >> chars wide >> >> I find it tricky to catch all those in review but please be conscious >> of it. >> I suspect line 2644 in the same file is also too long.Also 3066, >> 3068, 3128, 3157.. >> please fix all of these and any others I may have overlooked in this >> or other files. > > Okay. > >> >> And don't forget - please re-generate against client, or ask me to >> push there for you. >> >> -phil. >> > > Thanks for the review, > > -Joe > From Sergey.Bylokhov at oracle.com Mon Feb 10 22:14:41 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 11 Feb 2014 02:14:41 +0400 Subject: [OpenJDK 2D-Dev] [PATCH] Re: JDK-8012351 In-Reply-To: <52F27A98.4010400@oracle.com> References: <52CB49CF.7050807@sd63.bc.ca> <52DEAFB1.2020907@sd63.bc.ca> <52F27A98.4010400@oracle.com> Message-ID: <52F94F51.3010700@oracle.com> Hi, Phil. - Should we catch situations, when the getParentFile will return null, and change 'return newDir.equals(existDir)' to 'return Objects.equals(newDir, existDir)'? - I suppose it was a typo ">=" in SunFontManager? Otherwise the fix looks good, but note that I'm not an expert in this area. On 05.02.2014 21:53, Phil Race wrote: > So that patch wasn't the right thing but as a result of off-list > discussion its become clearer how the problem might occur > I've updated https://bugs.openjdk.java.net/browse/JDK-8012351 > with the evaluation. > > And I think this is the right fix for it: > http://cr.openjdk.java.net/~prr/8012351/ > > Please review. > > Randy says it works for him. If anyone else is seeing this problem > it would be nice to know if this fixes it for them too - or not ! > I never reproduced the problem myself except by 'forcing' Ubuntu > Regular to be ignored in fontconfiguration. > > -phil. > > > > On 01/21/2014 09:34 AM, Ryan Tandy wrote: >> Dear JDK team, >> >> Further to my earlier message, please find attached the patch that I >> think solves JDK-8012351. I applied this change to the Ubuntu JDK7 >> package and made it available at the Launchpad bug for testing; so far >> one other user commented that it works for them. >> >> Can JDK-8012351 be re-opened and this change considered as part of a >> possible fix? >> > -- Best regards, Sergey. From philip.race at oracle.com Mon Feb 10 22:48:27 2014 From: philip.race at oracle.com (Phil Race) Date: Mon, 10 Feb 2014 14:48:27 -0800 Subject: [OpenJDK 2D-Dev] [PATCH] Re: JDK-8012351 In-Reply-To: <52F94F51.3010700@oracle.com> References: <52CB49CF.7050807@sd63.bc.ca> <52DEAFB1.2020907@sd63.bc.ca> <52F27A98.4010400@oracle.com> <52F94F51.3010700@oracle.com> Message-ID: <52F9573B.7060700@oracle.com> On 2/10/2014 2:14 PM, Sergey Bylokhov wrote: > Hi, Phil. > - Should we catch situations, when the getParentFile will return > null, and change 'return newDir.equals(existDir)' to 'return > Objects.equals(newDir, existDir)'? I can .. http://cr.openjdk.java.net/~prr/8012351.1/ although for this to be necessary "newFont" would have to be stored in the "/" directory which seems very unlikely > - I suppose it was a typo ">=" in SunFontManager? No, it was intended but overly cautious as it didn't give the FontFamily instance a chance to decide for itself. -phil. > > Otherwise the fix looks good, but note that I'm not an expert in this > area. > > On 05.02.2014 21:53, Phil Race wrote: >> So that patch wasn't the right thing but as a result of off-list >> discussion its become clearer how the problem might occur >> I've updated https://bugs.openjdk.java.net/browse/JDK-8012351 >> with the evaluation. >> >> And I think this is the right fix for it: >> http://cr.openjdk.java.net/~prr/8012351/ >> >> Please review. >> >> Randy says it works for him. If anyone else is seeing this problem >> it would be nice to know if this fixes it for them too - or not ! >> I never reproduced the problem myself except by 'forcing' Ubuntu >> Regular to be ignored in fontconfiguration. >> >> -phil. >> >> >> >> On 01/21/2014 09:34 AM, Ryan Tandy wrote: >>> Dear JDK team, >>> >>> Further to my earlier message, please find attached the patch that I >>> think solves JDK-8012351. I applied this change to the Ubuntu JDK7 >>> package and made it available at the Launchpad bug for testing; so far >>> one other user commented that it works for them. >>> >>> Can JDK-8012351 be re-opened and this change considered as part of a >>> possible fix? >>> >> > > From james.graham at oracle.com Mon Feb 10 23: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 Sergey.Bylokhov at oracle.com Tue Feb 11 00:02:09 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 11 Feb 2014 04:02:09 +0400 Subject: [OpenJDK 2D-Dev] [PATCH] Re: JDK-8012351 In-Reply-To: <52F9573B.7060700@oracle.com> References: <52CB49CF.7050807@sd63.bc.ca> <52DEAFB1.2020907@sd63.bc.ca> <52F27A98.4010400@oracle.com> <52F94F51.3010700@oracle.com> <52F9573B.7060700@oracle.com> Message-ID: <52F96881.3060507@oracle.com> Hi, Phil. The fix looks good. On 11.02.2014 2:48, Phil Race wrote: > On 2/10/2014 2:14 PM, Sergey Bylokhov wrote: >> Hi, Phil. >> - Should we catch situations, when the getParentFile will return >> null, and change 'return newDir.equals(existDir)' to 'return >> Objects.equals(newDir, existDir)'? > > I can .. http://cr.openjdk.java.net/~prr/8012351.1/ > although for this to be necessary "newFont" would have to > be stored in the "/" directory which seems very unlikely >> - I suppose it was a typo ">=" in SunFontManager? > > No, it was intended but overly cautious as it didn't give the FontFamily > instance a chance to decide for itself. > > -phil. > >> >> Otherwise the fix looks good, but note that I'm not an expert in >> this area. >> >> On 05.02.2014 21:53, Phil Race wrote: >>> So that patch wasn't the right thing but as a result of off-list >>> discussion its become clearer how the problem might occur >>> I've updated https://bugs.openjdk.java.net/browse/JDK-8012351 >>> with the evaluation. >>> >>> And I think this is the right fix for it: >>> http://cr.openjdk.java.net/~prr/8012351/ >>> >>> Please review. >>> >>> Randy says it works for him. If anyone else is seeing this problem >>> it would be nice to know if this fixes it for them too - or not ! >>> I never reproduced the problem myself except by 'forcing' Ubuntu >>> Regular to be ignored in fontconfiguration. >>> >>> -phil. >>> >>> >>> >>> On 01/21/2014 09:34 AM, Ryan Tandy wrote: >>>> Dear JDK team, >>>> >>>> Further to my earlier message, please find attached the patch that I >>>> think solves JDK-8012351. I applied this change to the Ubuntu JDK7 >>>> package and made it available at the Launchpad bug for testing; so far >>>> one other user commented that it works for them. >>>> >>>> Can JDK-8012351 be re-opened and this change considered as part of a >>>> possible fix? >>>> >>> >> >> > -- Best regards, Sergey. From james.graham at oracle.com Tue Feb 11 00: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 andrew.brygin at oracle.com Tue Feb 11 11:09:29 2014 From: andrew.brygin at oracle.com (Andrew Brygin) Date: Tue, 11 Feb 2014 15:09:29 +0400 Subject: [OpenJDK 2D-Dev] [PATCH] Re: JDK-8012351 In-Reply-To: <52F9573B.7060700@oracle.com> References: <52CB49CF.7050807@sd63.bc.ca> <52DEAFB1.2020907@sd63.bc.ca> <52F27A98.4010400@oracle.com> <52F94F51.3010700@oracle.com> <52F9573B.7060700@oracle.com> Message-ID: <52FA04E9.90907@oracle.com> Hello Phil, the fix looks fine to me. Thanks, Andrew On 2/11/2014 2:48 AM, Phil Race wrote: > On 2/10/2014 2:14 PM, Sergey Bylokhov wrote: >> Hi, Phil. >> - Should we catch situations, when the getParentFile will return >> null, and change 'return newDir.equals(existDir)' to 'return >> Objects.equals(newDir, existDir)'? > > I can .. http://cr.openjdk.java.net/~prr/8012351.1/ > although for this to be necessary "newFont" would have to > be stored in the "/" directory which seems very unlikely >> - I suppose it was a typo ">=" in SunFontManager? > > No, it was intended but overly cautious as it didn't give the FontFamily > instance a chance to decide for itself. > > -phil. > >> >> Otherwise the fix looks good, but note that I'm not an expert in >> this area. >> >> On 05.02.2014 21:53, Phil Race wrote: >>> So that patch wasn't the right thing but as a result of off-list >>> discussion its become clearer how the problem might occur >>> I've updated https://bugs.openjdk.java.net/browse/JDK-8012351 >>> with the evaluation. >>> >>> And I think this is the right fix for it: >>> http://cr.openjdk.java.net/~prr/8012351/ >>> >>> Please review. >>> >>> Randy says it works for him. If anyone else is seeing this problem >>> it would be nice to know if this fixes it for them too - or not ! >>> I never reproduced the problem myself except by 'forcing' Ubuntu >>> Regular to be ignored in fontconfiguration. >>> >>> -phil. >>> >>> >>> >>> On 01/21/2014 09:34 AM, Ryan Tandy wrote: >>>> Dear JDK team, >>>> >>>> Further to my earlier message, please find attached the patch that I >>>> think solves JDK-8012351. I applied this change to the Ubuntu JDK7 >>>> package and made it available at the Launchpad bug for testing; so far >>>> one other user commented that it works for them. >>>> >>>> Can JDK-8012351 be re-opened and this change considered as part of a >>>> possible fix? >>>> >>> >> >> > From anton.tarasov at oracle.com Tue Feb 11 18: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 19: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 philip.race at oracle.com Tue Feb 11 20:36:27 2014 From: philip.race at oracle.com (Phil Race) Date: Tue, 11 Feb 2014 12:36:27 -0800 Subject: [OpenJDK 2D-Dev] RFR : 8034227: JDK9 Windows build failure in libdcpr Message-ID: <52FA89CB.4080809@oracle.com> The closed source library dcpr (ductus) needs to reference a JNU function So an update is needed to a build file : This needs a quick review as I (ahem) pushed the closed part but not this ... not of relevance to open source users but on windows the closed sources won't build without this change. Other platforms don't need this since it seems they all get this lib anyway -phil. diff -r 5ff0d5f1a97f make/lib/Awt2dLibraries.gmk --- a/make/lib/Awt2dLibraries.gmk Tue Feb 11 10:43:15 2014 -0800 +++ b/make/lib/Awt2dLibraries.gmk Tue Feb 11 12:27:51 2014 -0800 @@ -1316,6 +1316,7 @@ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB), \ LDFLAGS_SUFFIX_posix := -lm, \ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ From jennifer.godinez at oracle.com Tue Feb 11 20:35:20 2014 From: jennifer.godinez at oracle.com (Jennifer Godinez) Date: Tue, 11 Feb 2014 12:35:20 -0800 Subject: [OpenJDK 2D-Dev] RFR : 8034227: JDK9 Windows build failure in libdcpr In-Reply-To: <52FA89CB.4080809@oracle.com> References: <52FA89CB.4080809@oracle.com> Message-ID: <52FA8988.7070900@oracle.com> Looks good. - Jennifer On 02/11/2014 12:36 PM, Phil Race wrote: > The closed source library dcpr (ductus) needs to reference a JNU function > So an update is needed to a build file : > > This needs a quick review as I (ahem) pushed the closed part but > not this ... not of relevance to open source users but on windows > the closed sources won't build without this change. > Other platforms don't need this since it seems they all get this lib > anyway > > -phil. > > diff -r 5ff0d5f1a97f make/lib/Awt2dLibraries.gmk > --- a/make/lib/Awt2dLibraries.gmk Tue Feb 11 10:43:15 2014 -0800 > +++ b/make/lib/Awt2dLibraries.gmk Tue Feb 11 12:27:51 2014 -0800 > @@ -1316,6 +1316,7 @@ > LDFLAGS := $(LDFLAGS_JDKLIB) \ > $(call SET_SHARED_LIBRARY_ORIGIN), \ > LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \ > + LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB), \ > LDFLAGS_SUFFIX_posix := -lm, \ > VERSIONINFO_RESOURCE := > $(JDK_TOPDIR)/src/windows/resource/version.rc, \ > RC_FLAGS := $(RC_FLAGS) \ From alexandr.scherbatiy at oracle.com Wed Feb 12 13:59:26 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 12 Feb 2014 17:59:26 +0400 Subject: [OpenJDK 2D-Dev] [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 james.graham at oracle.com Thu Feb 13 00:42:20 2014 From: james.graham at oracle.com (Jim Graham) Date: Wed, 12 Feb 2014 16:42:20 -0800 Subject: [OpenJDK 2D-Dev] [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 suenaga.yasumasa at lab.ntt.co.jp Thu Feb 13 07:38:34 2014 From: suenaga.yasumasa at lab.ntt.co.jp (Yasumasa Suenaga) Date: Thu, 13 Feb 2014 16:38:34 +0900 Subject: [OpenJDK 2D-Dev] JDK-8017773: OpenJDK7 returns incorrect TrueType font metrics In-Reply-To: <52EF333C.2030208@lab.ntt.co.jp> References: <52EF333C.2030208@lab.ntt.co.jp> Message-ID: <52FC767A.8070805@lab.ntt.co.jp> Hi all, I've reported about JDK-8017773 . Have you checked it ? I guess that many Linux distributor will ship OpenJDK8 after JDK8 GA is released. If this issue will not fix at JDK8 GA, many users who use 2D on JDK8 may encounter it. This issue occurs in OpenJDK only. However, I think there are many users who want to use 2D on OpenJDK. So I hope to fix this issue ASAP and hope to backport to JDK7. Please cooperate. Yasumasa On 2014/02/03 15:12, Yasumasa Suenaga wrote: > Hi all, > > My customer encountered this issue. > I think this issue is caused by Bug 1435 [1] and 1659 [2] in IcedTea. > > I read source code of "freetype-2.5.0-4.fc20" . > Bold style should affect Font Glyph only. However, current implementation > of OpenJDK affects Font Face. Thus value of Ascent/Descent is incorrect. > > OracleJDK seems to use sun.font.T2KFontScaler to calculate these values. > So this issue occurs in OpenJDK only. > > > I think we need to merge patches of Bug 1435 and 1659 in IcedTea > to fix JDK-8017773 . > > Could you merge these patches ? > Please cooperate. > > > Thanks, > > Yasumasa > > > [1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1435 > [2] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1659 > > > ------ D E T A I L S ------ > > I've created testcase as "JavaApplication1.java" . > Result as: > > OracleJDK 6 Update 31 > ---------------- > [root at RHEL6-5 font]# /usr/local/jdk1.6.0_31/bin/java JavaApplication1 > JDK: 1.6.0_31 > VM: Java HotSpot(TM) 64-Bit Server VM > > java.awt.Font[family=IPAMincho,name=IPAMincho,style=plain,size=50] > Ascent: 43.99414 > Descent: 6.0058594 > > java.awt.Font[family=IPAMincho,name=IPAMincho,style=bold,size=50] > Ascent: 43.99414 > Descent: 6.0058594 > ---------------- > > OpenJDK7 (in RHEL6.5) > ---------------- > [root at RHEL6-5 font]# java JavaApplication1 > JDK: 1.7.0_45 > VM: OpenJDK 64-Bit Server VM > > java.awt.Font[family=IPAMincho,name=IPAMincho,style=plain,size=50] > Ascent: 43.99414 > Descent: 6.0058594 > > java.awt.Font[family=IPAMincho,name=IPAMincho,style=bold,size=50] > Ascent: 45.60547 > Descent: 4.3945312 > ---------------- From anton.tarasov at oracle.com Thu Feb 13 13: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 james.graham at oracle.com Thu Feb 13 22: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 anton.tarasov at oracle.com Fri Feb 14 07: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 james.graham at oracle.com Sat Feb 15 01: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 henry.jen at oracle.com Sat Feb 15 01:05:06 2014 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 14 Feb 2014 17:05:06 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52F579E2.6020209@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> Message-ID: <52FEBD42.3040406@oracle.com> As there is no other comments so far, I posted updated version adapted comments from Phil. - removed public field comments from BMPMetadata - removed not needed comments from GIFImageMetadata http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/ Cheers, Henry On 02/07/2014 04:27 PM, Henry Jen wrote: > On 02/07/2014 03:00 PM, Phil Race wrote: >> BMPMetadata.java >> >> >> 94 // Fields from CommentExtension >> 95 // List of byte[] >> 96 public List comments = null; // new ArrayList(); >> >> hmm .. how did you decide this was correct, other than trusting the >> comment? > > For this one, I took it from the comment, after verified similar types > in GIF. > >> >> The thing is I can't actually see where this field is used and I'm >> inclined >> to think this was a copy/paste from the GIF code. >> >> It would seem the right thing to do is delete these lines. >> > > It is public, so I don't dare to remove it, although it seems like > nothing in com.sun.imageio ever make use of this field. > > Also, from the BMPMetadataFormat, CommentExtension is a string type, so > I am not really sure what's the best to do here. > > If you think it is safe to remove it, I am more than happy to remove it. > > >> In the case of GIFImageMetadata they are used but you left the comments >> saying >> >> // new ArrayList(); >> >> since it looks like you use the diamond operator now that should >> not be completely true. Either remove the comment or, since it >> seems it was intended to be informative update it to say >> // new ArrayList<>(); >> > > Agree, I'll remove those comments. > >> I will have to look at all the subsequent files later .. >> > > Thanks for reviewing it. > > Cheers, > Henry From henry.jen at oracle.com Sat Feb 15 02:43:54 2014 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 14 Feb 2014 18:43:54 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8034998: Fix raw and unchecked lint warnings in javax.imageio Message-ID: <52FED46A.3040501@oracle.com> Hi, Please review the webrev to clean up raw and unchecked warnings in javax.imageio packag at, http://cr.openjdk.java.net/~henryjen/jdk9/8034998/0/webrev/ The webrev does not cover javax.imageio.spi, that will come in anoter webrev. Cheers, Henry From mikael.vidstedt at oracle.com Sat Feb 15 01:54:15 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Fri, 14 Feb 2014 17:54:15 -0800 Subject: [OpenJDK 2D-Dev] 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 philip.race at oracle.com Sat Feb 15 17:31:27 2014 From: philip.race at oracle.com (Phil Race) Date: Sat, 15 Feb 2014 09:31:27 -0800 Subject: [OpenJDK 2D-Dev] 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 mikael.vidstedt at oracle.com Sat Feb 15 16:37:39 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Sat, 15 Feb 2014 08:37:39 -0800 Subject: [OpenJDK 2D-Dev] 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 joe.darcy at oracle.com Sat Feb 15 21:15:01 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Sat, 15 Feb 2014 13:15:01 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8034998: Fix raw and unchecked lint warnings in javax.imageio In-Reply-To: <52FED46A.3040501@oracle.com> References: <52FED46A.3040501@oracle.com> Message-ID: <52FFD8D5.1010701@oracle.com> On 02/14/2014 06:43 PM, Henry Jen wrote: > Hi, > > Please review the webrev to clean up raw and unchecked warnings in > javax.imageio packag at, > > http://cr.openjdk.java.net/~henryjen/jdk9/8034998/0/webrev/ > > The webrev does not cover javax.imageio.spi, that will come in anoter > webrev. > > Cheers, > Henry Hi Henry, I skimmed over the changeset and didn't see any issues. All the signature changes to methods seem to be on private methods or on public methods in package-private classes. If there are any change to public or protected methods in public or protected classes, whose would need a ccc request. Thanks, -Joe From henry.jen at oracle.com Sun Feb 16 02:16:09 2014 From: henry.jen at oracle.com (Henry Jen) Date: Sat, 15 Feb 2014 18:16:09 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8034998: Fix raw and unchecked lint warnings in javax.imageio In-Reply-To: <52FFD8D5.1010701@oracle.com> References: <52FED46A.3040501@oracle.com> <52FFD8D5.1010701@oracle.com> Message-ID: <53001F69.1080709@oracle.com> On 02/15/2014 01:15 PM, Joe Darcy wrote: > On 02/14/2014 06:43 PM, Henry Jen wrote: >> Hi, >> >> Please review the webrev to clean up raw and unchecked warnings in >> javax.imageio packag at, >> >> http://cr.openjdk.java.net/~henryjen/jdk9/8034998/0/webrev/ >> >> The webrev does not cover javax.imageio.spi, that will come in anoter >> webrev. >> >> Cheers, >> Henry > > Hi Henry, > > I skimmed over the changeset and didn't see any issues. > > All the signature changes to methods seem to be on private methods or on > public methods in package-private classes. If there are any change to > public or protected methods in public or protected classes, whose would > need a ccc request. > Thanks, as far as I know, all changes to public/protected fields/methods are within private classes, but don't trust me, that's the point of code review. It seems to me, there was a round of generic type clean up for public APIs, only methods in two classes(javax.imageio.spi.Image[Reader|Writer].spi) returning Class[], which I am wondering why they are not Class[] that I would like to file CCC with javax.imageio.spi package clean up. Cheers, Henry From anton.tarasov at oracle.com Mon Feb 17 14: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 Tue Feb 18 15:33:17 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Tue, 18 Feb 2014 19:33:17 +0400 Subject: [OpenJDK 2D-Dev] [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 Sergey.Bylokhov at oracle.com Tue Feb 18 17:34:39 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 18 Feb 2014 21:34:39 +0400 Subject: [OpenJDK 2D-Dev] 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 17:48:24 2014 From: omajid at redhat.com (Omair Majid) Date: Tue, 18 Feb 2014 12:48:24 -0500 Subject: [OpenJDK 2D-Dev] 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 philip.race at oracle.com Wed Feb 19 01:37:08 2014 From: philip.race at oracle.com (Phil Race) Date: Tue, 18 Feb 2014 17:37:08 -0800 Subject: [OpenJDK 2D-Dev] 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 Wed Feb 19 01:30:01 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Tue, 18 Feb 2014 17:30:01 -0800 Subject: [OpenJDK 2D-Dev] 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 mikael.vidstedt at oracle.com Wed Feb 19 01:57:18 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Tue, 18 Feb 2014 17:57:18 -0800 Subject: [OpenJDK 2D-Dev] 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 philip.race at oracle.com Wed Feb 19 21:12:30 2014 From: philip.race at oracle.com (Phil Race) Date: Wed, 19 Feb 2014 13:12:30 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8034998: Fix raw and unchecked lint warnings in javax.imageio In-Reply-To: <52FED46A.3040501@oracle.com> References: <52FED46A.3040501@oracle.com> Message-ID: <53051E3E.50808@oracle.com> ImageIO.java 515 public Iterator iter; 829 public Iterator iter; I can't see why these are public. I think they should be private Since you are touching these lines anyway public->private I was on the look out for changes to public interfaces but I didn't see any so that's Ok So if you can 1) make the two changes 2) re-generate against the client forest then it should be ready for approval. -phil. On 2/14/2014 6:43 PM, Henry Jen wrote: > Hi, > > Please review the webrev to clean up raw and unchecked warnings in > javax.imageio packag at, > > http://cr.openjdk.java.net/~henryjen/jdk9/8034998/0/webrev/ > > The webrev does not cover javax.imageio.spi, that will come in anoter > webrev. > > Cheers, > Henry From philip.race at oracle.com Wed Feb 19 21:46:15 2014 From: philip.race at oracle.com (Phil Race) Date: Wed, 19 Feb 2014 13:46:15 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <52FEBD42.3040406@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> Message-ID: <53052627.3060307@oracle.com> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java.sdiff.html 230 public Iterator getImageTypes(int imageIndex) throws IIOException { Nitpicky perhaps, but this looks > 80 chars. If so please split it. ----- W.r.t the following change ... http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html 145 class Htable implements Cloneable { ... <208 protected Object clone() { > 208 protected Htable clone() --------- exactly what warning is this suppressing ? Granted the language now allows returning a sub-class in over-riding, but I don't know why its a problem to return the declared type of the over-ridden method? The tool must have special knowledge of the semantics of the Cloneable interface to even call this out ! Same comment/question applies to DQTMarkerSegment.clone, JFIFMarkerSegment.clone() and any other like that you might have changed .. inc. the superclassMarkerSegment which I just spotted ... plus SOFMarkerSegment,S SOMarkerSegment Maybe these will be OK but I need an explanation. for (Iterator iter = extSegments.iterator(); iter.hasNext();) {232 for (Iterator iter = extSegments.iterator(); iter.hasNext();) { 635 for (Iterator iter = extSegments.iterator(); iter.hasNext();) More very long lines ... I see yet more in JPEGMetadata : 663, 573, 688, 698, 710 .. too many more to call out ! Finally, again note this change when approved should go into jdk9/client. -phil. On 2/14/2014 5:05 PM, Henry Jen wrote: > As there is no other comments so far, I posted updated version adapted > comments from Phil. > > - removed public field comments from BMPMetadata > - removed not needed comments from GIFImageMetadata > > http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/ > > Cheers, > Henry > > > On 02/07/2014 04:27 PM, Henry Jen wrote: >> On 02/07/2014 03:00 PM, Phil Race wrote: >>> BMPMetadata.java >>> >>> >>> 94 // Fields from CommentExtension >>> 95 // List of byte[] >>> 96 public List comments = null; // new ArrayList(); >>> >>> hmm .. how did you decide this was correct, other than trusting the >>> comment? >> >> For this one, I took it from the comment, after verified similar types >> in GIF. >> >>> >>> The thing is I can't actually see where this field is used and I'm >>> inclined >>> to think this was a copy/paste from the GIF code. >>> >>> It would seem the right thing to do is delete these lines. >>> >> >> It is public, so I don't dare to remove it, although it seems like >> nothing in com.sun.imageio ever make use of this field. >> >> Also, from the BMPMetadataFormat, CommentExtension is a string type, so >> I am not really sure what's the best to do here. >> >> If you think it is safe to remove it, I am more than happy to remove it. >> >> >>> In the case of GIFImageMetadata they are used but you left the comments >>> saying >>> >>> // new ArrayList(); >>> >>> since it looks like you use the diamond operator now that should >>> not be completely true. Either remove the comment or, since it >>> seems it was intended to be informative update it to say >>> // new ArrayList<>(); >>> >> >> Agree, I'll remove those comments. >> >>> I will have to look at all the subsequent files later .. >>> >> >> Thanks for reviewing it. >> >> Cheers, >> Henry From henry.jen at oracle.com Wed Feb 19 22:59:46 2014 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 19 Feb 2014 14:59:46 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <53052627.3060307@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> <53052627.3060307@oracle.com> Message-ID: <53053762.6080800@oracle.com> On 02/19/2014 01:46 PM, Phil Race wrote: > . > http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java.sdiff.html > > > 230 public Iterator getImageTypes(int > imageIndex) throws IIOException { > > Nitpicky perhaps, but this looks > 80 chars. If so please split it. > > Will do a round to split lone lines to keep them under 80. > ----- > > W.r.t the following change ... > > http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html > > > > 145 class Htable implements Cloneable { > > ... > <208 protected Object clone() { > >> 208 protected Htable clone() > > --------- > > exactly what warning is this suppressing ? This eliminate "unchecked" cast warning when calling this method to get an instance with correct class type. > > Granted the language now allows returning a sub-class in over-riding, > but I don't > know why its a problem to return the declared type of the over-ridden > method? > The tool must have special knowledge of the semantics of the Cloneable > interface > to even call this out ! > > Same comment/question applies to DQTMarkerSegment.clone, > > JFIFMarkerSegment.clone() and any other like that you might have changed .. > inc. the superclassMarkerSegment which I just spotted ... plus > SOFMarkerSegment,S > SOMarkerSegment > > Maybe these will be OK but I need an explanation. > > for (Iterator iter = > extSegments.iterator(); iter.hasNext();) {232 for > (Iterator iter = extSegments.iterator(); > iter.hasNext();) { > > 635 for (Iterator iter = > extSegments.iterator(); iter.hasNext();) > > More very long lines ... > > > I see yet more in JPEGMetadata : 663, 573, 688, 698, 710 .. too many > more to call out ! > I will change those if we wanted to stick to 80 column limit. I seems to see it loosed to 132 column in many places. Personally I stick to 80 but tolerate to 100 when I feel it's more readable. > Finally, again note this change when approved should go into jdk9/client. > I'll rebase the patch. Cheers, Henry From henry.jen at oracle.com Thu Feb 20 08:05:54 2014 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 20 Feb 2014 00:05:54 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <53053762.6080800@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> <53052627.3060307@oracle.com> <53053762.6080800@oracle.com> Message-ID: <5305B762.3080103@oracle.com> On 02/19/2014 02:59 PM, Henry Jen wrote: > On 02/19/2014 01:46 PM, Phil Race wrote: >> >> W.r.t the following change ... >> >> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html >> >> >> >> >> 145 class Htable implements Cloneable { >> >> ... >> <208 protected Object clone() { >> >>> 208 protected Htable clone() >> >> --------- >> >> exactly what warning is this suppressing ? > > This eliminate "unchecked" cast warning when calling this method to get > an instance with correct class type. > That's not exactly correct, it just eliminate the need to cast, not warning. Would you advice to revert them or keep it? Also, I noted there are a couple fallthrough warnings, the BMPImageReader one seems valid and should be fixed while the others looks correct, but I am not exactly sure about the image format, so I think I'll just list it here and perhaps someone with expertise can review them? /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java:916: warning: [fallthrough] possible fall-through into case case VERSION_4_8_BIT: ^ /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java:429: warning: [fallthrough] possible fall-through into case case 0: // not a marker, just a data 0xff ^ /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java:1554: warning: [fallthrough] possible fall-through into case case ColorSpace.TYPE_CMYK: ^ /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java:1593: warning: [fallthrough] possible fall-through into case case ColorSpace.TYPE_CMYK: ^ /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java:1639: warning: [fallthrough] possible fall-through into case case ColorSpace.TYPE_CMYK: Cheers, Henry From andrew.brygin at oracle.com Thu Feb 20 10:18:41 2014 From: andrew.brygin at oracle.com (Andrew Brygin) Date: Thu, 20 Feb 2014 14:18:41 +0400 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <5305B762.3080103@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> <53052627.3060307@oracle.com> <53053762.6080800@oracle.com> <5305B762.3080103@oracle.com> Message-ID: <5305D681.8020709@oracle.com> Hello Henry, please see my comments regrading the fallthrough warnings inline. On 2/20/2014 12:05 PM, Henry Jen wrote: > On 02/19/2014 02:59 PM, Henry Jen wrote: >> On 02/19/2014 01:46 PM, Phil Race wrote: >>> >>> W.r.t the following change ... >>> >>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html >>> >>> >>> >>> >>> >>> 145 class Htable implements Cloneable { >>> >>> ... >>> <208 protected Object clone() { >>> >>>> 208 protected Htable clone() >>> >>> --------- >>> >>> exactly what warning is this suppressing ? >> >> This eliminate "unchecked" cast warning when calling this method to get >> an instance with correct class type. >> > > That's not exactly correct, it just eliminate the need to cast, not > warning. > > Would you advice to revert them or keep it? > > Also, I noted there are a couple fallthrough warnings, the > BMPImageReader one seems valid and should be fixed while the others > looks correct, but I am not exactly sure about the image format, so I > think I'll just list it here and perhaps someone with expertise can > review them? > > /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java:916: > warning: [fallthrough] possible fall-through into case > case VERSION_4_8_BIT: > ^ This warning needs to be fixed: the case VERSION_4_4_BIT does not have the break operator. > /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java:429: > warning: [fallthrough] possible fall-through into case > case 0: // not a marker, just a data 0xff > ^ This case is correct, the warning probably should be suppressed. > /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java:1554: > warning: [fallthrough] possible fall-through into case > case ColorSpace.TYPE_CMYK: > ^ This warning needs to be fixed: the case ColorSpace.TYPE_3CLR missed the break operator. > /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java:1593: > warning: [fallthrough] possible fall-through into case > case ColorSpace.TYPE_CMYK: > ^ This warning needs to be fixed: the case ColorSpace.TYPE_3CLR missed the break operator. > > /home/hjen/ws/9-client/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java:1639: > warning: [fallthrough] possible fall-through into case > case ColorSpace.TYPE_CMYK: This warning needs to be fixed: the case ColorSpace.TYPE_3CLR missed the break operator. Thanks, Andrew > > Cheers, > Henry From philip.race at oracle.com Thu Feb 20 18:09:30 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 20 Feb 2014 10:09:30 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <5305B762.3080103@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> <53052627.3060307@oracle.com> <53053762.6080800@oracle.com> <5305B762.3080103@oracle.com> Message-ID: <530644DA.2040209@oracle.com> On 2/20/2014 12:05 AM, Henry Jen wrote: > On 02/19/2014 02:59 PM, Henry Jen wrote: >> On 02/19/2014 01:46 PM, Phil Race wrote: >>> >>> W.r.t the following change ... >>> >>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html >>> >>> >>> >>> >>> >>> 145 class Htable implements Cloneable { >>> >>> ... >>> <208 protected Object clone() { >>> >>>> 208 protected Htable clone() >>> >>> --------- >>> >>> exactly what warning is this suppressing ? >> >> This eliminate "unchecked" cast warning when calling this method to get >> an instance with correct class type. >> > > That's not exactly correct, it just eliminate the need to cast, not > warning. > > Would you advice to revert them or keep it? In that case, I'd suggest to revert them -phil. From henry.jen at oracle.com Thu Feb 20 21:01:09 2014 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 20 Feb 2014 13:01:09 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR[2]: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <530644DA.2040209@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> <53052627.3060307@oracle.com> <53053762.6080800@oracle.com> <5305B762.3080103@oracle.com> <530644DA.2040209@oracle.com> Message-ID: <53066D15.80302@oracle.com> Hi, Please review the latest update, I think this should address the issues raised, http://cr.openjdk.java.net/~henryjen/jdk9/8033716/2/webrev/ - revert the clone method changes so that return type remains Object - break long lines - fix fallthrough warnings as Andrew suggested. Cheers, Henry On 02/20/2014 10:09 AM, Phil Race wrote: > On 2/20/2014 12:05 AM, Henry Jen wrote: >> On 02/19/2014 02:59 PM, Henry Jen wrote: >>> On 02/19/2014 01:46 PM, Phil Race wrote: >>>> >>>> W.r.t the following change ... >>>> >>>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html >>>> >>>> >>>> >>>> >>>> >>>> 145 class Htable implements Cloneable { >>>> >>>> ... >>>> <208 protected Object clone() { >>>> >>>>> 208 protected Htable clone() >>>> >>>> --------- >>>> >>>> exactly what warning is this suppressing ? >>> >>> This eliminate "unchecked" cast warning when calling this method to get >>> an instance with correct class type. >>> >> >> That's not exactly correct, it just eliminate the need to cast, not >> warning. >> >> Would you advice to revert them or keep it? > > In that case, I'd suggest to revert them > > -phil. From omajid at redhat.com Thu Feb 20 22:40:45 2014 From: omajid at redhat.com (Omair Majid) Date: Thu, 20 Feb 2014 17:40:45 -0500 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 Message-ID: <20140220224044.GB20217@redhat.com> Hi, The following is a preliminary webrev that allows OpenJDK to build and run against a system-installed copy of lcms2 rather than the copy bundled with OpenJDK: root: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00/ jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00-jdk/ The goal is to add a new option `--with-lcms=` with possible values `bundled` or `system`. Using `--with-lcms=system` builds using the system-installed copy of lcms2 while `--with-lcms=bundled` builds with the bundled copy of lcms2 in OpenJDK. This patch is quite a bit more invasive than the libpng one [1]. There are a few issues that came up: 1. The sources for the bundled library are contained next to OpenJDK-specific sources. This is not true for the bundled copies of zlib, libpng and giflib. On the other hand, the jpeg code in OpenJDK also mixes OpenJDK-specific code with bundled libjpeg code. To make it easier to see (and compile) only non-lcms2 code, I moved the lcms2-specific code into a separate directory. There are no code changes there. 2. The library name. The current library name for the combined library containing lcms and OpenJDK code (that goes under jre/lib/$(ARCH)/) is currently `liblcms.so` (on my Linux platform). When linked against the system library, this new `liblcms.so` links to the system-wide `liblcms2.so`. This looks a little bizarre. I am also afraid of some distribution packaging the upstream lcms2 as `liblcms.so` which would cause a name conflict. Following the convention of `libj2gss.so`, I renamed it to `libj2lcms.so`. I made changes which made sense to me, but I am not sure how this fits in with existing conventions. Perhaps people here have suggestions on how to make this less invasive and still achieve the goal while keep things separate and distinct? Thanks, Omair [1] http://mail.openjdk.java.net/pipermail/build-dev/2014-February/011717.html -- 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 22: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 henry.jen at oracle.com Thu Feb 20 23:33:34 2014 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 20 Feb 2014 15:33:34 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8034998: Fix raw and unchecked lint warnings in javax.imageio In-Reply-To: <53051E3E.50808@oracle.com> References: <52FED46A.3040501@oracle.com> <53051E3E.50808@oracle.com> Message-ID: <530690CE.6060006@oracle.com> Updated webrev at http://cr.openjdk.java.net/~henryjen/jdk9/8034998/1/webrev/ - change those two Iterator from public to private - rebase to jdk9/client Who will be pushing those changes once approved? Cheers, Henry On 02/19/2014 01:12 PM, Phil Race wrote: > ImageIO.java > > 515 public Iterator iter; > > > 829 public Iterator iter; > > I can't see why these are public. I think they should be private > Since you are touching these lines anyway public->private > > I was on the look out for changes to public interfaces but I > didn't see any so that's Ok > > So if you can > 1) make the two changes > 2) re-generate against the client forest > > then it should be ready for approval. > > -phil. > > On 2/14/2014 6:43 PM, Henry Jen wrote: >> Hi, >> >> Please review the webrev to clean up raw and unchecked warnings in >> javax.imageio packag at, >> >> http://cr.openjdk.java.net/~henryjen/jdk9/8034998/0/webrev/ >> >> The webrev does not cover javax.imageio.spi, that will come in anoter >> webrev. >> >> Cheers, >> Henry > From philip.race at oracle.com Thu Feb 20 23:51:26 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 20 Feb 2014 15:51:26 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8034998: Fix raw and unchecked lint warnings in javax.imageio In-Reply-To: <530690CE.6060006@oracle.com> References: <52FED46A.3040501@oracle.com> <53051E3E.50808@oracle.com> <530690CE.6060006@oracle.com> Message-ID: <530694FE.5080201@oracle.com> Re-checked only the changed part. Looks good. Do you have two reviewers yet? I can push this if you like but you have commit rights so you can push yourself if you so wish .. -phil. On 2/20/2014 3:33 PM, Henry Jen wrote: > Updated webrev at > > http://cr.openjdk.java.net/~henryjen/jdk9/8034998/1/webrev/ > > - change those two Iterator from public to private > - rebase to jdk9/client > > Who will be pushing those changes once approved? > > Cheers, > Henry > > > On 02/19/2014 01:12 PM, Phil Race wrote: >> ImageIO.java >> >> 515 public Iterator iter; >> >> >> 829 public Iterator iter; >> >> I can't see why these are public. I think they should be private >> Since you are touching these lines anyway public->private >> >> I was on the look out for changes to public interfaces but I >> didn't see any so that's Ok >> >> So if you can >> 1) make the two changes >> 2) re-generate against the client forest >> >> then it should be ready for approval. >> >> -phil. >> >> On 2/14/2014 6:43 PM, Henry Jen wrote: >>> Hi, >>> >>> Please review the webrev to clean up raw and unchecked warnings in >>> javax.imageio packag at, >>> >>> http://cr.openjdk.java.net/~henryjen/jdk9/8034998/0/webrev/ >>> >>> The webrev does not cover javax.imageio.spi, that will come in anoter >>> webrev. >>> >>> Cheers, >>> Henry >> From henry.jen at oracle.com Fri Feb 21 00:20:15 2014 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 20 Feb 2014 16:20:15 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8034998: Fix raw and unchecked lint warnings in javax.imageio In-Reply-To: <530694FE.5080201@oracle.com> References: <52FED46A.3040501@oracle.com> <53051E3E.50808@oracle.com> <530690CE.6060006@oracle.com> <530694FE.5080201@oracle.com> Message-ID: <53069BBF.9050005@oracle.com> On 02/20/2014 03:51 PM, Phil Race wrote: > Re-checked only the changed part. > Looks good. Do you have two reviewers yet? > Thanks for reviewing, Phil. Joe Darcy reviewed the first version, and I listed both you and Joe as reviewer. > I can push this if you like but you have commit rights so you can push > yourself if you so wish .. > Either would work, I don't know what's the standard practice for client repo though. I learned hotspot requires to push via jprt the hard way. So, why don't you push for me on this one, and let me know what's the correct process and I can do the right thing in the future. Cheers, Henry From henry.jen at oracle.com Fri Feb 21 06:01:45 2014 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 20 Feb 2014 22:01:45 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8035487: Fix raw and unchecked lint warnings in javax.imageio.spi Message-ID: <5306EBC9.5080002@oracle.com> Hi, Please review the webrev to clean up raw and unchecked warnings in javax.imageio.spi packag at, http://cr.openjdk.java.net/~henryjen/jdk9/8035487/0/webrev/ Cheers, Henry From andrew.brygin at oracle.com Fri Feb 21 07:48:52 2014 From: andrew.brygin at oracle.com (Andrew Brygin) Date: Fri, 21 Feb 2014 11:48:52 +0400 Subject: [OpenJDK 2D-Dev] JDK 9: RFR[2]: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <53066D15.80302@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> <53052627.3060307@oracle.com> <53053762.6080800@oracle.com> <5305B762.3080103@oracle.com> <530644DA.2040209@oracle.com> <53066D15.80302@oracle.com> Message-ID: <530704E4.7040800@oracle.com> Hello Henry, the fix looks fine to me. Thanks, Andrew On 2/21/2014 1:01 AM, Henry Jen wrote: > Hi, > > Please review the latest update, I think this should address the > issues raised, > > http://cr.openjdk.java.net/~henryjen/jdk9/8033716/2/webrev/ > > - revert the clone method changes so that return type remains Object > - break long lines > - fix fallthrough warnings as Andrew suggested. > > Cheers, > Henry > > > On 02/20/2014 10:09 AM, Phil Race wrote: >> On 2/20/2014 12:05 AM, Henry Jen wrote: >>> On 02/19/2014 02:59 PM, Henry Jen wrote: >>>> On 02/19/2014 01:46 PM, Phil Race wrote: >>>>> >>>>> W.r.t the following change ... >>>>> >>>>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> 145 class Htable implements Cloneable { >>>>> >>>>> ... >>>>> <208 protected Object clone() { >>>>> >>>>>> 208 protected Htable clone() >>>>> >>>>> --------- >>>>> >>>>> exactly what warning is this suppressing ? >>>> >>>> This eliminate "unchecked" cast warning when calling this method to >>>> get >>>> an instance with correct class type. >>>> >>> >>> That's not exactly correct, it just eliminate the need to cast, not >>> warning. >>> >>> Would you advice to revert them or keep it? >> >> In that case, I'd suggest to revert them >> >> -phil. From magnus.ihse.bursie at oracle.com Fri Feb 21 13:21:44 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 21 Feb 2014 14:21:44 +0100 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <20140220224044.GB20217@redhat.com> References: <20140220224044.GB20217@redhat.com> Message-ID: <530752E8.8090104@oracle.com> On 2014-02-20 23:40, Omair Majid wrote: > Hi, > > The following is a preliminary webrev that allows OpenJDK to build and > run against a system-installed copy of lcms2 rather than the copy > bundled with OpenJDK: > > root: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00/ > jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00-jdk/ > > The goal is to add a new option `--with-lcms=` with possible values > `bundled` or `system`. Using `--with-lcms=system` builds using the > system-installed copy of lcms2 while `--with-lcms=bundled` builds with > the bundled copy of lcms2 in OpenJDK. > > This patch is quite a bit more invasive than the libpng one [1]. There > are a few issues that came up: > > 1. The sources for the bundled library are contained next to > OpenJDK-specific sources. This is not true for the bundled copies of > zlib, libpng and giflib. On the other hand, the jpeg code in OpenJDK > also mixes OpenJDK-specific code with bundled libjpeg code. To make it > easier to see (and compile) only non-lcms2 code, I moved the > lcms2-specific code into a separate directory. There are no code changes > there. The only OpenJDK-specific file here is LCMS.c, right? > I made changes which made sense to me, but I am not sure how this fits > in with existing conventions. Perhaps people here have suggestions on > how to make this less invasive and still achieve the goal while keep > things separate and distinct? I think it makes sense in separating our own code and an imported library. I think the "j2" convention is reasonable. I think the --with-lcms option is reasonable. So, the parts seems to work out fine. Still there's something bothering me with this fix, that I can't really put my finger on. Let's hear what the 2D people are saying. If they don't object, I won't object. But I like the way you're working on cleaning up our relationship to our bundled libraries! /Magnus From omajid at redhat.com Fri Feb 21 14:52:17 2014 From: omajid at redhat.com (Omair Majid) Date: Fri, 21 Feb 2014 09:52:17 -0500 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <530752E8.8090104@oracle.com> References: <20140220224044.GB20217@redhat.com> <530752E8.8090104@oracle.com> Message-ID: <20140221145216.GD2144@redhat.com> * Magnus Ihse Bursie [2014-02-21 08:21]: > On 2014-02-20 23:40, Omair Majid wrote: > >1. The sources for the bundled library are contained next to > >OpenJDK-specific sources. This is not true for the bundled copies of > >zlib, libpng and giflib. On the other hand, the jpeg code in OpenJDK > >also mixes OpenJDK-specific code with bundled libjpeg code. To make it > >easier to see (and compile) only non-lcms2 code, I moved the > >lcms2-specific code into a separate directory. There are no code changes > >there. > The only OpenJDK-specific file here is LCMS.c, right? Yes, that's the only one I could identify. > >I made changes which made sense to me, but I am not sure how this fits > >in with existing conventions. Perhaps people here have suggestions on > >how to make this less invasive and still achieve the goal while keep > >things separate and distinct? > > I think it makes sense in separating our own code and an imported library. Just throwing an idea out there, but has anyone considered moving all bundled code to a separate location? As in the `jdk` repo would have a `libs` or `bundled-libs` directory with one directory for each project with pristine upstream source (or a fork of upstream, as appropriate). > I think the "j2" convention is reasonable. > I think the --with-lcms option is reasonable. > > So, the parts seems to work out fine. Still there's something > bothering me with this fix, that I can't really put my finger on. > Let's hear what the 2D people are saying. If they don't object, I > won't object. Cool. But if you do have any concerns, please do share them. Even if the current patch is okay, I think everyone would like to see a future patch that is even better :) > But I like the way you're working on cleaning up our relationship to > our bundled libraries! Thanks. I am happy to find out that such patches are desired in OpenJDK! My original motivation was distributions asking to unbundle libraries. It's nice to see that everyone benefits from this :) Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From omajid at redhat.com Fri Feb 21 15:48:43 2014 From: omajid at redhat.com (Omair Majid) Date: Fri, 21 Feb 2014 10:48:43 -0500 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <1982674115.7194489.1392996973416.JavaMail.zimbra@redhat.com> References: <20140220224044.GB20217@redhat.com> <530752E8.8090104@oracle.com> <1982674115.7194489.1392996973416.JavaMail.zimbra@redhat.com> Message-ID: <20140221154842.GF2144@redhat.com> * Andrew Hughes [2014-02-21 10:36]: > > I think the "j2" convention is reasonable. > > This is where we disagree. I may have agreed if this was new, but we've been > using libjavalcms.so for the lifetime of 7 and I see no reason to change this. > > Also, "j2" seems pretty meaningless. I had the same thoughts at first. But I asked this same question [1] and was informed that the 'j2' is for "java to" [2]. So this is the "java to lcms" bridge. Thanks, Omair [1] http://mail.openjdk.java.net/pipermail/build-dev/2013-December/011274.html [2] http://mail.openjdk.java.net/pipermail/build-dev/2013-December/011325.html -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From gnu.andrew at redhat.com Fri Feb 21 15:36:13 2014 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Fri, 21 Feb 2014 10:36:13 -0500 (EST) Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <530752E8.8090104@oracle.com> References: <20140220224044.GB20217@redhat.com> <530752E8.8090104@oracle.com> Message-ID: <1982674115.7194489.1392996973416.JavaMail.zimbra@redhat.com> ----- Original Message ----- > On 2014-02-20 23:40, Omair Majid wrote: > > Hi, > > > > The following is a preliminary webrev that allows OpenJDK to build and > > run against a system-installed copy of lcms2 rather than the copy > > bundled with OpenJDK: > > > > root: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00/ > > jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00-jdk/ > > > > The goal is to add a new option `--with-lcms=` with possible values > > `bundled` or `system`. Using `--with-lcms=system` builds using the > > system-installed copy of lcms2 while `--with-lcms=bundled` builds with > > the bundled copy of lcms2 in OpenJDK. > > > > This patch is quite a bit more invasive than the libpng one [1]. There > > are a few issues that came up: > > > > 1. The sources for the bundled library are contained next to > > OpenJDK-specific sources. This is not true for the bundled copies of > > zlib, libpng and giflib. On the other hand, the jpeg code in OpenJDK > > also mixes OpenJDK-specific code with bundled libjpeg code. To make it > > easier to see (and compile) only non-lcms2 code, I moved the > > lcms2-specific code into a separate directory. There are no code changes > > there. > The only OpenJDK-specific file here is LCMS.c, right? Yes. At least, it was true in 7: http://icedtea.classpath.org/hg/icedtea7-forest/jdk/file/tip/make/sun/cmm/lcms/FILES_c_unix.gmk I don't know why we didn't move it to a sub-directory then, like we did with JPEG. I suspect simply because LCMS was done first. > > > I made changes which made sense to me, but I am not sure how this fits > > in with existing conventions. Perhaps people here have suggestions on > > how to make this less invasive and still achieve the goal while keep > > things separate and distinct? > > I think it makes sense in separating our own code and an imported library. So do I. It makes deleting the bundled copy more maintainable. > I think the "j2" convention is reasonable. This is where we disagree. I may have agreed if this was new, but we've been using libjavalcms.so for the lifetime of 7 and I see no reason to change this. Also, "j2" seems pretty meaningless. > I think the --with-lcms option is reasonable. In keeping with convention, yes. I'd still like to change these to --enable in the long run. > > So, the parts seems to work out fine. Still there's something bothering > me with this fix, that I can't really put my finger on. Let's hear what > the 2D people are saying. If they don't object, I won't object. > This is pretty much the same as we've been carrying since 2011, but modified for the new build, so I don't see any reason for objection. > But I like the way you're working on cleaning up our relationship to our > bundled libraries! It's necessary for us and we've had this work since 2007. Of course, this new build system broke most of it and meant it had to be rewritten :( > > /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 joe.darcy at oracle.com Fri Feb 21 18:28:52 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 21 Feb 2014 10:28:52 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8035487: Fix raw and unchecked lint warnings in javax.imageio.spi In-Reply-To: <5306EBC9.5080002@oracle.com> References: <5306EBC9.5080002@oracle.com> Message-ID: <53079AE4.9030307@oracle.com> On 02/20/2014 10:01 PM, Henry Jen wrote: > Hi, > > Please review the webrev to clean up raw and unchecked warnings in > javax.imageio.spi packag at, > > http://cr.openjdk.java.net/~henryjen/jdk9/8035487/0/webrev/ > > Cheers, > Henry Hi Henry, From a quick look, I didn`t see anything amiss with your changes. Thanks, -Joe From philip.race at oracle.com Fri Feb 21 20:56:15 2014 From: philip.race at oracle.com (Phil Race) Date: Fri, 21 Feb 2014 12:56:15 -0800 Subject: [OpenJDK 2D-Dev] JDK9: RFR: 8035487: Fix raw and unchecked lint warnings in javax.imageio.spi In-Reply-To: <5306EBC9.5080002@oracle.com> References: <5306EBC9.5080002@oracle.com> Message-ID: <5307BD6F.7000308@oracle.com> Approved. -phil. On 2/20/2014 10:01 PM, Henry Jen wrote: > Hi, > > Please review the webrev to clean up raw and unchecked warnings in > javax.imageio.spi packag at, > > http://cr.openjdk.java.net/~henryjen/jdk9/8035487/0/webrev/ > > Cheers, > Henry From philip.race at oracle.com Fri Feb 21 22:00:28 2014 From: philip.race at oracle.com (Phil Race) Date: Fri, 21 Feb 2014 14:00:28 -0800 Subject: [OpenJDK 2D-Dev] JDK 9: RFR[2]: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio In-Reply-To: <530704E4.7040800@oracle.com> References: <52F29CDA.9010705@oracle.com> <52F2ECE8.5020000@oracle.com> <52F55624.3040903@oracle.com> <52F5657E.70206@oracle.com> <52F579E2.6020209@oracle.com> <52FEBD42.3040406@oracle.com> <53052627.3060307@oracle.com> <53053762.6080800@oracle.com> <5305B762.3080103@oracle.com> <530644DA.2040209@oracle.com> <53066D15.80302@oracle.com> <530704E4.7040800@oracle.com> Message-ID: <5307CC7C.9090408@oracle.com> Ditto . -phil. On 2/20/2014 11:48 PM, Andrew Brygin wrote: > Hello Henry, > > the fix looks fine to me. > > Thanks, > Andrew > > On 2/21/2014 1:01 AM, Henry Jen wrote: >> Hi, >> >> Please review the latest update, I think this should address the >> issues raised, >> >> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/2/webrev/ >> >> - revert the clone method changes so that return type remains Object >> - break long lines >> - fix fallthrough warnings as Andrew suggested. >> >> Cheers, >> Henry >> >> >> On 02/20/2014 10:09 AM, Phil Race wrote: >>> On 2/20/2014 12:05 AM, Henry Jen wrote: >>>> On 02/19/2014 02:59 PM, Henry Jen wrote: >>>>> On 02/19/2014 01:46 PM, Phil Race wrote: >>>>>> >>>>>> W.r.t the following change ... >>>>>> >>>>>> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/1/webrev/src/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java.sdiff.html >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> 145 class Htable implements Cloneable { >>>>>> >>>>>> ... >>>>>> <208 protected Object clone() { >>>>>> >>>>>>> 208 protected Htable clone() >>>>>> >>>>>> --------- >>>>>> >>>>>> exactly what warning is this suppressing ? >>>>> >>>>> This eliminate "unchecked" cast warning when calling this method >>>>> to get >>>>> an instance with correct class type. >>>>> >>>> >>>> That's not exactly correct, it just eliminate the need to cast, not >>>> warning. >>>> >>>> Would you advice to revert them or keep it? >>> >>> In that case, I'd suggest to revert them >>> >>> -phil. > From james.graham at oracle.com Fri Feb 21 23: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 susannamoore53 at yahoo.com Mon Feb 24 02:50:42 2014 From: susannamoore53 at yahoo.com (susannamoore) Date: Sun, 23 Feb 2014 18:50:42 -0800 (PST) Subject: [OpenJDK 2D-Dev] How to resolve image tearing In-Reply-To: <71ee59da.ecbd.12f4704177c.Coremail.ims3g@126.com> References: <3e8c5056.ec5e.12f4700b68e.Coremail.ims3g@126.com> <71ee59da.ecbd.12f4704177c.Coremail.ims3g@126.com> Message-ID: <1393210242361-179074.post@n7.nabble.com> Screen image tearing is almost always related to V-sync. You can force V-syncin the CCC panel. It is normally caused by the video card sending another frame to the monitor or tv before the last frame has been fully drawn on screen. You visually get part of one frame and part of the second frame displayed at the same time. Manufacturers "Cheat" on response times. Stating grey scale response times instead of color response times. -- View this message in context: http://openjdk.5641.n7.nabble.com/How-to-resolve-image-tearing-tp98054p179074.html Sent from the OpenJDK Java 2D API mailing list archive at Nabble.com. From omajid at redhat.com Tue Feb 25 16:58:22 2014 From: omajid at redhat.com (Omair Majid) Date: Tue, 25 Feb 2014 11:58:22 -0500 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <20140221154842.GF2144@redhat.com> References: <20140220224044.GB20217@redhat.com> <530752E8.8090104@oracle.com> <1982674115.7194489.1392996973416.JavaMail.zimbra@redhat.com> <20140221154842.GF2144@redhat.com> Message-ID: <20140225165822.GD2383@redhat.com> * Omair Majid [2014-02-21 10:50]: > * Andrew Hughes [2014-02-21 10:36]: > > > I think the "j2" convention is reasonable. > > > > This is where we disagree. I may have agreed if this was new, but we've been > > using libjavalcms.so for the lifetime of 7 and I see no reason to change this. > > > > Also, "j2" seems pretty meaningless. > > I had the same thoughts at first. But I asked this same question [1] and > was informed that the 'j2' is for "java to" [2]. So this is the "java to > lcms" bridge. To be clear, I will be happy to change the prefix to `j` or `java` or `jre` or anything else that there is some consensus on. Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From philip.race at oracle.com Wed Feb 26 18:46:28 2014 From: philip.race at oracle.com (Phil Race) Date: Wed, 26 Feb 2014 10:46:28 -0800 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <530E0A77.4050607@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> Message-ID: <530E3684.6060404@oracle.com> Adding 2d-dev as 2d owns this file and might like to know where it went. My 2p : the files are however interpreted solely by the code with which it is co-located. So unless the build will come crashing down around us, I'd very much prefer that these files stay exactly where I put them ... -phil. On 2/26/2014 7:38 AM, Tim Bell wrote: > Hi Erik: > >> Here is another simple file move to bring more order to the sources. >> This time it's the psfont properties files that are being moved from >> src/share/classes to src/share/lib since in the build, they are just >> copied to the lib directory, so should not be confused with java >> resource files. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8035821 >> Webrev: http://cr.openjdk.java.net/~erikj/8035821/webrev.jdk.01/ > > Looks good to me. > > Tim > From philip.race at oracle.com Wed Feb 26 18:48:52 2014 From: philip.race at oracle.com (Phil Race) Date: Wed, 26 Feb 2014 10:48:52 -0800 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <530E3684.6060404@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> <530E3684.6060404@oracle.com> Message-ID: <530E3714.3000300@oracle.com> PS the same goes for other things like font property changes if you have such in mind. And unless you intend to run the printing test suite before you push, then changes like this *must* go into jdk9/client. Not jdk9/dev. Moot however, since I don't agree with the change. -phil. On 2/26/2014 10:46 AM, Phil Race wrote: > Adding 2d-dev as 2d owns this file and might like to know where it went. > My 2p : the files are however interpreted solely by the code with > which it is co-located. > So unless the build will come crashing down around us, I'd very much > prefer that these > files stay exactly where I put them ... > > > -phil. > > On 2/26/2014 7:38 AM, Tim Bell wrote: >> Hi Erik: >> >>> Here is another simple file move to bring more order to the sources. >>> This time it's the psfont properties files that are being moved from >>> src/share/classes to src/share/lib since in the build, they are just >>> copied to the lib directory, so should not be confused with java >>> resource files. >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8035821 >>> Webrev: http://cr.openjdk.java.net/~erikj/8035821/webrev.jdk.01/ >> >> Looks good to me. >> >> Tim >> > From magnus.ihse.bursie at oracle.com Thu Feb 27 08:03:42 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Thu, 27 Feb 2014 09:03:42 +0100 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <530E3714.3000300@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> <530E3684.6060404@oracle.com> <530E3714.3000300@oracle.com> Message-ID: <0BBD5725-CEFF-4FA9-A674-5E3386BFA18A@oracle.com> Phil, First of all, note that this is a change in build only. This change will not affect the source code in question, nor how it is executed. The properties files will end up in the very same location as a result of the build, wether with or without this patch. Hence, there is no need to run any printing tests. We can of course just as well integrate this patch using jdk9/client, if you prefer. Some background here might be useful, so you can understand what Erik is trying to achieve. Most files are stored in a suitable location: java files that should be compiled in src/*/classes. Files that should be copied to the lib directory in the resulting image are in src/share/lib. However, there are a few files that are stored elsewhere. This has been handled using hard-coded exception rules in the build system. Erik has spent some serious effort lately on cleaning up those idiosyncrasies. That normalization was something that we have been planning to do all along, but it has become urgent due to the jigsaw project. While we can handle the exceptions, even if its ugly, it has turned into a blocker to handle all those misplaced files when we need to reshuffle all source code. So, to summarize: * The code using those files will not be affected. * This is needed for the jigsaw project. With that information, I hope you can reconsider your position. /Magnus 26 feb 2014 kl. 19:48 skrev Phil Race : > PS the same goes for other things like font property changes if you have such in mind. > And unless you intend to run the printing test suite before you push, > then changes like this *must* go into jdk9/client. Not jdk9/dev. > Moot however, since I don't agree with the change. > > -phil. > > On 2/26/2014 10:46 AM, Phil Race wrote: >> Adding 2d-dev as 2d owns this file and might like to know where it went. >> My 2p : the files are however interpreted solely by the code with which it is co-located. >> So unless the build will come crashing down around us, I'd very much prefer that these >> files stay exactly where I put them ... >> >> >> -phil. >> >> On 2/26/2014 7:38 AM, Tim Bell wrote: >>> Hi Erik: >>> >>>> Here is another simple file move to bring more order to the sources. This time it's the psfont properties files that are being moved from src/share/classes to src/share/lib since in the build, they are just copied to the lib directory, so should not be confused with java resource files. >>>> >>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8035821 >>>> Webrev: http://cr.openjdk.java.net/~erikj/8035821/webrev.jdk.01/ >>> >>> Looks good to me. >>> >>> Tim > From alexandr.scherbatiy at oracle.com Thu Feb 27 12: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 philip.race at oracle.com Thu Feb 27 20:32:38 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 27 Feb 2014 12:32:38 -0800 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <0BBD5725-CEFF-4FA9-A674-5E3386BFA18A@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> <530E3684.6060404@oracle.com> <530E3714.3000300@oracle.com> <0BBD5725-CEFF-4FA9-A674-5E3386BFA18A@oracle.com> Message-ID: <530FA0E6.6060400@oracle.com> Magnus, I completely understand that the content of the files and the runtime behaviour aren't affected, but logically you'd want to put things together, not spread out across the source tree. Then its much easier for people to understand what uses what. If a jigsaw build somehow can't cope with this, then maybe the problem is there ? I'd have to understand that. Those files are only relevant to the 'client' module. In a jigsaw world, where will they live ? Is there even a concept of an installed jre/lib, or a source tree's src/share/lib ? And FWIW I presume you need a src//lib too .. ? -phil. On 2/27/2014 12:03 AM, Magnus Ihse Bursie wrote: > Phil, > > First of all, note that this is a change in build only. This change will not affect the source code in question, nor how it is executed. The properties files will end up in the very same location as a result of the build, wether with or without this patch. Hence, there is no need to run any printing tests. > > We can of course just as well integrate this patch using jdk9/client, if you prefer. > > Some background here might be useful, so you can understand what Erik is trying to achieve. Most files are stored in a suitable location: java files that should be compiled in src/*/classes. Files that should be copied to the lib directory in the resulting image are in src/share/lib. However, there are a few files that are stored elsewhere. This has been handled using hard-coded exception rules in the build system. Erik has spent some serious effort lately on cleaning up those idiosyncrasies. > > That normalization was something that we have been planning to do all along, but it has become urgent due to the jigsaw project. While we can handle the exceptions, even if its ugly, it has turned into a blocker to handle all those misplaced files when we need to reshuffle all source code. > > So, to summarize: > * The code using those files will not be affected. > * This is needed for the jigsaw project. > > With that information, I hope you can reconsider your position. > > /Magnus > > 26 feb 2014 kl. 19:48 skrev Phil Race : > >> PS the same goes for other things like font property changes if you have such in mind. >> And unless you intend to run the printing test suite before you push, >> then changes like this *must* go into jdk9/client. Not jdk9/dev. >> Moot however, since I don't agree with the change. >> >> -phil. >> >> On 2/26/2014 10:46 AM, Phil Race wrote: >>> Adding 2d-dev as 2d owns this file and might like to know where it went. >>> My 2p : the files are however interpreted solely by the code with which it is co-located. >>> So unless the build will come crashing down around us, I'd very much prefer that these >>> files stay exactly where I put them ... >>> >>> >>> -phil. >>> >>> On 2/26/2014 7:38 AM, Tim Bell wrote: >>>> Hi Erik: >>>> >>>>> Here is another simple file move to bring more order to the sources. This time it's the psfont properties files that are being moved from src/share/classes to src/share/lib since in the build, they are just copied to the lib directory, so should not be confused with java resource files. >>>>> >>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8035821 >>>>> Webrev: http://cr.openjdk.java.net/~erikj/8035821/webrev.jdk.01/ >>>> Looks good to me. >>>> >>>> Tim From mandy.chung at oracle.com Thu Feb 27 20:58:07 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 27 Feb 2014 12:58:07 -0800 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <530FA0E6.6060400@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> <530E3684.6060404@oracle.com> <530E3714.3000300@oracle.com> <0BBD5725-CEFF-4FA9-A674-5E3386BFA18A@oracle.com> <530FA0E6.6060400@oracle.com> Message-ID: <530FA6DF.6000006@oracle.com> Hi Phil, Is psfont*.properties* file more of a resource file? Is there any reason (or specification) that psfont*.properties has to be in JRE/lib directory? One potential reason might be the startup performance (warm start/cold start) to avoid opening a jar file? They don't look like a user-editable properties file and that could be the reason why they live in src/share/classes. As part of the modularization effort, we want to separate the user-editable configuration file from the non-modifiable resource files. For the non-modifiable resource files, does it make sense to move them together with the classes like other java resources? What Erik is doing to prepare for the source restructuring to enable the module build such that we can build one module at a time (i.e. you can just build the desktop module + its dependencies and skip the rest of JDK build). Here are the list of files under JRE/lib directory. Do you see any reason any of these can be moved to a different directory e.g. together with the classses? lib/cmm/CIEXYZ.pf lib/cmm/GRAY.pf lib/cmm/LINEAR_RGB.pf lib/cmm/PYCC.pf lib/cmm/sRGB.pf lib/content-types.properties lib/flavormap.properties lib/fontconfig.bfc lib/fontconfig.properties.src lib/images/cursors/cursors.properties lib/images/cursors/invalid32x32.gif lib/images/cursors/motif_CopyDrop32x32.gif lib/images/cursors/motif_CopyNoDrop32x32.gif lib/images/cursors/motif_LinkDrop32x32.gif lib/images/cursors/motif_LinkNoDrop32x32.gif lib/images/cursors/motif_MoveDrop32x32.gif lib/images/cursors/motif_MoveNoDrop32x32.gif lib/psfont.properties.ja lib/psfontj2d.properties lib/sound.properties Mandy [1] http://hg.openjdk.java.net/jdk9/dev/jdk/file/tip/src/share/classes/sun/print/PSPrinterJob.java On 2/27/14 12:32 PM, Phil Race wrote: > Magnus, > I completely understand that the content of the files and the runtime > behaviour aren't affected, but logically you'd want to put things > together, > not spread out across the source tree. Then its much easier for people to > understand what uses what. > > If a jigsaw build somehow can't cope with this, then maybe the problem > is there ? > I'd have to understand that. > Those files are only relevant to the 'client' module. In a jigsaw > world, where will they live ? > Is there even a concept of an installed jre/lib, or a source tree's > src/share/lib ? > > And FWIW I presume you need a src//lib too .. ? > > -phil. > > On 2/27/2014 12:03 AM, Magnus Ihse Bursie wrote: >> Phil, >> >> First of all, note that this is a change in build only. This change >> will not affect the source code in question, nor how it is executed. >> The properties files will end up in the very same location as a >> result of the build, wether with or without this patch. Hence, there >> is no need to run any printing tests. >> >> We can of course just as well integrate this patch using jdk9/client, >> if you prefer. >> >> Some background here might be useful, so you can understand what Erik >> is trying to achieve. Most files are stored in a suitable location: >> java files that should be compiled in src/*/classes. Files that >> should be copied to the lib directory in the resulting image are in >> src/share/lib. However, there are a few files that are stored >> elsewhere. This has been handled using hard-coded exception rules in >> the build system. Erik has spent some serious effort lately on >> cleaning up those idiosyncrasies. >> >> That normalization was something that we have been planning to do all >> along, but it has become urgent due to the jigsaw project. While we >> can handle the exceptions, even if its ugly, it has turned into a >> blocker to handle all those misplaced files when we need to reshuffle >> all source code. >> >> So, to summarize: >> * The code using those files will not be affected. >> * This is needed for the jigsaw project. >> >> With that information, I hope you can reconsider your position. >> >> /Magnus >> >> 26 feb 2014 kl. 19:48 skrev Phil Race : >> >>> PS the same goes for other things like font property changes if you >>> have such in mind. >>> And unless you intend to run the printing test suite before you push, >>> then changes like this *must* go into jdk9/client. Not jdk9/dev. >>> Moot however, since I don't agree with the change. >>> >>> -phil. >>> >>> On 2/26/2014 10:46 AM, Phil Race wrote: >>>> Adding 2d-dev as 2d owns this file and might like to know where it >>>> went. >>>> My 2p : the files are however interpreted solely by the code with >>>> which it is co-located. >>>> So unless the build will come crashing down around us, I'd very >>>> much prefer that these >>>> files stay exactly where I put them ... >>>> >>>> >>>> -phil. >>>> >>>> On 2/26/2014 7:38 AM, Tim Bell wrote: >>>>> Hi Erik: >>>>> >>>>>> Here is another simple file move to bring more order to the >>>>>> sources. This time it's the psfont properties files that are >>>>>> being moved from src/share/classes to src/share/lib since in the >>>>>> build, they are just copied to the lib directory, so should not >>>>>> be confused with java resource files. >>>>>> >>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8035821 >>>>>> Webrev: http://cr.openjdk.java.net/~erikj/8035821/webrev.jdk.01/ >>>>> Looks good to me. >>>>> >>>>> Tim > From philip.race at oracle.com Thu Feb 27 21:33:32 2014 From: philip.race at oracle.com (Phil Race) Date: Thu, 27 Feb 2014 13:33:32 -0800 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <530FA6DF.6000006@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> <530E3684.6060404@oracle.com> <530E3714.3000300@oracle.com> <0BBD5725-CEFF-4FA9-A674-5E3386BFA18A@oracle.com> <530FA0E6.6060400@oracle.com> <530FA6DF.6000006@oracle.com> Message-ID: <530FAF2C.80303@oracle.com> Hi, Leaving aside jigsaw, and regardless of whether they are modifiable, the question as to whether at runtime they should live in rt.jar or jre/lib is a separate question than where they would live in the source tree and one does not necessarily follow the other. You seem to be touching on the runtime location, but this change is only about the source location. Where it lives in the source tree surely doesn't matter to a user. At runtime, a resource file like say a font, really should live in jre/lib (or the jigsaw equivalent thereof). For starters it needs to be filesystem accessible so the native platform can see it, and secondly its used by lots of code. Also users might want to tweak them. In the source tree because its not associated with a particular java class then something like src/share makes sense. The '*psfont* files by contrast, are parsed once by one class they live alongside. They aren't a general resource for the rest of the system. So no matter where they go at runtime they are better co-located with the source. Where they go at runtime is something we can discuss later, when that kind of change is ready. As I hinted I hope we don't just blithely copy all src/share/lib files regardless of module, and I do hope the jigsaw teams will discuss this sort of thing long before we see code reviews .. Since much of it is passed into distant history, its not easy to say if particular files in jre/lib were there by design, convenience, or following existing custom. Same goes for where they originate in the source tree. Some of the files you list there - notably fontconfig - may be both user modifiable and start up sensitive. Others like the cmm ones are not modifiable, but may be startup sensitive and you are allowed to do some customisation of which ones are present. Then there are the cursors. Potentially start-up sensitive, probably not intended to be user modifiable/replaceable but it wouldn't surprise me if people have done it .. The "psfont" ones are not expected to be user modifiable, but its a very useful 'just in case', to have them in jre/lib. Where they live at runtime is likely not a big deal for startup (time to first print isn't something we ever measured :-)), but they are useful for users to see sometimes. -phil. On 02/27/2014 12:58 PM, Mandy Chung wrote: > Hi Phil, > > Is psfont*.properties* file more of a resource file? Is there any > reason (or specification) that psfont*.properties has to be in JRE/lib > directory? One potential reason might be the startup performance (warm > start/cold start) to avoid opening a jar file? They don't look like a > user-editable properties file and that could be the reason why they > live in src/share/classes. > > As part of the modularization effort, we want to separate the > user-editable configuration file from the non-modifiable resource > files. For the non-modifiable resource files, does it make sense to > move them together with the classes like other java resources? > > What Erik is doing to prepare for the source restructuring to enable > the module build such that we can build one module at a time (i.e. you > can just build the desktop module + its dependencies and skip the rest > of JDK build). > > Here are the list of files under JRE/lib directory. Do you see any > reason any of these can be moved to a different directory e.g. > together with the classses? > > lib/cmm/CIEXYZ.pf > lib/cmm/GRAY.pf > lib/cmm/LINEAR_RGB.pf > lib/cmm/PYCC.pf > lib/cmm/sRGB.pf > lib/content-types.properties > lib/flavormap.properties > lib/fontconfig.bfc > lib/fontconfig.properties.src > lib/images/cursors/cursors.properties > lib/images/cursors/invalid32x32.gif > lib/images/cursors/motif_CopyDrop32x32.gif > lib/images/cursors/motif_CopyNoDrop32x32.gif > lib/images/cursors/motif_LinkDrop32x32.gif > lib/images/cursors/motif_LinkNoDrop32x32.gif > lib/images/cursors/motif_MoveDrop32x32.gif > lib/images/cursors/motif_MoveNoDrop32x32.gif > lib/psfont.properties.ja > lib/psfontj2d.properties > lib/sound.properties > > Mandy > [1] > http://hg.openjdk.java.net/jdk9/dev/jdk/file/tip/src/share/classes/sun/print/PSPrinterJob.java > > On 2/27/14 12:32 PM, Phil Race wrote: >> Magnus, >> I completely understand that the content of the files and the runtime >> behaviour aren't affected, but logically you'd want to put things >> together, >> not spread out across the source tree. Then its much easier for >> people to >> understand what uses what. >> >> If a jigsaw build somehow can't cope with this, then maybe the >> problem is there ? >> I'd have to understand that. >> Those files are only relevant to the 'client' module. In a jigsaw >> world, where will they live ? >> Is there even a concept of an installed jre/lib, or a source tree's >> src/share/lib ? >> >> And FWIW I presume you need a src//lib too .. ? >> >> -phil. >> >> On 2/27/2014 12:03 AM, Magnus Ihse Bursie wrote: >>> Phil, >>> >>> First of all, note that this is a change in build only. This change >>> will not affect the source code in question, nor how it is executed. >>> The properties files will end up in the very same location as a >>> result of the build, wether with or without this patch. Hence, there >>> is no need to run any printing tests. >>> >>> We can of course just as well integrate this patch using >>> jdk9/client, if you prefer. >>> >>> Some background here might be useful, so you can understand what >>> Erik is trying to achieve. Most files are stored in a suitable >>> location: java files that should be compiled in src/*/classes. Files >>> that should be copied to the lib directory in the resulting image >>> are in src/share/lib. However, there are a few files that are stored >>> elsewhere. This has been handled using hard-coded exception rules in >>> the build system. Erik has spent some serious effort lately on >>> cleaning up those idiosyncrasies. >>> >>> That normalization was something that we have been planning to do >>> all along, but it has become urgent due to the jigsaw project. While >>> we can handle the exceptions, even if its ugly, it has turned into a >>> blocker to handle all those misplaced files when we need to >>> reshuffle all source code. >>> >>> So, to summarize: >>> * The code using those files will not be affected. >>> * This is needed for the jigsaw project. >>> >>> With that information, I hope you can reconsider your position. >>> >>> /Magnus >>> >>> 26 feb 2014 kl. 19:48 skrev Phil Race : >>> >>>> PS the same goes for other things like font property changes if you >>>> have such in mind. >>>> And unless you intend to run the printing test suite before you push, >>>> then changes like this *must* go into jdk9/client. Not jdk9/dev. >>>> Moot however, since I don't agree with the change. >>>> >>>> -phil. >>>> >>>> On 2/26/2014 10:46 AM, Phil Race wrote: >>>>> Adding 2d-dev as 2d owns this file and might like to know where it >>>>> went. >>>>> My 2p : the files are however interpreted solely by the code with >>>>> which it is co-located. >>>>> So unless the build will come crashing down around us, I'd very >>>>> much prefer that these >>>>> files stay exactly where I put them ... >>>>> >>>>> >>>>> -phil. >>>>> >>>>> On 2/26/2014 7:38 AM, Tim Bell wrote: >>>>>> Hi Erik: >>>>>> >>>>>>> Here is another simple file move to bring more order to the >>>>>>> sources. This time it's the psfont properties files that are >>>>>>> being moved from src/share/classes to src/share/lib since in the >>>>>>> build, they are just copied to the lib directory, so should not >>>>>>> be confused with java resource files. >>>>>>> >>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8035821 >>>>>>> Webrev: http://cr.openjdk.java.net/~erikj/8035821/webrev.jdk.01/ >>>>>> Looks good to me. >>>>>> >>>>>> Tim >> > From Alan.Bateman at oracle.com Fri Feb 28 10:12:51 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 28 Feb 2014 10:12:51 +0000 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <530FAF2C.80303@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> <530E3684.6060404@oracle.com> <530E3714.3000300@oracle.com> <0BBD5725-CEFF-4FA9-A674-5E3386BFA18A@oracle.com> <530FA0E6.6060400@oracle.com> <530FA6DF.6000006@oracle.com> <530FAF2C.80303@oracle.com> Message-ID: <53106123.90707@oracle.com> Phil, Just on Project Jigsaw and moving to a modular JDK then we've been doing preparatory work for this for several years (it had its own JEP in JDK 8 for example). There isn't a JEP yet proposing a Modular JDK but hopefully soon. In the mean-time I think we have to continue the clean-up and getting things consistent. Erik and Magnus are doing great work to clean-up the build and prepare for when we restructure the source code as modules. On the psfont files then I think you are saying that they aren't really intended to be user editable. If so then they would be a good candidate to move from $JAVA_HOME/lib in the image to a module-private location (once we get the JDK to the point where it is building a module image of course). That can come later. For now and for the source location then I think we have to listen to Erik and Magnus' arguments for consistency. Also the source tree needs to be much more approachable than it is now. In the case of properties files then it is not obvious where they go and whether you can use getResources at runtime to access them. So I think Erik's patch to move these to src/share/lib make sense as it makes it much more obvious where they will be in the build output. -Alan From magnus.ihse.bursie at oracle.com Fri Feb 28 14:24:16 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 28 Feb 2014 15:24:16 +0100 Subject: [OpenJDK 2D-Dev] RFR: JDK-8035821: Move psfont properties files from src/share/classes to src/share/lib In-Reply-To: <530FAF2C.80303@oracle.com> References: <530DC776.1060007@oracle.com> <530E0A77.4050607@oracle.com> <530E3684.6060404@oracle.com> <530E3714.3000300@oracle.com> <0BBD5725-CEFF-4FA9-A674-5E3386BFA18A@oracle.com> <530FA0E6.6060400@oracle.com> <530FA6DF.6000006@oracle.com> <530FAF2C.80303@oracle.com> Message-ID: <53109C10.4050706@oracle.com> On 2014-02-27 22:33, Phil Race wrote: > Hi, > > Leaving aside jigsaw, and regardless of whether they are modifiable, > the question as to whether at runtime they should live in rt.jar or > jre/lib > is a separate question than where they would live in the source tree > and one does not necessarily follow the other. > > You seem to be touching on the runtime location, but this change > is only about the source location. Where it lives in the source tree > surely doesn't matter to a user. You are correct that the current change only is about the source location, not the runtime location. However, I do not agree that the source location and the runtime location are completely orthogonal. In fact, the current situation, that source location and runtime location are somewhat loosely coupled is *exactly* what we're trying to address here! The problem here is that the JDK code base is filled with special cases and exceptions, all of which needs to be handled and "corrected" manually by the make files. With the old build system, where the makefiles were distributed and every sub-part of the JDK had their own makefiles with very little correlation or shared code, this was not so obvious. Every single special case looked like it was the only one in the world, and a single special case can always be accepted, right? When we created the new build-infra system and integrated all of the build, all the special cases and exceptions just added up. We need to have a lot of extra, unnecessary build logic, just to handle the exceptional, non-standard cases. As I said, we skipped doing anything about that in the initial build-infra project (and instead aiming for a bit-by-bit, bug-by-bug compatibility with the old build system), but we have always planned to address this. Now jigsaw has come, with the shuffling of source code. And suddenly all the exceptions goes from a nuicanse to a big problem. Unless we can unify the code base and get rid of the exceptions, we need to double all the exception handling -- once for the current source location, and once for the new location in the shuffled source code. And, on top of that, we now have a historic chance to actually get the complete code base in somewhat better shape. In this case, the "anomaly" here is that we have a .properties file in the source/*/classes tree, that is not supposed to be compiled into a ResourceBundle, as the other 97% of the properties files are. Most of the other non-ResourceBundle .properties files turned out to be better placed elsewhere. We believe the same is true for these files. /Magnus From omajid at redhat.com Fri Feb 28 21:27:33 2014 From: omajid at redhat.com (Omair Majid) Date: Fri, 28 Feb 2014 16:27:33 -0500 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <20140220224044.GB20217@redhat.com> References: <20140220224044.GB20217@redhat.com> Message-ID: <20140228212732.GG1965@redhat.com> * Omair Majid [2014-02-20 17:43]: > The following is a preliminary webrev that allows OpenJDK to build and > run against a system-installed copy of lcms2 rather than the copy > bundled with OpenJDK: > > root: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00/ > jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00-jdk/ > > The goal is to add a new option `--with-lcms=` with possible values > `bundled` or `system`. Using `--with-lcms=system` builds using the > system-installed copy of lcms2 while `--with-lcms=bundled` builds with > the bundled copy of lcms2 in OpenJDK. > > This patch is quite a bit more invasive than the libpng one [1]. There > are a few issues that came up: > > 1. The sources for the bundled library are contained next to > OpenJDK-specific sources. This is not true for the bundled copies of > zlib, libpng and giflib. On the other hand, the jpeg code in OpenJDK > also mixes OpenJDK-specific code with bundled libjpeg code. To make it > easier to see (and compile) only non-lcms2 code, I moved the > lcms2-specific code into a separate directory. There are no code changes > there. > > 2. The library name. The current library name for the combined library > containing lcms and OpenJDK code (that goes under jre/lib/$(ARCH)/) is > currently `liblcms.so` (on my Linux platform). When linked against the > system library, this new `liblcms.so` links to the system-wide > `liblcms2.so`. This looks a little bizarre. I am also afraid of some > distribution packaging the upstream lcms2 as `liblcms.so` which would > cause a name conflict. Following the convention of `libj2gss.so`, I > renamed it to `libj2lcms.so`. > > I made changes which made sense to me, but I am not sure how this fits > in with existing conventions. Perhaps people here have suggestions on > how to make this less invasive and still achieve the goal while keep > things separate and distinct? Anyone else have any comments on this? I would like to hear from 2d folks who would probably be the ones most impacted by this change. Is the moving of lcms files around okay? Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From philip.race at oracle.com Fri Feb 28 21:39:10 2014 From: philip.race at oracle.com (Phil Race) Date: Fri, 28 Feb 2014 13:39:10 -0800 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <20140228212732.GG1965@redhat.com> References: <20140220224044.GB20217@redhat.com> <20140228212732.GG1965@redhat.com> Message-ID: <531101FE.2080600@oracle.com> The moving of most of these files will cause me some significant pain. I am not convinced why its necessary. And if done wrong we lose the history. Even if done *right* the history is harder to get at. Plus the jigsaw people are very likely to move this code *again*. I need to look at this more, but I have no time right now. If we aren't using a system library I am not sure what purpose a little stub will serve, so I need to think about that. And this needs to be built and tested on all platforms to be approved. And open & closed builds need to work. I'm not sure they will. That suggests I'd need to run it through JPRT. -phil. On 02/28/2014 01:27 PM, Omair Majid wrote: > * Omair Majid [2014-02-20 17:43]: >> The following is a preliminary webrev that allows OpenJDK to build and >> run against a system-installed copy of lcms2 rather than the copy >> bundled with OpenJDK: >> >> root: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00/ >> jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00-jdk/ >> >> The goal is to add a new option `--with-lcms=` with possible values >> `bundled` or `system`. Using `--with-lcms=system` builds using the >> system-installed copy of lcms2 while `--with-lcms=bundled` builds with >> the bundled copy of lcms2 in OpenJDK. >> >> This patch is quite a bit more invasive than the libpng one [1]. There >> are a few issues that came up: >> >> 1. The sources for the bundled library are contained next to >> OpenJDK-specific sources. This is not true for the bundled copies of >> zlib, libpng and giflib. On the other hand, the jpeg code in OpenJDK >> also mixes OpenJDK-specific code with bundled libjpeg code. To make it >> easier to see (and compile) only non-lcms2 code, I moved the >> lcms2-specific code into a separate directory. There are no code changes >> there. >> >> 2. The library name. The current library name for the combined library >> containing lcms and OpenJDK code (that goes under jre/lib/$(ARCH)/) is >> currently `liblcms.so` (on my Linux platform). When linked against the >> system library, this new `liblcms.so` links to the system-wide >> `liblcms2.so`. This looks a little bizarre. I am also afraid of some >> distribution packaging the upstream lcms2 as `liblcms.so` which would >> cause a name conflict. Following the convention of `libj2gss.so`, I >> renamed it to `libj2lcms.so`. >> >> I made changes which made sense to me, but I am not sure how this fits >> in with existing conventions. Perhaps people here have suggestions on >> how to make this less invasive and still achieve the goal while keep >> things separate and distinct? > Anyone else have any comments on this? I would like to hear from 2d > folks who would probably be the ones most impacted by this change. Is > the moving of lcms files around okay? > > Thanks, > Omair > From omajid at redhat.com Fri Feb 28 23:24:43 2014 From: omajid at redhat.com (Omair Majid) Date: Fri, 28 Feb 2014 18:24:43 -0500 Subject: [OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2 In-Reply-To: <531101FE.2080600@oracle.com> References: <20140220224044.GB20217@redhat.com> <20140228212732.GG1965@redhat.com> <531101FE.2080600@oracle.com> Message-ID: <20140228232443.GB18442@redhat.com> * Phil Race [2014-02-28 16:46]: > The moving of most of these files will cause me some significant pain. Oh. Sorry :( Is there anything I (or possibly the jigsaw folks) can do to minimize it? > I am not convinced why its necessary. Basically, there is one file there (LCMS.c) that I want to make sure that does not get compiled against the headers located in the same directory. One way to be absolutely certain is to move the files out of that directory into another. `#include <..>` rather than `#include "..."` might also be sufficient but seems less of a guarantee (especially because then I have to filter things so the compiler invocation only includes LCMS.c and not the bundled lcms code). It seems the patch would be more complex (from a Makefile point) to test. I also figured it's a nice cleanup, separating code that is maintained in OpenJDK from code that isn't. > And if done wrong we lose the history. I am not sure if it's present in the webrev, but I did record the rename explicitly in mercurial. An `hg diff` locally shows me (among others): rename from src/share/native/sun/java2d/cmm/lcms/lcms2.h rename to src/share/native/sun/java2d/cmm/lcms/lcms2/lcms2.h > Even if done *right* the history is harder to get at. Fair enough, but 'hg log --follow' is fairly obvious, no? > Plus the jigsaw people are very likely to move this code *again*. Is there anything I can do to help? Can we move it just once to the final location? > I need to look at this more, but I have no time right now. Fair enough. I don't mind waiting for a few weeks. Any idea when you might have some time? > If we aren't using a system library I am not sure what purpose a little > stub will serve, so I need to think about that. I am not sure I follow. Do you mean the stub built from LCMS.c? It's basically a Java<->lcms2 binding. If we are using the system library, the `libj2lcms.so` will sit between the VM and the system lcms2 library. If we are not using the system library, all of the bundled lcms2 code in OpenJDK is built and contained in that library too. > And this needs to be built and tested on all platforms to be approved. > And open & closed builds need to work. I'm not sure they will. > That suggests I'd need to run it through JPRT. If there is a way for non-Oracle folks to access JPRT, I will be happy to run this patch through it myself. Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681