[OpenJDK 2D-Dev] [12] RFR JDK-8211055:Provide print to a file (PDF) feature even when printer was not connected

2018-09-26 Thread Prasanta Sadhukhan

Hi All,

Please review a fix for an issue where it is seen that if we do not have 
any printer installed and we try to save the printjob to a file
via "Save as PDF" option in mac, it was throwing PrinterExcetion:no 
printer service found.


This is a regression of JDK-8132988 where a check was added to make sure 
PrinterException is thrown if there is no printer installed.
Proposed fix is to find out if user is selecting "Save as PDF" option in 
native print dialog which will cause NSPrintInfo's jobDisposition value 
to be |NSPrintSaveJob

[https://developer.apple.com/documentation/appkit/nsprintinfo/1528717-jobdisposition?language=objc]

|In that case, the previous "no-printer" check is amended to also check 
if the print operation is saving to a file, in which case do not throw 
PrinterException and proceed with Save-File operation.

JDK-8132988  testcase also works ok after this fix.

Bug: https://bugs.openjdk.java.net/browse/JDK-8211055
webrev: http://cr.openjdk.java.net/~psadhukhan/8211055/webrev.0/

Regards
Prasanta
||


[OpenJDK 2D-Dev] [12] Review request for 8211165: License header is absent in a few J2Ddemo source code files

2018-09-26 Thread Anton Litvinov

Hello,

Could you please review the following fix which adds two blocks of 
source code comments to two files.


Bug: https://bugs.openjdk.java.net/browse/JDK-8211165
Webrev: http://cr.openjdk.java.net/~alitvinov/8211165/jdk12/webrev.00

Thank you,
Anton


Re: [OpenJDK 2D-Dev] Rendering images from PDF files slower in OpenJDK

2018-09-26 Thread Philip Race

Interesting and I assume that it was somewhat less in JD8u ?
Off the top of my head that is one thing that didn't change in any big 
way since JDK 8u.


Perhaps something has changed so that it is now [considered] needed 
whereas before

it was not? So did it go from zero percent to 29% or from 10% to 29% ?

But even that doesn't on it own account for everything.
29% of 8 seconds would be about 2.5 seconds and doesn't explain going from
< 3 seconds to 8 seconds .. we are still missing at least 2.5 seconds ..


-phil.

On 9/26/18, 11:08 AM, Daniel Persson wrote:

Hi Phil

What the PDFBox team told me it could have something to do with color 
mapping.


And my quick profiling shows that the code spends 29% of the time 
inside of java.awt.image.ColorConvertOp.filter on java 11


But I'll open a issue.

Best regards
Daniel

On Wed, Sep 26, 2018, 19:33 Phil Race > wrote:


Multiple pieces are changing across these releases.

Is it the JPEG writing ? Is it freetype vs t2k (font performance)
is it harfbuzz vs icu (text layout), is it marlin vs ductus
(rasterization) ?

So it is very hard to say with any certainty what the cause of the
difference is .. or
why 10 got so much better than 9  .. even if still not back to JDK 8.

Please file a bug at java.com .

-phil.

On 09/25/2018 10:42 PM, Daniel Persson wrote:
> Hi everyone,
>
> We render a lot of images with PDFBox with Java 1.8.0 and we
want to
> upgrade to the current OpenJDK 11 but sadly we see some performance
> degradation switching over to OpenJDK. Anyone have a suggestion to
> remedy this issue, or can explain why it is slower?
>
> Using the PDFBox app current release downloadable from
> http://www-us.apache.org/dist/pdfbox/2.0.11/pdfbox-app-2.0.11.jar
>
> Running the command
> java -jar pdfbox-app-2.0.11.jar PDFToImage -time test.pdf
>
> We see the following result
>
> -
> java version "1.8.0_181"
> Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
> Rendered 1 page in 2762ms
> -
> openjdk version "9.0.4"
> OpenJDK Runtime Environment (build 9.0.4+11)
> OpenJDK 64-Bit Server VM (build 9.0.4+11, mixed mode)
> Rendered 1 page in 8034ms
> -
> openjdk version "10.0.2" 2018-07-17
> OpenJDK Runtime Environment 18.3 (build 10.0.2+13)
> OpenJDK 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
> Rendered 1 page in 4255ms
> -
> openjdk version "11" 2018-09-25
> OpenJDK Runtime Environment 18.9 (build 11+28)
> OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
> Rendered 1 page in 4275ms
> -
> openjdk version "12-ea" 2019-03-19
> OpenJDK Runtime Environment 19.3 (build 12-ea+11)
> OpenJDK 64-Bit Server VM 19.3 (build 12-ea+11, mixed mode)
> Rendered 1 page in 4399ms
>
> The pdf file used in this example can be downloaded from
>

https://drive.google.com/file/d/139wP6PDmmQ6KBTyeJTETIrplSuOUgFfG/view?usp=sharing
>
> Best regards
> Daniel



Re: [OpenJDK 2D-Dev] [12] RFR JDK-8211055:Provide print to a file (PDF) feature even when printer was not connected

2018-09-26 Thread Phil Race

This is all MacOS specific changes - and functionality - but the test seems
to be cross-platform. Shouldn't it at least have an @requires macos tag ?

And I think the test should verify there are no printers and say it can't
be run if you have any ... and exit ...

Can we set  & retrieve the file as a Destination attribute ?
Then we can verify the file was saved without the user's help


 123 " 4. Another dialog opends prompting for filename, enter any filename and 
press \"Save\".\r\n" +


opends -> opens

-phil.

On 09/26/2018 04:38 AM, Prasanta Sadhukhan wrote:

Hi All,

Please review a fix for an issue where it is seen that if we do not 
have any printer installed and we try to save the printjob to a file
via "Save as PDF" option in mac, it was throwing PrinterExcetion:no 
printer service found.


This is a regression of JDK-8132988 where a check was added to make 
sure PrinterException is thrown if there is no printer installed.
Proposed fix is to find out if user is selecting "Save as PDF" option 
in native print dialog which will cause NSPrintInfo's jobDisposition 
value to be |NSPrintSaveJob

[https://developer.apple.com/documentation/appkit/nsprintinfo/1528717-jobdisposition?language=objc]

|In that case, the previous "no-printer" check is amended to also 
check if the print operation is saving to a file, in which case do not 
throw PrinterException and proceed with Save-File operation.

JDK-8132988  testcase also works ok after this fix.

Bug: https://bugs.openjdk.java.net/browse/JDK-8211055
webrev: http://cr.openjdk.java.net/~psadhukhan/8211055/webrev.0/

Regards
Prasanta
|| 




Re: [OpenJDK 2D-Dev] [12] Review request for 8211165: License header is absent in a few J2Ddemo source code files

2018-09-26 Thread Anton Litvinov

Hello Phil,

Thank you very much for approval of this fix. I will push the fix 
immediately. I think that for this particular case it is better to 
include also "2018,", because we add the header itself in 2018 and it 
will not look good, if we introduce the header and change the file now 
and leave just "2015,"  sub-string.


Thank you,
Anton

On 26/09/2018 17:50, Phil Race wrote:

Looks good to me.

Not sure if including 2018 is strictly needed since the only change in 
2018 is to add

the legal notice itself :-)

-phill

On 09/26/2018 09:40 AM, Anton Litvinov wrote:

Hello,

Could you please review the following fix which adds two blocks of 
source code comments to two files.


Bug: https://bugs.openjdk.java.net/browse/JDK-8211165
Webrev: http://cr.openjdk.java.net/~alitvinov/8211165/jdk12/webrev.00

Thank you,
Anton






Re: [OpenJDK 2D-Dev] [12] Review request for 8211165: License header is absent in a few J2Ddemo source code files

2018-09-26 Thread Phil Race

Looks good to me.

Not sure if including 2018 is strictly needed since the only change in 
2018 is to add

the legal notice itself :-)

-phill

On 09/26/2018 09:40 AM, Anton Litvinov wrote:

Hello,

Could you please review the following fix which adds two blocks of 
source code comments to two files.


Bug: https://bugs.openjdk.java.net/browse/JDK-8211165
Webrev: http://cr.openjdk.java.net/~alitvinov/8211165/jdk12/webrev.00

Thank you,
Anton




Re: [OpenJDK 2D-Dev] [12] Review request for 8211165: License header is absent in a few J2Ddemo source code files

2018-09-26 Thread Iris Clark
Hi, Anton.

> Bug: https://bugs.openjdk.java.net/browse/JDK-8211165
> Webrev: http://cr.openjdk.java.net/~alitvinov/8211165/jdk12/webrev.00

Your change looks good.  I've verified that you have the correct copyright 
format, copyright year range, and license.

Thank you for taking care of this!

iris

-Original Message-
From: Anton Litvinov 
Sent: Wednesday, September 26, 2018 9:41 AM
To: 2d-dev@openjdk.java.net
Subject: [OpenJDK 2D-Dev] [12] Review request for 8211165: License header is 
absent in a few J2Ddemo source code files

Hello,

Could you please review the following fix which adds two blocks of source code 
comments to two files.

Bug: https://bugs.openjdk.java.net/browse/JDK-8211165
Webrev: http://cr.openjdk.java.net/~alitvinov/8211165/jdk12/webrev.00

Thank you,
Anton


Re: [OpenJDK 2D-Dev] Rendering images from PDF files slower in OpenJDK

2018-09-26 Thread Phil Race

Multiple pieces are changing across these releases.

Is it the JPEG writing ? Is it freetype vs t2k (font performance)
is it harfbuzz vs icu (text layout), is it marlin vs ductus 
(rasterization) ?


So it is very hard to say with any certainty what the cause of the 
difference is .. or

why 10 got so much better than 9  .. even if still not back to JDK 8.

Please file a bug at java.com.

-phil.

On 09/25/2018 10:42 PM, Daniel Persson wrote:

Hi everyone,

We render a lot of images with PDFBox with Java 1.8.0 and we want to 
upgrade to the current OpenJDK 11 but sadly we see some performance 
degradation switching over to OpenJDK. Anyone have a suggestion to 
remedy this issue, or can explain why it is slower?


Using the PDFBox app current release downloadable from
http://www-us.apache.org/dist/pdfbox/2.0.11/pdfbox-app-2.0.11.jar

Running the command
java -jar pdfbox-app-2.0.11.jar PDFToImage -time test.pdf

We see the following result

-
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
Rendered 1 page in 2762ms
-
openjdk version "9.0.4"
OpenJDK Runtime Environment (build 9.0.4+11)
OpenJDK 64-Bit Server VM (build 9.0.4+11, mixed mode)
Rendered 1 page in 8034ms
-
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment 18.3 (build 10.0.2+13)
OpenJDK 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
Rendered 1 page in 4255ms
-
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
Rendered 1 page in 4275ms
-
openjdk version "12-ea" 2019-03-19
OpenJDK Runtime Environment 19.3 (build 12-ea+11)
OpenJDK 64-Bit Server VM 19.3 (build 12-ea+11, mixed mode)
Rendered 1 page in 4399ms

The pdf file used in this example can be downloaded from
https://drive.google.com/file/d/139wP6PDmmQ6KBTyeJTETIrplSuOUgFfG/view?usp=sharing

Best regards
Daniel




Re: [OpenJDK 2D-Dev] Rendering images from PDF files slower in OpenJDK

2018-09-26 Thread Daniel Persson
Hi Phil

What the PDFBox team told me it could have something to do with color
mapping.

And my quick profiling shows that the code spends 29% of the time inside of
java.awt.image.ColorConvertOp.filter on java 11

But I'll open a issue.

Best regards
Daniel

On Wed, Sep 26, 2018, 19:33 Phil Race  wrote:

> Multiple pieces are changing across these releases.
>
> Is it the JPEG writing ? Is it freetype vs t2k (font performance)
> is it harfbuzz vs icu (text layout), is it marlin vs ductus
> (rasterization) ?
>
> So it is very hard to say with any certainty what the cause of the
> difference is .. or
> why 10 got so much better than 9  .. even if still not back to JDK 8.
>
> Please file a bug at java.com.
>
> -phil.
>
> On 09/25/2018 10:42 PM, Daniel Persson wrote:
> > Hi everyone,
> >
> > We render a lot of images with PDFBox with Java 1.8.0 and we want to
> > upgrade to the current OpenJDK 11 but sadly we see some performance
> > degradation switching over to OpenJDK. Anyone have a suggestion to
> > remedy this issue, or can explain why it is slower?
> >
> > Using the PDFBox app current release downloadable from
> > http://www-us.apache.org/dist/pdfbox/2.0.11/pdfbox-app-2.0.11.jar
> >
> > Running the command
> > java -jar pdfbox-app-2.0.11.jar PDFToImage -time test.pdf
> >
> > We see the following result
> >
> > -
> > java version "1.8.0_181"
> > Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
> > Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
> > Rendered 1 page in 2762ms
> > -
> > openjdk version "9.0.4"
> > OpenJDK Runtime Environment (build 9.0.4+11)
> > OpenJDK 64-Bit Server VM (build 9.0.4+11, mixed mode)
> > Rendered 1 page in 8034ms
> > -
> > openjdk version "10.0.2" 2018-07-17
> > OpenJDK Runtime Environment 18.3 (build 10.0.2+13)
> > OpenJDK 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
> > Rendered 1 page in 4255ms
> > -
> > openjdk version "11" 2018-09-25
> > OpenJDK Runtime Environment 18.9 (build 11+28)
> > OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
> > Rendered 1 page in 4275ms
> > -
> > openjdk version "12-ea" 2019-03-19
> > OpenJDK Runtime Environment 19.3 (build 12-ea+11)
> > OpenJDK 64-Bit Server VM 19.3 (build 12-ea+11, mixed mode)
> > Rendered 1 page in 4399ms
> >
> > The pdf file used in this example can be downloaded from
> >
> https://drive.google.com/file/d/139wP6PDmmQ6KBTyeJTETIrplSuOUgFfG/view?usp=sharing
> >
> > Best regards
> > Daniel
>
>