|
Replies:
40
-
Last Post:
Nov 26, 2007 4:02 PM
by: Dmitri Trembove...
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 3, 2007 9:05 AM
|
|
|
Hello,
Sun had released an Early Access of 6uN (formerly known as the Consumer Release). You can get build b04 here: http://download.java.net/jdk6/
This build contains the new Direct3D 9-based Java2D pipeline, which is enabled by default on Windows platform. It is very similar to the OpenGL pipeline (in fact they share a lot of code), and is based on the Single Thread Rendering model developed for the OpenGL pipeline: http://weblogs.java.net/blog/campbell/archive/2005/03/strcrazy_improv_1.html
The D3D pipeline accelerates pretty much the same set of operations as the OGL one: http://weblogs.java.net/blog/campbell/archive/2004/11/behind_the_grap.html
So, this is a call to action:
Please try your applications with this new pipeline and let us know if you find any issues. We really want to make this pipeline rock-solid as it needs to be if it is to be left enabled by default. Time is short, so the sooner you report issues the better chances are we'll have time to fix them.
Please report both negative and positive findings so we can keep track of what's working and what's not (and on which HW).
Take a look at this page for testing/troubleshooting guidelines: https://jdk6.dev.java.net/testD3D.html (please make sure to include the output of J2D_TRACE_LEVEL=4 output with your postings)
There are some known problems in full-screen mode, multi-screen, and on some chipsets (namely, Intel 645G). These are being worked on and hopefully will be addressed by the release time.
Another thing to be aware of - this pipeline does not accelerate Xor rendering mode. It will be really, really slow. Sorry about that.
Thanks, Dmitri Java2D Team
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 3, 2007 12:10 PM
in response to: Dmitri Trembove...
|
|
|
Hi Dmitri,
I'm really excited to hear about this. The boost in performance will be a real advantage for Java in the Java vs. Flash war that is going on now.
But I am running into a related problem. In the process of beta testing my panorama viewer, I'm encountered a lot of problems with MemoryErrors on client machines. The problem is easily remedied by setting the VM arguments. But at the same time, those same people exhibit a reluctance to simply open the Java Control Panel and set the VM arguments. I even have a whole system set up where by my viewer pops up an HTML page that explains that there has been a memory error and a link to an HTML page that explains how to easily fix it.
Yet people still complain and point out that Flash doesn't have these problems. Now Flash 9 has supports a panorama viewer but the image quality is terrible. Java can render an image much more nicely and clearly. Yet, Java is still seen as deficient just because the default JVM memory parameters are too small and people are reluctant to take the 30 seconds it takes to set the memory parameters to a higher value.
Is there any thought at SUN to set the default memory parameters for the JVM to a larger value? This goes back to an earlier discussion I had with you about the possibility of being able to set the JVM arguments to programmatically from an applet.
Here is the memory help page I have available to the users that users seem to want to avoid.
http://pancyl.com/memoryhelp.htm
Ken
Dmitri Trembovetski wrote: > Hello, > > Sun had released an Early Access of 6uN (formerly known as > the Consumer Release). You can get build b04 here: > http://download.java.net/jdk6/ > > This build contains the new Direct3D 9-based Java2D pipeline, > which is enabled by default on Windows platform. It is very similar > to the > OpenGL pipeline (in fact they share a lot of code), and is > based on the Single Thread Rendering model developed for the OpenGL > pipeline: > > http://weblogs.java.net/blog/campbell/archive/2005/03/strcrazy_improv_1.html > > > The D3D pipeline accelerates pretty much the same set of operations > as the OGL one: > > http://weblogs.java.net/blog/campbell/archive/2004/11/behind_the_grap.html > > > So, this is a call to action: > > Please try your applications with this new pipeline and let us know > if you find any issues. We really want to make this pipeline rock-solid > as it needs to be if it is to be left enabled by default. Time is > short, > so the sooner you report issues the better chances are we'll have time > to fix them. > > Please report both negative and positive findings so we can > keep track of what's working and what's not (and on which > HW). > > Take a look at this page for testing/troubleshooting guidelines: > https://jdk6.dev.java.net/testD3D.html > (please make sure to include the output of J2D_TRACE_LEVEL=4 output > with your postings) > > There are some known problems in full-screen mode, multi-screen, > and on some chipsets (namely, Intel 645G). These are being worked on > and hopefully will be addressed by the release time. > > Another thing to be aware of - this pipeline does not > accelerate Xor rendering mode. It will be really, really slow. > Sorry about that. > > Thanks, > Dmitri > Java2D Team > > =========================================================================== > > To unsubscribe, send email to listserv@java.sun.com and include in the > body > of the message "signoff JAVA2D-INTEREST". For general help, send > email to > listserv@java.sun.com and include in the body of the message "help". > >
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 7:57 AM
in response to: Ken Warner
|
|
|
Hi Ken,
thank you for your comments.
I don't think I can comment on the VM heap issue - this is probably a question for the deployment team.
I'm not sure how it would work given that VM serves multiple applets at the same time.
Thanks, Dmitri
Ken Warner wrote: > Hi Dmitri, > > I'm really excited to hear about this. The boost in performance will be > a real advantage for Java in the Java vs. Flash war that is going on now. > > But I am running into a related problem. In the process of beta testing > my panorama viewer, I'm encountered a lot of problems with MemoryErrors > on client machines. The problem is easily remedied by setting the VM > arguments. But at the same time, those same people exhibit a > reluctance to simply open the Java Control Panel and set the VM > arguments. I even have a whole system set up where by my viewer pops up > an HTML page that explains that there has been a memory error and a link > to an HTML page that explains how to easily fix it. > > Yet people still complain and point out that Flash doesn't have these > problems. Now Flash 9 has supports a panorama viewer but the image > quality is terrible. Java can render an image much more nicely and > clearly. Yet, Java is still seen as deficient just because the default > JVM memory parameters are too small and people are reluctant to take the > 30 seconds it takes to set the memory parameters to a higher value. > > Is there any thought at SUN to set the default memory parameters for the > JVM to a larger value? This goes back to an earlier discussion I had > with you about the possibility of being able to set the JVM arguments to > programmatically from an applet. > > Here is the memory help page I have available to the users that users > seem to want to avoid. > > http://pancyl.com/memoryhelp.htm > > Ken > > Dmitri Trembovetski wrote: >> Hello, >> >> Sun had released an Early Access of 6uN (formerly known as >> the Consumer Release). You can get build b04 here: >> http://download.java.net/jdk6/ >> >> This build contains the new Direct3D 9-based Java2D pipeline, >> which is enabled by default on Windows platform. It is very similar >> to the >> OpenGL pipeline (in fact they share a lot of code), and is >> based on the Single Thread Rendering model developed for the OpenGL >> pipeline: >> >> http://weblogs.java.net/blog/campbell/archive/2005/03/strcrazy_improv_1.html >> >> >> >> The D3D pipeline accelerates pretty much the same set of operations >> as the OGL one: >> >> http://weblogs.java.net/blog/campbell/archive/2004/11/behind_the_grap.html >> >> >> >> So, this is a call to action: >> >> Please try your applications with this new pipeline and let us know >> if you find any issues. We really want to make this pipeline rock-solid >> as it needs to be if it is to be left enabled by default. Time is >> short, >> so the sooner you report issues the better chances are we'll have time >> to fix them. >> >> Please report both negative and positive findings so we can >> keep track of what's working and what's not (and on which >> HW). >> >> Take a look at this page for testing/troubleshooting guidelines: >> https://jdk6.dev.java.net/testD3D.html >> (please make sure to include the output of J2D_TRACE_LEVEL=4 output >> with your postings) >> >> There are some known problems in full-screen mode, multi-screen, >> and on some chipsets (namely, Intel 645G). These are being worked on >> and hopefully will be addressed by the release time. >> >> Another thing to be aware of - this pipeline does not >> accelerate Xor rendering mode. It will be really, really slow. >> Sorry about that. >> >> Thanks, >> Dmitri >> Java2D Team >> >> =========================================================================== >> >> >> To unsubscribe, send email to listserv@java.sun.com and include in the >> body >> of the message "signoff JAVA2D-INTEREST". For general help, send >> email to >> listserv@java.sun.com and include in the body of the message "help". >> >> > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 7:46 AM
in response to: Dmitri Trembove...
|
|
|
Hi Dmitri,
I've just installed 6uN EA, and I ran into two graphics problems. First, when you scroll through a Java source-code file in NetBeans 6.0-b1, the file display gets corrupted - just cycle through a few pages hitting Page Down and you'll see it. Second, I wrote an app where I manipulate some rather large image files, and I display these files drawing a BufferedImage over a JPanel. This JPanel is inside a JScrollPane. I've loaded a 5648x3584 image file, and scrolling is smooth under Java 1.6.2, but it's way slower under 6uN. My machine settings follow:
- Lenovo ThinkPad X60s - WinXP Pro SP2 - Intel 945GM Express Chipset
Here's the output I get when I set J2D_TRACE_LEVEL=4 :
CheckAdaptersInfo ------------------ Adapter Ordinal : 0 Description : Mobile Intel(R) 945GM Express Chipset Family GDI Name, Driver : \\.\DISPLAY1, ialmrnt5.dll Vendor Id : 0x8086 Version : 6.14.10.4450 ------------------ InitD3D: successfully created Direct3D9 object D3DGD_getDeviceCapsNative D3DPPLM::CheckDeviceCaps: device 0: Passed D3DContext::InitContext device 0 D3DContext::ConfigureContext device 0 D3DContext::ConfigureContext: successfully created device: 0 D3DContext::InitDevice: device 0 [W] D3DContext::InitDevice: sync query not available D3DContext::InitDefice: successfully initialized device 0 [V] | CAPS_DEVICE_OK [V] | CAPS_ALPHA_RT_PLAIN [V] | CAPS_ALPHA_RTT [V] | CAPS_OPAQUE_RTT [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER [V] | CAPS_MULTITEXTURE [V] | CAPS_TEXNONSQUARE
I get smooth performance again if I use -Dsun.java2d.d3d=false in my command line. Cheers,
Roger
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 7:54 AM
in response to: roger_rf
|
|
|
Thanks, Roger.
Yes, this is a known problem with the 945G chipset: 6612195: D3d: Netbeans editor is completely unusable with JDK 6uN [Intel 945G]
You'll have to use the workaround for now, unfortunately.
Thank you, Dmitri
java2d@JAVADESKTOP.ORG wrote: > Hi Dmitri, > > I've just installed 6uN EA, and I ran into two graphics problems. First, when you scroll through a Java source-code file in NetBeans 6.0-b1, the file display gets corrupted - just cycle through a few pages hitting Page Down and you'll see it. Second, I wrote an app where I manipulate some rather large image files, and I display these files drawing a BufferedImage over a JPanel. This JPanel is inside a JScrollPane. I've loaded a 5648x3584 image file, and scrolling is smooth under Java 1.6.2, but it's way slower under 6uN. My machine settings follow: > > - Lenovo ThinkPad X60s > - WinXP Pro SP2 > - Intel 945GM Express Chipset > > Here's the output I get when I set J2D_TRACE_LEVEL=4 : > > CheckAdaptersInfo > ------------------ > Adapter Ordinal : 0 > Description : Mobile Intel(R) 945GM Express Chipset Family > GDI Name, Driver : \\.\DISPLAY1, ialmrnt5.dll > Vendor Id : 0x8086 > Version : 6.14.10.4450 > ------------------ > InitD3D: successfully created Direct3D9 object > D3DGD_getDeviceCapsNative > D3DPPLM::CheckDeviceCaps: device 0: Passed > D3DContext::InitContext device 0 > D3DContext::ConfigureContext device 0 > D3DContext::ConfigureContext: successfully created device: 0 > D3DContext::InitDevice: device 0 > [W] D3DContext::InitDevice: sync query not available > D3DContext::InitDefice: successfully initialized device 0 > [V] | CAPS_DEVICE_OK > [V] | CAPS_ALPHA_RT_PLAIN > [V] | CAPS_ALPHA_RTT > [V] | CAPS_OPAQUE_RTT > [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER > [V] | CAPS_MULTITEXTURE > [V] | CAPS_TEXNONSQUARE > > I get smooth performance again if I use -Dsun.java2d.d3d=false in my command line. Cheers, > > Roger > [Message sent by forum member 'roger_rf' (roger_rf)] > > http://forums.java.net/jive/thread.jspa?messageID=238462 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 9:45 AM
in response to: Dmitri Trembove...
|
|
|
Works smoothly on this Dell Latitude D620 with Vista Ultimate so far.
In fact, it works better - the JTable headers are now much more compact and elegant compare to JavaSE6u2 (esp with the sorting icon!)
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 9:45 AM
in response to: alexlamsl
|
|
|
Good to hear!
Dmitri
java2d@JAVADESKTOP.ORG wrote: > Works smoothly on this Dell Latitude D620 with Vista Ultimate so far. > > In fact, it works better - the JTable headers are now much more compact and elegant compare to JavaSE6u2 (esp with the sorting icon!)  > [Message sent by forum member 'alexlamsl' (alexlamsl)] > > http://forums.java.net/jive/thread.jspa?messageID=238479 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 11:17 AM
in response to: Dmitri Trembove...
|
|
|
Hi Dmitri,
I was really excited to get my hands on the 6uN EA. But the performance boost of the DX9 rendering I expected didn't come. In fact, it became horribly slow 
Here is what the trace output says:
CheckAdaptersInfo ------------------ Adapter Ordinal : 0 Description : NVIDIA Quadro FX 3450/4000 SDI GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll Vendor Id : 0x10de Version : 6.14.10.7718 ------------------ InitD3D: successfully created Direct3D9 object D3DGD_getDeviceCapsNative D3DPPLM::CheckDeviceCaps: device 0: Passed D3DContext::InitContext device 0 D3DContext::ConfigureContext device 0 D3DContext::ConfigureContext: successfully created device: 0 D3DContext::InitDevice: device 0 D3DContext::InitDefice: successfully initialized device 0 [V] | CAPS_DEVICE_OK [V] | CAPS_ALPHA_RT_PLAIN [V] | CAPS_ALPHA_RTT [V] | CAPS_OPAQUE_RTT [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER [V] | CAPS_MULTITEXTURE [V] | CAPS_TEXNONPOW2 [V] | CAPS_TEXNONSQUARE
My application uses some techniques Romain Guy describes in his blog to blur out the application contents and then display a dialog in the foreground via the LayeredPane. I create a BufferedImage and paint the content on it. It is then resized to half its size and then the blur filter from the SwingLabs project is applied to it. The original content pane is then replaced by this picture, while the foreground draws a rounded-corner wait-dialog.
Launching with -Dsun.java2d.d3d=false takes 273ms to setup this effect. With DX rendering it takes 2038ms. The front dialog displays a small animated GIF-picture. The old rendering was totally smooth, the DX version has around 1fps.
If you need more information, please let me know.
Regards, Sebastian Kopsan
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 11:23 AM
in response to: fenriswulf
|
|
|
Hi Sebastian,
It is true that some operations may become slower.
Mostly it is when software and hardware rendering are mixed togeter. In your case it is likely that you are causing reading from video memory to system memory, which is very slow.
But to verify this and may be suggest a workaround it would be great if you can come up with a simple test which reproduces the issue.
Thanks, Dmitri
java2d@JAVADESKTOP.ORG wrote: > Hi Dmitri, > > I was really excited to get my hands on the 6uN EA. But the performance boost of the DX9 rendering I expected didn't come. In fact, it became horribly slow  > > Here is what the trace output says: > > CheckAdaptersInfo > ------------------ > Adapter Ordinal : 0 > Description : NVIDIA Quadro FX 3450/4000 SDI > GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll > Vendor Id : 0x10de > Version : 6.14.10.7718 > ------------------ > InitD3D: successfully created Direct3D9 object > D3DGD_getDeviceCapsNative > D3DPPLM::CheckDeviceCaps: device 0: Passed > D3DContext::InitContext device 0 > D3DContext::ConfigureContext device 0 > D3DContext::ConfigureContext: successfully created device: 0 > D3DContext::InitDevice: device 0 > D3DContext::InitDefice: successfully initialized device 0 > [V] | CAPS_DEVICE_OK > [V] | CAPS_ALPHA_RT_PLAIN > [V] | CAPS_ALPHA_RTT > [V] | CAPS_OPAQUE_RTT > [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER > [V] | CAPS_MULTITEXTURE > [V] | CAPS_TEXNONPOW2 > [V] | CAPS_TEXNONSQUARE > > My application uses some techniques Romain Guy describes in his blog to blur out the application contents and then display a dialog in the foreground via the LayeredPane. I create a BufferedImage and paint the content on it. It is then resized to half its size and then the blur filter from the SwingLabs project is applied to it. The original content pane is then replaced by this picture, while the foreground draws a rounded-corner wait-dialog. > > Launching with -Dsun.java2d.d3d=false takes 273ms to setup this effect. With DX rendering it takes 2038ms. The front dialog displays a small animated GIF-picture. The old rendering was totally smooth, the DX version has around 1fps. > > If you need more information, please let me know. > > Regards, > Sebastian Kopsan > [Message sent by forum member 'fenriswulf' (fenriswulf)] > > http://forums.java.net/jive/thread.jspa?messageID=238510 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 5, 2007 6:24 AM
in response to: Dmitri Trembove...
|
|
|
I don't really know which of my operations cause hardware rendering and which perform software rendering, because I just love the ease to create fancy animations without having to deal with that questions 
So maybe I did something wrong. I extracted a simple example from my program that demonstrates the behaviour and uploaded it as a zip archive at
http://www.kopsan.de/J6U5_Demo.zip
I measured a significant time increase for those lines:
final BufferedImage image = GraphicsUtilities.createCompatibleImage(c.getWidth(), c.getHeight()); final Graphics2D g2 = image.createGraphics(); c.paint(g2); // Paint contentpane to image g2.dispose();
It takes 11ms with Java 1.6.0_01 and 500ms with Java 1.6.0_05. The next performance drop occurs when drawing the two BufferedImages in the paintComponent method.
I would be pleased if you could tell me how to improve performance.
Thanks in advance, Sebastian Kopsan
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 2:07 PM
in response to: Dmitri Trembove...
|
|
|
It's hopeless on a Toshiba M35-S320 with NVIDIA GeForce FX Go5200. This is not surprising because QuickTime doesn't work either unless I disable D3D acceleration in QuickTime's settings. I'm stuck with the driver on Toshiba's support site because the drivers on NVIDIA's web site don't support this "OEM" version of their chip.
OK, definition of "hopeless":
1. Using Nimbus L&F, text does not render in combo box drop-down lists. Initially I assumed this was a bug in Nimbus but I disabled D3D (-Dsun.java2d.d3d=false) and Nimbus then works fine.
2. Using Windows L&F, after running over night, a trouble-free application I've been using for over a year had rendering problems this morning. When I simply moved the mouse pointer over a dialog, various controls on the dialog (labels, text boxes, sliders, combo boxes, etc.) would vanish and then reappear. When I restarted the program I was not able to reproduce the problem. Something about running over night (it updates text in a JTable every minute) caused rendering to get screwed up.
I'm 99.44% sure all the problems are the fault of the buggy and non-upgradeable NVIDIA device driver I'm stuck with. But I thought I'd post this report just to let you guys know that anyone with an old notebook like mine will have problems with the D3D mode.
If there's anything else you'd like me to try, let me know.
CheckAdaptersInfo ------------------ Adapter Ordinal : 0 Description : NVIDIA GeForce FX Go5200 GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll Vendor Id : 0x10de Version : 6.14.10.4644 ------------------ InitD3D: successfully created Direct3D9 object D3DGD_getDeviceCapsNative D3DPPLM::CheckDeviceCaps: device 0: Passed D3DContext::InitContext device 0 D3DContext::ConfigureContext device 0 D3DContext::ConfigureContext: successfully created device: 0 D3DContext::InitDevice: device 0 D3DContext::InitDefice: successfully initialized device 0 [V] | CAPS_DEVICE_OK [V] | CAPS_ALPHA_RT_PLAIN [V] | CAPS_ALPHA_RTT [V] | CAPS_OPAQUE_RTT [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER [V] | CAPS_MULTITEXTURE [V] | CAPS_TEXNONSQUARE
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 5, 2007 7:57 AM
in response to: sancroff
|
|
|
Hi,
thanks for the information.
Even though this is indeed most likely a buggy driver we still need to know it so that we can either work around the problem or push Nvidia to fix the issue.
The the problems developing overnight may be a sign of (video) memory leak somewhere in our code.
Thanks, Dmitri
java2d@JAVADESKTOP.ORG wrote: > It's hopeless on a Toshiba M35-S320 with NVIDIA GeForce FX Go5200. This is not surprising because QuickTime doesn't work either unless I disable D3D acceleration in QuickTime's settings. I'm stuck with the driver on Toshiba's support site because the drivers on NVIDIA's web site don't support this "OEM" version of their chip. > > OK, definition of "hopeless": > > 1. Using Nimbus L&F, text does not render in combo box drop-down lists. Initially I assumed this was a bug in Nimbus but I disabled D3D (-Dsun.java2d.d3d=false) and Nimbus then works fine. > > 2. Using Windows L&F, after running over night, a trouble-free application I've been using for over a year had rendering problems this morning. When I simply moved the mouse pointer over a dialog, various controls on the dialog (labels, text boxes, sliders, combo boxes, etc.) would vanish and then reappear. When I restarted the program I was not able to reproduce the problem. Something about running over night (it updates text in a JTable every minute) caused rendering to get screwed up. > > I'm 99.44% sure all the problems are the fault of the buggy and non-upgradeable NVIDIA device driver I'm stuck with. But I thought I'd post this report just to let you guys know that anyone with an old notebook like mine will have problems with the D3D mode. > > If there's anything else you'd like me to try, let me know. > > CheckAdaptersInfo > ------------------ > Adapter Ordinal : 0 > Description : NVIDIA GeForce FX Go5200 > GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll > Vendor Id : 0x10de > Version : 6.14.10.4644 > ------------------ > InitD3D: successfully created Direct3D9 object > D3DGD_getDeviceCapsNative > D3DPPLM::CheckDeviceCaps: device 0: Passed > D3DContext::InitContext device 0 > D3DContext::ConfigureContext device 0 > D3DContext::ConfigureContext: successfully created device: 0 > D3DContext::InitDevice: device 0 > D3DContext::InitDefice: successfully initialized device 0 > [V] | CAPS_DEVICE_OK > [V] | CAPS_ALPHA_RT_PLAIN > [V] | CAPS_ALPHA_RTT > [V] | CAPS_OPAQUE_RTT > [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER > [V] | CAPS_MULTITEXTURE > [V] | CAPS_TEXNONSQUARE > [Message sent by forum member 'sancroff' (sancroff)] > > http://forums.java.net/jive/thread.jspa?messageID=238540 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 5, 2007 8:36 AM
in response to: Dmitri Trembove...
|
|
|
Thanks, Dmitri.
I want to correct a minor detail in my problem description. I said "vanish and reappear". I really should have said that the dialog came up blank (after the program ran all night) and then as I moved the mouse pointer over where the controls were supposed to be, each control would appear and then disappear again as the mouse pointer moved off of it. That probably makes more sense than my original description (which was backwards).
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 4, 2007 8:33 PM
in response to: Dmitri Trembove...
|
|
|
Dimitri,
I tried the new version with the nightly build of NetBeans 6 and noticed that the status bar in the lower right hand corner of the application leaves vertical blue line remnants as it moves back and forth (indeterminate state mode) during compilations and such.
I also noticed that mouse clicks got swallowed every so often. I had to click a couple of times to make some operations work. This could be a NetBeans issue, but I haven't noticed that behavior before with the 02 release.
Rob
> > So, this is a call to action: > > Please try your applications with this new pipeline and let us know > if you find any issues. We really want to make this pipeline rock-solid > as it needs to be if it is to be left enabled by default. Time is > short, > so the sooner you report issues the better chances are we'll have time > to fix them. > > Please report both negative and positive findings so we can > keep track of what's working and what's not (and on which > HW). > >
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 5, 2007 7:55 AM
in response to: Rob Ratcliff
|
|
|
Hi Rob,
thanks for the report. Could you please run any swing app with J2D_TRACE_LEVEL=4 environment variable set and send out the output.
Also, what's the OS?
Thanks, Dmitri
Rob Ratcliff wrote: > Dimitri, > > I tried the new version with the nightly build of NetBeans 6 and noticed > that the status bar in the lower right hand corner of the application > leaves vertical blue line remnants as it moves back and forth > (indeterminate state mode) during compilations and such. > > I also noticed that mouse clicks got swallowed every so often. I had to > click a couple of times to make some operations work. This could be a > NetBeans issue, but I haven't noticed that behavior before with the 02 > release. > > Rob > >> So, this is a call to action: >> >> Please try your applications with this new pipeline and let us know >> if you find any issues. We really want to make this pipeline rock-solid >> as it needs to be if it is to be left enabled by default. Time is >> short, >> so the sooner you report issues the better chances are we'll have time >> to fix them. >> >> Please report both negative and positive findings so we can >> keep track of what's working and what's not (and on which >> HW). >> >> >
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 9, 2007 12:19 PM
in response to: Dmitri Trembove...
|
|
|
Hello,
I see a noticeable performance degradation in one of my apps. Painting PNG images (upscaling using bilinear or bicubic filtering) seems to be slower (factor of 20 in my case). Loading the image using ImageIO instead of Toolkit#getImage seems to resolve the problem.
Test:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URL;
public class PerformanceTest
{
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
try
{
initGUI();
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
}
private static void initGUI() throws IOException, InterruptedException
{
JFrame frame = new JFrame();
final ImagePanel imagePanel = new ImagePanel();
frame.getContentPane().add(imagePanel, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(100, 100, 600, 600);
frame.setVisible(true);
Timer timer = new Timer(20, new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
imagePanel.repaint();
}
});
timer.start();
}
private static class ImagePanel extends JPanel
{
private Image image;
private ImagePanel() throws InterruptedException, IOException
{
image = Toolkit.getDefaultToolkit().getImage(new URL("http://java.sun.com/docs/books/tutorial/figures/uiswing/components/HtmlButtonMetal.png"));
//image = ImageIO.read(new URL("http://java.sun.com/docs/books/tutorial/figures/uiswing/components/HtmlButtonMetal.png"));
MediaTracker mediaTracker = new MediaTracker(this);
mediaTracker.addImage(image, 1);
mediaTracker.waitForAll();
}
protected void paintComponent(Graphics g)
{
long ns1 = System.nanoTime();
int o = (int) (Math.random() * 20);
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2d.drawImage(image, o, o, 200, 200, null);
long ns2 = System.nanoTime();
System.out.println((ns2 - ns1) / 1000000. + " ms");
}
}
}
Operating System is Windows Vista
Output: 1.6.0_05-ea-b04
CheckAdaptersInfo ------------------ Adapter Ordinal : 0 Description : NVIDIA GeForce Go 7900 GS (Microsoft Corporation - WDDM) GDI Name, Driver : \\.\DISPLAY1, nvd3dum Vendor Id : 0x10de Version : 7.15.10.9746 ------------------ InitD3D: successfully created Direct3D9 object D3DGD_getDeviceCapsNative D3DPPLM::CheckDeviceCaps: device 0: Passed D3DContext::InitContext device 0 D3DContext::ConfigureContext device 0 D3DContext::ConfigureContext: successfully created device: 0 D3DContext::InitDevice: device 0 D3DContext::InitDefice: successfully initialized device 0 [V] | CAPS_DEVICE_OK [V] | CAPS_ALPHA_RT_PLAIN [V] | CAPS_ALPHA_RTT [V] | CAPS_OPAQUE_RTT [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER [V] | CAPS_MULTITEXTURE [V] | CAPS_TEXNONPOW2 [V] | CAPS_TEXNONSQUARE 78.177883 ms 63.440185 ms 50.098336 ms 55.525353 ms 46.665708 ms 45.636387 ms 42.916208 ms 45.019688 ms 62.719773 ms 48.997568 ms ...
1.6.0_02-b05 [W] GetFlagValues: DDraw/D3D is disabled on Windows Vista [W] GetFlagValues: DDraw screen locking is disabled (W2K, XP+) InitDirectX [V] CheckRegistry: Found Display Device 0: NVIDIA GeForce Go 7900 GS (Microsoft Corporation - WDDM) 6.752813 ms 2.110464 ms 2.243441 ms 2.47741 ms 3.281492 ms 2.323549 ms 2.153067 ms 2.332698 ms 2.236387 ms ...
Martin
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 9, 2007 1:38 PM
in response to: til77
|
|
|
Hi Martin,
Thanks a lot for the detailed report.
There are two issues here: - some images loaded with Toolkit.getImage() (at least, pngs) aren't accelerated - this had been addressed in jdk7 but not in 6uN. I'll file a bug on this one. - for some unaccelerated images rendering performance degraded I'll see what can be done for this one.
A workaround is, as you have mentioned, to use ImageIO for reading images.
In Java 6u4: 3.861277 ms 6.203313 ms 7.477602 ms 2.312025 ms 2.202579 ms
With 6uN without the fix I get: 48.689088 ms 40.162102 ms 47.807305 ms 49.540503 ms
With the fix or the ImageIO work around: 0.094893 ms 0.0937 ms 0.119034 ms 0.09319 ms 0.092727 ms
Thanks, Dmitri Java2D Team
java2d@JAVADESKTOP.ORG wrote: > Hello, > > I see a noticeable performance degradation in one of my apps. > Painting PNG images (upscaling using bilinear or bicubic filtering) seems to be slower (factor of 20 in my case). > Loading the image using ImageIO instead of Toolkit#getImage seems to resolve the problem. > > Test: > > > import javax.swing.*;
> import java.awt.*;
> import java.awt.event.ActionEvent;
> import java.awt.event.ActionListener;
> import java.io.IOException;
> import java.net.URL;
>
> public class PerformanceTest
> {
> public static void main(String[] args)
> {
> EventQueue.invokeLater(new Runnable()
> {
> public void run()
> {
> try
> {
> initGUI();
> }
> catch (Exception e)
> {
> e.printStackTrace();
> }
> }
> });
> }
>
>
> private static void initGUI() throws IOException, InterruptedException
> {
> JFrame frame = new JFrame();
> final ImagePanel imagePanel = new ImagePanel();
> frame.getContentPane().add(imagePanel, BorderLayout.CENTER);
> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> frame.setBounds(100, 100, 600, 600);
> frame.setVisible(true);
>
> Timer timer = new Timer(20, new ActionListener()
> {
> public void actionPerformed(ActionEvent e)
> {
> imagePanel.repaint();
> }
> });
>
> timer.start();
> }
>
>
> private static class ImagePanel extends JPanel
> {
> private Image image;
>
>
> private ImagePanel() throws InterruptedException, IOException
> {
> image = Toolkit.getDefaultToolkit().getImage(new URL("http://java.sun.com/docs/books/tutorial/figures/uiswing/components/HtmlButtonMetal.png"));
> //image = ImageIO.read(new URL("http://java.sun.com/docs/books/tutorial/figures/uiswing/components/HtmlButtonMetal.png"));
>
> MediaTracker mediaTracker = new MediaTracker(this);
> mediaTracker.addImage(image, 1);
> mediaTracker.waitForAll();
> }
>
>
> protected void paintComponent(Graphics g)
> {
> long ns1 = System.nanoTime();
> int o = (int) (Math.random() * 20);
> Graphics2D g2d = (Graphics2D) g;
> g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
> g2d.drawImage(image, o, o, 200, 200, null);
> long ns2 = System.nanoTime();
> System.out.println((ns2 - ns1) / 1000000. + " ms");
> }
> }
> }
>
> > Operating System is Windows Vista > > Output: > 1.6.0_05-ea-b04 > > CheckAdaptersInfo > ------------------ > Adapter Ordinal : 0 > Description : NVIDIA GeForce Go 7900 GS (Microsoft Corporation - WDDM) > GDI Name, Driver : \\.\DISPLAY1, nvd3dum > Vendor Id : 0x10de > Version : 7.15.10.9746 > ------------------ > InitD3D: successfully created Direct3D9 object > D3DGD_getDeviceCapsNative > D3DPPLM::CheckDeviceCaps: device 0: Passed > D3DContext::InitContext device 0 > D3DContext::ConfigureContext device 0 > D3DContext::ConfigureContext: successfully created device: 0 > D3DContext::InitDevice: device 0 > D3DContext::InitDefice: successfully initialized device 0 > [V] | CAPS_DEVICE_OK > [V] | CAPS_ALPHA_RT_PLAIN > [V] | CAPS_ALPHA_RTT > [V] | CAPS_OPAQUE_RTT > [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER > [V] | CAPS_MULTITEXTURE > [V] | CAPS_TEXNONPOW2 > [V] | CAPS_TEXNONSQUARE > 78.177883 ms > 63.440185 ms > 50.098336 ms > 55.525353 ms > 46.665708 ms > 45.636387 ms > 42.916208 ms > 45.019688 ms > 62.719773 ms > 48.997568 ms > ... > > 1.6.0_02-b05 > [W] GetFlagValues: DDraw/D3D is disabled on Windows Vista > [W] GetFlagValues: DDraw screen locking is disabled (W2K, XP+) > InitDirectX > [V] CheckRegistry: Found Display Device 0: NVIDIA GeForce Go 7900 GS (Microsoft Corporation - WDDM) > 6.752813 ms > 2.110464 ms > 2.243441 ms > 2.47741 ms > 3.281492 ms > 2.323549 ms > 2.153067 ms > 2.332698 ms > 2.236387 ms > ... > > Martin > [Message sent by forum member 'til77' (til77)] > > http://forums.java.net/jive/thread.jspa?messageID=239186 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 9, 2007 2:40 PM
in response to: Dmitri Trembove...
|
|
|
http://pancyl.com/debug.htm
I've put some timing code in my applet. It may be useful to do a comparison between 1.5 and 1.6 with the D3D acceleration on your own machine.
What you will see in the console window is --
PanCyl v0.3.2_D3DTest Interp Time = 841ms Paint Time(640, 360) = 50ms ---
Interp Time = 591ms Paint Time(640, 360) = 30ms ---
Interp Time = 611ms Paint Time(640, 360) = 30ms ---
What you are looking at is the time to interpolate a 640x360 image (my own bicubic interpolator -- it's slow) and then the time to paint that 640x360 image in a Canvas.
Here's the rendering method that is in MyCanvas. I only use paint() for system events. mis is a MemoryImageSource; bs is the BufferStrategy; bg is the BufferStrategy Graphics
//this is what is timed
t1 = System.currentTimeMillis(); System.err.println("Interp Time = " + (t1 - t0) + "ms");
t2 = System.currentTimeMillis(); canvas.newPixels(); t3 = System.currentTimeMillis(); System.err.println("Paint Time(" + canvasW + ", " + canvasH + ") = " + (t3 - t2) + "ms"); System.err.println("---\n");
public void newPixels() { try { if(!this.isShowing())return; do { do { bg = (Graphics2D)bs.getDrawGraphics(); mis.newPixels(0,0,thisW,thisH,true); bg.drawImage(canvasImage, 0, 0, thisW, thisH, this); if(DRAWATT) drawAttribution(); // ignore this bg.dispose(); } while (bs.contentsRestored()); bs.show(); } while (bs.contentsLost()); } catch (Exception ie) { ie.printStackTrace(); } }
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 9, 2007 3:19 PM
in response to: Dmitri Trembove...
|
|
|
Hello,
Just an update..
Dmitri Trembovetski wrote: > Hi Martin, > > Thanks a lot for the detailed report. > > There are two issues here: > - some images loaded with Toolkit.getImage() (at least, pngs) aren't > accelerated - this had been addressed in jdk7 but not in 6uN. > I'll file a bug on this one.
Ok, there's actually a bug for this already: 6231864: Some images loaded via Toolkit or ImageIcon can't be accelerated
It had been fixed as part of another fix (6205557) in jdk7. I will see if I can fix it in 6uN (it won't be a straight back-port of jdk7 fix).
> - for some unaccelerated images rendering performance degraded > I'll see what can be done for this one.
This one is also known: 4841762: D3D/OGL: enable bilinear sw->surface transforms
Thanks, Dmitri
> > A workaround is, as you have mentioned, to use ImageIO for reading > images. > > In Java 6u4: > 3.861277 ms > 6.203313 ms > 7.477602 ms > 2.312025 ms > 2.202579 ms > > With 6uN without the fix I get: > 48.689088 ms > 40.162102 ms > 47.807305 ms > 49.540503 ms > > With the fix or the ImageIO work around: > 0.094893 ms > 0.0937 ms > 0.119034 ms > 0.09319 ms > 0.092727 ms > > Thanks, > Dmitri > Java2D Team > > > java2d@JAVADESKTOP.ORG wrote: >> Hello, >> >> I see a noticeable performance degradation in one of my apps. >> Painting PNG images (upscaling using bilinear or bicubic filtering) >> seems to be slower (factor of 20 in my case). >> Loading the image using ImageIO instead of Toolkit#getImage seems to >> resolve the problem. >> >> Test: >> >> >> import javax.swing.*;
>> import java.awt.*;
>> import java.awt.event.ActionEvent;
>> import java.awt.event.ActionListener;
>> import java.io.IOException;
>> import java.net.URL;
>>
>> public class PerformanceTest
>> {
>> public static void main(String[] args)
>> {
>> EventQueue.invokeLater(new Runnable()
>> {
>> public void run()
>> {
>> try
>> {
>> initGUI();
>> }
>> catch (Exception e)
>> {
>> e.printStackTrace();
>> }
>> }
>> });
>> }
>>
>>
>> private static void initGUI() throws IOException,
>> InterruptedException
>> {
>> JFrame frame = new JFrame();
>> final ImagePanel imagePanel = new ImagePanel();
>> frame.getContentPane().add(imagePanel, BorderLayout.CENTER);
>> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>> frame.setBounds(100, 100, 600, 600);
>> frame.setVisible(true);
>>
>> Timer timer = new Timer(20, new ActionListener()
>> {
>> public void actionPerformed(ActionEvent e)
>> {
>> imagePanel.repaint();
>> }
>> });
>>
>> timer.start();
>> }
>>
>>
>> private static class ImagePanel extends JPanel
>> {
>> private Image image;
>>
>>
>> private ImagePanel() throws InterruptedException, IOException
>> {
>> image = Toolkit.getDefaultToolkit().getImage(new
>> URL("http://java.sun.com/docs/books/tutorial/figures/uiswing/components/HtmlButtonMetal.png"));
>>
>> //image = ImageIO.read(new
>> URL("http://java.sun.com/docs/books/tutorial/figures/uiswing/components/HtmlButtonMetal.png"));
>>
>>
>> MediaTracker mediaTracker = new MediaTracker(this);
>> mediaTracker.addImage(image, 1);
>> mediaTracker.waitForAll();
>> }
>>
>>
>> protected void paintComponent(Graphics g)
>> {
>> long ns1 = System.nanoTime();
>> int o = (int) (Math.random() * 20);
>> Graphics2D g2d = (Graphics2D) g;
>> g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
>> RenderingHints.VALUE_INTERPOLATION_BILINEAR);
>> g2d.drawImage(image, o, o, 200, 200, null);
>> long ns2 = System.nanoTime();
>> System.out.println((ns2 - ns1) / 1000000. + " ms");
>> }
>> }
>> }
>>
>> >> Operating System is Windows Vista >> >> Output: >> 1.6.0_05-ea-b04 >> >> CheckAdaptersInfo >> ------------------ >> Adapter Ordinal : 0 >> Description : NVIDIA GeForce Go 7900 GS (Microsoft >> Corporation - WDDM) >> GDI Name, Driver : \\.\DISPLAY1, nvd3dum >> Vendor Id : 0x10de >> Version : 7.15.10.9746 >> ------------------ >> InitD3D: successfully created Direct3D9 object >> D3DGD_getDeviceCapsNative >> D3DPPLM::CheckDeviceCaps: device 0: Passed >> D3DContext::InitContext device 0 >> D3DContext::ConfigureContext device 0 >> D3DContext::ConfigureContext: successfully created device: 0 >> D3DContext::InitDevice: device 0 >> D3DContext::InitDefice: successfully initialized device 0 >> [V] | CAPS_DEVICE_OK >> [V] | CAPS_ALPHA_RT_PLAIN >> [V] | CAPS_ALPHA_RTT >> [V] | CAPS_OPAQUE_RTT >> [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER >> [V] | CAPS_MULTITEXTURE >> [V] | CAPS_TEXNONPOW2 >> [V] | CAPS_TEXNONSQUARE >> 78.177883 ms >> 63.440185 ms >> 50.098336 ms >> 55.525353 ms >> 46.665708 ms >> 45.636387 ms >> 42.916208 ms >> 45.019688 ms >> 62.719773 ms >> 48.997568 ms >> ... >> >> 1.6.0_02-b05 >> [W] GetFlagValues: DDraw/D3D is disabled on Windows Vista >> [W] GetFlagValues: DDraw screen locking is disabled (W2K, XP+) >> InitDirectX >> [V] CheckRegistry: Found Display Device 0: NVIDIA GeForce Go 7900 GS >> (Microsoft Corporation - WDDM) >> 6.752813 ms >> 2.110464 ms >> 2.243441 ms >> 2.47741 ms >> 3.281492 ms >> 2.323549 ms >> 2.153067 ms >> 2.332698 ms >> 2.236387 ms >> ... >> >> Martin >> [Message sent by forum member 'til77' (til77)] >> >> http://forums.java.net/jive/thread.jspa?messageID=239186 >> >> =========================================================================== >> >> To unsubscribe, send email to listserv@java.sun.com and include in the >> body >> of the message "signoff JAVA2D-INTEREST". For general help, send >> email to >> listserv@java.sun.com and include in the body of the message "help". > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 11, 2007 3:48 AM
in response to: Dmitri Trembove...
|
|
|
Hello,
I found another interesting performance regression in one of my applications. Scrolling in a JTable seems to be sluggish when I show a splashcreen first, rendering speed is good when I don't show the splashscreen or when the splashcreen does not exceed a width or height of 150 pixels.
Test:
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.text.View;
import java.awt.*;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
public class ScrollpaneTest
{
private static final String MULTILINE = "The following JComponent methods are safe to call from any thread: repaint(), revalidate(), and invalidate(). " +
"The repaint() and revalidate() methods queue requests for the event-dispatching thread to call paint() and validate(), " +
"respectively. The invalidate() method just marks a component and all of its direct ancestors as requiring validation.\n" +
"Listener lists can be modified from any thread: It's always safe to call the addListenerTypeListener() and " +
"removeListenerTypeListener() methods. The add/remove operations have no effect on an event dispatch that's under way." +
"Most post-initialization GUI work naturally occurs in the event-dispatching thread. Once the GUI is visible, most " +
"programs are driven by events such as button actions or mouse clicks, which are always handled in the event-dispatching thread.\n" +
"\n" +
"However, some programs need to perform non-event-driven GUI work after the GUI is visible. Here are some examples:\n" +
"\n" +
" * Programs that must perform a lengthy initialization operation\n" +
" before they can be used: This kind of program should generally show some GUI while the initialization is occurring, " +
"and then update or change the GUI. The initialization should not occur in the event-dispatching thread; otherwise, repainting " +
"and event dispatch would stop. However, after initialization the GUI update/change should occur in the event-dispatching thread, " +
"for thread-safety reasons.\n" +
" \n" +
" * Programs whose GUI must be updated as the result of non-AWT events: For example, suppose a server program can get requests " +
"from other programs that might be running on different machines. These requests can come at any time, and they result in one of " +
"the server's methods being invoked in some possibly unknown thread. How can that method update the GUI? By executing the GUI update " +
"code in the event-dispatching thread.\n" +
"\n" +
"The SwingUtilities class provides two methods to help you run code in the event-dispatching thread:\n" +
"\n" +
" * invokeLater(): Requests that some code be executed in the event-dispatching thread. This method returns immediately, without " +
"waiting for the code to execute.\n" +
" \n" +
" * invokeAndWait(): Acts like invokeLater(), except that this method waits for the code to execute. As a rule, you should use " +
"invokeLater() instead of this method.\n" +
"\n" +
"This page gives you some examples of using this API. Also see the BINGO example in The Java Tutorial, especially the following " +
"classes: CardWindow, ControlPane, Player, and OverallStatusPane. ";
public static void main(String[] args) throws IOException, InterruptedException, InvocationTargetException
{
final SplashScreen[] splashScreens = new SplashScreen[1];
EventQueue.invokeAndWait(new Runnable()
{
public void run()
{
splashScreens[0] = new SplashScreen();
splashScreens[0].setVisible(true);
}
});
splashScreens[0].setDescription("loading");
Thread.sleep(300);
splashScreens[0].setDescription("loading more");
Thread.sleep(300);
splashScreens[0].setDescription("loading almost done");
Thread.sleep(300);
EventQueue.invokeLater(new Runnable()
{
public void run()
{
splashScreens[0].dispose();
initGUI();
}
});
}
private static class SplashScreen extends Window
{
private String description;
private int iw;
private int ih;
private SplashScreen()
{
super(null);
iw = 151;//150=fast, 151=slow
ih = 120;
setSize(iw, ih + 30);
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screen.width - iw) / 2, (screen.height - ih + 30) / 2);
}
public void paint(Graphics g)
{
g.setColor(Color.BLACK);
g.fillRect(0, ih, getWidth(), 30);
g.setColor(Color.WHITE);
if (description != null)
{
System.out.println(Thread.currentThread().getName());
g.drawString(description, 10, ih + 25);
}
}
public void setDescription(String description)
{
this.description = description;
repaint();
}
}
private static void initGUI()
{
JFrame frame = new JFrame();
JTable table = new JTable(new DefaultTableModel(new String[][]{
{"A", MULTILINE},
{"B", MULTILINE},
{"C", MULTILINE},
{"D", MULTILINE},
{"E", MULTILINE},
{"F", MULTILINE},
{"G", MULTILINE},
{"H", MULTILINE},
{"I", MULTILINE},
}, new String[]{"A", "B"}));
table.getColumnModel().getColumn(1).setCellRenderer(new MultilineTableCellRenderer());
JScrollPane scrollPane = new JScrollPane(table)
{
protected JViewport createViewport()
{
return new JViewport()
{
public void setViewPosition(Point p)
{
long ns1 = System.nanoTime();
super.setViewPosition(p);
long ns2 = System.nanoTime();
System.out.println((ns2 - ns1) / 1000000. + " ms");
}
};
}
};
frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(100, 100, 500, 500);
frame.setVisible(true);
}
private static class MultilineTableCellRenderer extends JTextArea implements TableCellRenderer
{
protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
private MultilineTableCellRenderer()
{
setWrapStyleWord(true);
setLineWrap(true);
setBorder(noFocusBorder);
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
{
if (isSelected)
{
super.setForeground(table.getSelectionForeground());
super.setBackground(table.getSelectionBackground());
}
else
{
super.setForeground(table.getForeground());
super.setBackground(table.getBackground());
}
setFont(table.getFont());
setBorder(noFocusBorder);
boolean enabled = table.isEnabled();
setEnabled(enabled);
setValue(table, row, column, value);
return this;
}
protected void setValue(JTable table, int row, int column, Object value)
{
if (value != null)
{
String title = value.toString();
setText(title);
View view = getUI().getRootView(this);
view.setSize((float) table.getColumnModel().getColumn(column).getWidth() - 3, -1);
float y = view.getPreferredSpan(View.Y_AXIS);
int h = (int) Math.ceil(y + 3);
if (table.getRowHeight(row) != h)
{
table.setRowHeight(row, h);
}
}
else
{
setText("");
}
}
}
}
Increasing the width or height in the constructor of the splashscreen above 150 pixels triggers the problem on my machine. This can be reproduced always, and never occurs if both sizes are smaller than 150 pixels.
Using -Dsun.java2d.d3d=false resolves the problem. The problem is resolved as soon as I remove the line g.drawString(description, 10, ih + 25); Removing the calls to the SplashScreen#setDescription method resolves the problem. Also moving the calls to SplashScreen#setDescription into EDT seems to resolve the problem.
I had the impression that calling repaint outside of the EDT is OK ( http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html ). Is this a wrong assumption?
The paint method itself seems to be called using the Thread AWT-EventQueue-0.
Operating System is Windows Vista
CheckAdaptersInfo ------------------ Adapter Ordinal : 0 Description : NVIDIA GeForce Go 7900 GS (Microsoft Corporation - WDDM) GDI Name, Driver : \\.\DISPLAY1, nvd3dum Vendor Id : 0x10de Version : 7.15.10.9746 ------------------ InitD3D: successfully created Direct3D9 object D3DGD_getDeviceCapsNative D3DPPLM::CheckDeviceCaps: device 0: Passed D3DContext::InitContext device 0 D3DContext::ConfigureContext device 0 D3DContext::ConfigureContext: successfully created device: 0 D3DContext::InitDevice: device 0 D3DContext::InitDefice: successfully initialized device 0 [V] | CAPS_DEVICE_OK [V] | CAPS_ALPHA_RT_PLAIN [V] | CAPS_ALPHA_RTT [V] | CAPS_OPAQUE_RTT [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER [V] | CAPS_MULTITEXTURE [V] | CAPS_TEXNONPOW2 [V] | CAPS_TEXNONSQUARE
1.6.0_05-ea-b04 (-Dsun.java2d.d3d=false) 5.124674 ms 0.006845 ms 4.371156 ms 0.003911 ms 3.381505 ms 0.006984 ms 4.547785 ms 0.00426 ms 5.117689 ms 0.005028 ms 7.560877 ms
1.6.0_05-ea-b04 (-Dsun.java2d.d3d=true) 60.889512 ms 0.005028 ms 158.421811 ms 0.00461 ms 119.451774 ms 0.003003 ms 0.003073 ms 0.002864 ms 0.005099 ms 125.332689 ms 0.002724 ms 0.002933 ms 0.005378 ms 110.553087 ms
Thanks, Martin
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 11, 2007 11:52 AM
in response to: til77
|
|
|
Hi Martin,
another extremely useful post, thanks a lot!
This bug is probably the cause of many complaints about Netbeans performance, too.
> Increasing the width or height in the constructor of the splashscreen above 150 pixels triggers the problem on my machine. > This can be reproduced always, and never occurs if both sizes are smaller than 150 pixels.
I could explain the 150 pixels thing - we only enable the d3d on-screen rendering for windows more than 150 pixels in any of the dimensions, but I have no idea why would drawString() matter (and it does).
But I now have a nice tight test case to work with instead of trying to figure out what's wrong with NB.
> I had the impression that calling repaint outside of the EDT is OK ( http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html ). Is this a wrong assumption?
No, you're right, you can call repaint() from anywhere.
Thanks, Dmitri Java2D Team
java2d@JAVADESKTOP.ORG wrote: > Hello, > > I found another interesting performance regression in one of my applications. > Scrolling in a JTable seems to be sluggish when I show a splashcreen first, rendering speed is good when I don't show the splashscreen or when the splashcreen does not exceed a width or height of 150 pixels. > > Test: > > import javax.swing.*;
> import javax.swing.border.Border;
> import javax.swing.border.EmptyBorder;
> import javax.swing.table.DefaultTableModel;
> import javax.swing.table.TableCellRenderer;
> import javax.swing.text.View;
> import java.awt.*;
> import java.io.IOException;
> import java.lang.reflect.InvocationTargetException;
>
> public class ScrollpaneTest
> {
>
> private static final String MULTILINE = "The following JComponent methods are safe to call from any thread: repaint(), revalidate(), and invalidate(). " +
> "The repaint() and revalidate() methods queue requests for the event-dispatching thread to call paint() and validate(), " +
> "respectively. The invalidate() method just marks a component and all of its direct ancestors as requiring validation.\n" +
> "Listener lists can be modified from any thread: It's always safe to call the addListenerTypeListener() and " +
> "removeListenerTypeListener() methods. The add/remove operations have no effect on an event dispatch that's under way." +
> "Most post-initialization GUI work naturally occurs in the event-dispatching thread. Once the GUI is visible, most " +
> "programs are driven by events such as button actions or mouse clicks, which are always handled in the event-dispatching thread.\n" +
> "\n" +
> "However, some programs need to perform non-event-driven GUI work after the GUI is visible. Here are some examples:\n" +
> "\n" +
> " * Programs that must perform a lengthy initialization operation\n" +
> " before they can be used: This kind of program should generally show some GUI while the initialization is occurring, " +
> "and then update or change the GUI. The initialization should not occur in the event-dispatching thread; otherwise, repainting " +
> "and event dispatch would stop. However, after initialization the GUI update/change should occur in the event-dispatching thread, " +
> "for thread-safety reasons.\n" +
> " \n" +
> " * Programs whose GUI must be updated as the result of non-AWT events: For example, suppose a server program can get requests " +
> "from other programs that might be running on different machines. These requests can come at any time, and they result in one of " +
> "the server's methods being invoked in some possibly unknown thread. How can that method update the GUI? By executing the GUI update " +
> "code in the event-dispatching thread.\n" +
> "\n" +
> "The SwingUtilities class provides two methods to help you run code in the event-dispatching thread:\n" +
> "\n" +
> " * invokeLater(): Requests that some code be executed in the event-dispatching thread. This method returns immediately, without " +
> "waiting for the code to execute.\n" +
> " \n" +
> " * invokeAndWait(): Acts like invokeLater(), except that this method waits for the code to execute. As a rule, you should use " +
> "invokeLater() instead of this method.\n" +
> "\n" +
> "This page gives you some examples of using this API. Also see the BINGO example in The Java Tutorial, especially the following " +
> "classes: CardWindow, ControlPane, Player, and OverallStatusPane. ";
>
>
> public static void main(String[] args) throws IOException, InterruptedException, InvocationTargetException
> {
> final SplashScreen[] splashScreens = new SplashScreen[1];
> EventQueue.invokeAndWait(new Runnable()
> {
> public void run()
> {
> splashScreens[0] = new SplashScreen();
> splashScreens[0].setVisible(true);
> }
> });
>
> splashScreens[0].setDescription("loading");
> Thread.sleep(300);
> splashScreens[0].setDescription("loading more");
> Thread.sleep(300);
> splashScreens[0].setDescription("loading almost done");
> Thread.sleep(300);
>
> EventQueue.invokeLater(new Runnable()
> {
> public void run()
> {
> splashScreens[0].dispose();
> initGUI();
> }
> });
> }
>
>
> private static class SplashScreen extends Window
> {
> private String description;
> private int iw;
> private int ih;
>
>
> private SplashScreen()
> {
> super(null);
>
> iw = 151;//150=fast, 151=slow
> ih = 120;
>
> setSize(iw, ih + 30);
> Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
> setLocation((screen.width - iw) / 2, (screen.height - ih + 30) / 2);
> }
>
>
> public void paint(Graphics g)
> {
> g.setColor(Color.BLACK);
> g.fillRect(0, ih, getWidth(), 30);
> g.setColor(Color.WHITE);
> if (description != null)
> {
> System.out.println(Thread.currentThread().getName());
> g.drawString(description, 10, ih + 25);
> }
> }
>
>
> public void setDescription(String description)
> {
> this.description = description;
> repaint();
> }
> }
>
>
> private static void initGUI()
> {
> JFrame frame = new JFrame();
>
> JTable table = new JTable(new DefaultTableModel(new String[][]{
> {"A", MULTILINE},
> {"B", MULTILINE},
> {"C", MULTILINE},
> {"D", MULTILINE},
> {"E", MULTILINE},
> {"F", MULTILINE},
> {"G", MULTILINE},
> {"H", MULTILINE},
> {"I", MULTILINE},
> }, new String[]{"A", "B"}));
>
> table.getColumnModel().getColumn(1).setCellRenderer(new MultilineTableCellRenderer());
>
> JScrollPane scrollPane = new JScrollPane(table)
> {
> protected JViewport createViewport()
> {
> return new JViewport()
> {
> public void setViewPosition(Point p)
> {
> long ns1 = System.nanoTime();
> super.setViewPosition(p);
> long ns2 = System.nanoTime();
> System.out.println((ns2 - ns1) / 1000000. + " ms");
> }
> };
> }
> };
>
> frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
>
> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> frame.setBounds(100, 100, 500, 500);
> frame.setVisible(true);
> }
>
>
> private static class MultilineTableCellRenderer extends JTextArea implements TableCellRenderer
> {
> protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
>
>
> private MultilineTableCellRenderer()
> {
> setWrapStyleWord(true);
> setLineWrap(true);
>
> setBorder(noFocusBorder);
> }
>
>
> public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
> {
>
> if (isSelected)
> {
> super.setForeground(table.getSelectionForeground());
> super.setBackground(table.getSelectionBackground());
> }
> else
> {
> super.setForeground(table.getForeground());
> super.setBackground(table.getBackground());
> }
>
> setFont(table.getFont());
>
> setBorder(noFocusBorder);
>
> boolean enabled = table.isEnabled();
> setEnabled(enabled);
> setValue(table, row, column, value);
> return this;
> }
>
>
> protected void setValue(JTable table, int row, int column, Object value)
> {
> if (value != null)
> {
> String title = value.toString();
> setText(title);
>
> View view = getUI().getRootView(this);
> view.setSize((float) table.getColumnModel().getColumn(column).getWidth() - 3, -1);
> float y = view.getPreferredSpan(View.Y_AXIS);
> int h = (int) Math.ceil(y + 3);
>
> if (table.getRowHeight(row) != h)
> {
> table.setRowHeight(row, h);
> }
> }
> else
> {
> setText("");
> }
> }
> }
> }
>
>
> > > Increasing the width or height in the constructor of the splashscreen above 150 pixels triggers the problem on my machine. > This can be reproduced always, and never occurs if both sizes are smaller than 150 pixels. > > Using -Dsun.java2d.d3d=false resolves the problem. > The problem is resolved as soon as I remove the line g.drawString(description, 10, ih + 25); > Removing the calls to the SplashScreen#setDescription method resolves the problem. Also moving the calls to SplashScreen#setDescription into EDT seems to resolve the problem. > > I had the impression that calling repaint outside of the EDT is OK ( http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html ). Is this a wrong assumption? > > The paint method itself seems to be called using the Thread AWT-EventQueue-0. > > Operating System is Windows Vista > > CheckAdaptersInfo > ------------------ > Adapter Ordinal : 0 > Description : NVIDIA GeForce Go 7900 GS (Microsoft Corporation - WDDM) > GDI Name, Driver : \\.\DISPLAY1, nvd3dum > Vendor Id : 0x10de > Version : 7.15.10.9746 > ------------------ > InitD3D: successfully created Direct3D9 object > D3DGD_getDeviceCapsNative > D3DPPLM::CheckDeviceCaps: device 0: Passed > D3DContext::InitContext device 0 > D3DContext::ConfigureContext device 0 > D3DContext::ConfigureContext: successfully created device: 0 > D3DContext::InitDevice: device 0 > D3DContext::InitDefice: successfully initialized device 0 > [V] | CAPS_DEVICE_OK > [V] | CAPS_ALPHA_RT_PLAIN > [V] | CAPS_ALPHA_RTT > [V] | CAPS_OPAQUE_RTT > [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER > [V] | CAPS_MULTITEXTURE > [V] | CAPS_TEXNONPOW2 > [V] | CAPS_TEXNONSQUARE > > > 1.6.0_05-ea-b04 (-Dsun.java2d.d3d=false) > 5.124674 ms > 0.006845 ms > 4.371156 ms > 0.003911 ms > 3.381505 ms > 0.006984 ms > 4.547785 ms > 0.00426 ms > 5.117689 ms > 0.005028 ms > 7.560877 ms > > > 1.6.0_05-ea-b04 (-Dsun.java2d.d3d=true) > 60.889512 ms > 0.005028 ms > 158.421811 ms > 0.00461 ms > 119.451774 ms > 0.003003 ms > 0.003073 ms > 0.002864 ms > 0.005099 ms > 125.332689 ms > 0.002724 ms > 0.002933 ms > 0.005378 ms > 110.553087 ms > > > Thanks, > Martin > [Message sent by forum member 'til77' (til77)] > > http://forums.java.net/jive/thread.jspa?messageID=239487 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 11, 2007 3:10 PM
in response to: Dmitri Trembove...
|
|
|
Hello,
Dmitri Trembovetski wrote: > > Increasing the width or height in the constructor of the splashscreen > above 150 pixels triggers the problem on my > machine. > > This can be reproduced always, and never occurs if both sizes are > smaller than 150 pixels. > > I could explain the 150 pixels thing - we only enable > the d3d on-screen rendering for windows more than 150 > pixels in any of the dimensions, but I have no idea > why would drawString() matter (and it does).
OK, I figured it out. The problem basically boils down to what kind of text is rendered by the application first - lcd antialiased or regular grayscale AA.
Depending on that we create a glyph cache in video memory where we cache glyphs to be rendered.
If the first text to be rendered happens to be grayscale AA - the cache will be initialized for grayscale glyphs, otherwise - LCD. And since we don't switch from one cache type to another if first you rendered a single grayscale AA glyph, all following LCD-AA glyphs will be rendered without the use of cache which is slow..
And if the first window is created < 150 pixels we do not use the d3d pipeline for rendering to such window so it doesn't matter what kind of text is rendered there - the rest of Swing renders using LCD AA.
I am pretty sure it is the same problem with netbeans.
Now I'll need to come up with the fix - probably different caches for lcd and grayscale glyphs.
Thanks, Dmitri Java2D Team
===
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 31, 2007 2:38 PM
in response to: Dmitri Trembove...
|
|
|
Dmitri
I tried the release and had got all kind of paint-related problems in my java xmleditor. They did occur especially with bigger files A few examples: - My textpane is not painted correctly: when I drag with my mouse over the text I got all kind of repaint problems. The backgroundcolor gets gray. - I also use a treetable, and the expansion of nodes gives a totally distorted result.
Configuration Systeem Windows XP Pro SP2 HP Compaq
I verified that it works well after disabling using the -Dsun.java2d.d3d=false property.
This is the trace
CheckAdaptersInfo ------------------ Adapter Ordinal : 0 Description : Intel(R) 82945G Express Chipset Family GDI Name, Driver : \\.\DISPLAY1, ialmrnt5.dll Vendor Id : 0x8086 Version : 6.14.10.4308 ------------------ InitD3D: successfully created Direct3D9 object D3DGD_getDeviceCapsNative D3DPPLM::CheckDeviceCaps: device 0: Passed D3DContext::InitContext device 0 D3DContext::ConfigureContext device 0 D3DContext::ConfigureContext: successfully created device: 0 D3DContext::InitDevice: device 0 [W] D3DContext::InitDevice: sync query not available D3DContext::InitDefice: successfully initialized device 0 [V] | CAPS_DEVICE_OK [V] | CAPS_ALPHA_RT_PLAIN [V] | CAPS_ALPHA_RTT [V] | CAPS_OPAQUE_RTT [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER [V] | CAPS_MULTITEXTURE [V] | CAPS_TEXNONSQUARE
Loading XMLSpear LookAndFeel com.sun.java.swing.plaf.windows.WindowsLookAndFeel propert with name homepage not found. default homepage is used os.name = Windows XP os.version = 5.1 java.version = 1.6.0_05-ea java.vendor = Sun Microsystems Inc. java.compiler = null Thanks Dick Deneer
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Oct 31, 2007 2:45 PM
in response to: deneer
|
|
|
Hi Dick,
thanks for the info.
java2d@JAVADESKTOP.ORG wrote: > I tried the release and had got all kind of paint-related problems in my java xmleditor. They did occur especially with bigger files A few examples: > - My textpane is not painted correctly: when I drag with my mouse over the text I got all kind of repaint problems. The backgroundcolor gets gray. > - I also use a treetable, and the expansion of nodes gives a totally distorted result. >
You're seeing this because your chip is Intel 945G. We've seen many reports about problems on this chipset: 6612195: D3D: Netbeans editor is completely unusable with JDK 6uN [Intel 945G] 6599742: D3D: Text rendering becomes garbled on Intel 945G chipset
Which is why we will (as of b07) disable the pipeline on Intel 945G.
Interestingly, it is likely that you will see a performance improvement because of that - the chip is that bad =)
The 965G chipset is better (HW transforms, hw pixel shaders), but the drivers still have some issues, and performance is not stellar: 6620073: D3D: running J2DBench restarts the driver on Vista [Intel G965]
We're working with Intel on this bug as well as performance issues, they may have a fix in time. Until they do the pipeline will be disabled on 965G as well.
As a workaround for now you can set -Dsun.java2d.d3d=false (in Java Control Panel, for example).
Thank you, Dmitri Java2D Team
> Configuration > Systeem Windows XP Pro SP2 > HP Compaq > > I verified that it works well after disabling using the -Dsun.java2d.d3d=false property. > > This is the trace > > CheckAdaptersInfo > ------------------ > Adapter Ordinal : 0 > Description : Intel(R) 82945G Express Chipset Family > GDI Name, Driver : \\.\DISPLAY1, ialmrnt5.dll > Vendor Id : 0x8086 > Version : 6.14.10.4308 > ------------------ > InitD3D: successfully created Direct3D9 object > D3DGD_getDeviceCapsNative > D3DPPLM::CheckDeviceCaps: device 0: Passed > D3DContext::InitContext device 0 > D3DContext::ConfigureContext device 0 > D3DContext::ConfigureContext: successfully created device: 0 > D3DContext::InitDevice: device 0 > [W] D3DContext::InitDevice: sync query not available > D3DContext::InitDefice: successfully initialized device 0 > [V] | CAPS_DEVICE_OK > [V] | CAPS_ALPHA_RT_PLAIN > [V] | CAPS_ALPHA_RTT > [V] | CAPS_OPAQUE_RTT > [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER > [V] | CAPS_MULTITEXTURE > [V] | CAPS_TEXNONSQUARE > > Loading XMLSpear > LookAndFeel com.sun.java.swing.plaf.windows.WindowsLookAndFeel > propert with name homepage not found. > default homepage is used > os.name = Windows XP > os.version = 5.1 > java.version = 1.6.0_05-ea > java.vendor = Sun Microsystems Inc. > java.compiler = null > > Thanks > Dick Deneer > [Message sent by forum member 'deneer' (deneer)] > > http://forums.java.net/jive/thread.jspa?messageID=243217 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 5, 2007 6:44 PM
in response to: Dmitri Trembove...
|
|
|
I am getting artifacts on the Netbeans editor (as mentioned in a bug posted earlier in this thread). Unfortunately I don't know where the trace output goes when running Netbeans.
java version "1.6.0_05-ea" Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b06) Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b06, mixed mode, sharing)
Windows XP
Details about my display adaptor
Intel(R) Graphics Media Accelerator Driver for Mobile Report
Report Date: 11/05/2007 Report Time[hr:mm:ss]: 18:34:57 Driver Version: 6.14.10.4764 Operating System: Windows XP* Professional, Service Pack 2 (5.1.2600) Default Language: English DirectX* Version: 9.0 Physical Memory: 2038 MB Minimum Graphics Memory: 8 MB Maximum Graphics Memory: 128 MB Graphics Memory in Use: 65 MB Processor: x86 family 6 Model 13 Stepping 8 Processor Speed: 1861 MHZ Vendor ID: 8086 Device ID: 2592 Device Revision: 03
* Accelerator Information *
Accelerator in Use: Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family Video BIOS: 1239 Current Graphics Mode: 1400 by 1050 True Color (60 Hz)
* Devices Connected to the Graphics Accelerator *
Active Monitors: 1 Active Notebook Displays: 1
* Monitor *
Monitor Name: Plug and Play Monitor Display Type: Analog Gamma Value: 2.20 DDC2 Protocol: Supported Maximum Image Size: Horizontal: 14.0 inches Vertical: 11.0 inches Monitor Supported Modes: 640 by 480 (60 Hz) 640 by 480 (67 Hz) 640 by 480 (72 Hz) 640 by 480 (75 Hz) 720 by 400 (70 Hz) 800 by 600 (56 Hz) 800 by 600 (60 Hz) 800 by 600 (72 Hz) 800 by 600 (75 Hz) 832 by 624 (75 Hz) 1024 by 768 (60 Hz) 1024 by 768 (70 Hz) 1024 by 768 (75 Hz) 1152 by 864 (75 Hz) 1152 by 870 (75 Hz) 1280 by 1024 (60 Hz) 1280 by 1024 (72 Hz) 1280 by 1024 (75 Hz) Display Power Management Support: Standby Mode: Supported Suspend Mode: Supported Active Off Mode: Supported
* Notebook *
Monitor Name: Wide viewing angle & High density FlexView Display 1400x1050 Display Type: Digital Gamma Value: 3.54 DDC2 Protocol: Supported Maximum Image Size: Horizontal: Not Available Vertical: Not Available Monitor Supported Modes: 1400 by 1050 (50 Hz) 1400 by 1050 (60 Hz) Display Power Management Support: Standby Mode: Not Supported Suspend Mode: Not Supported Active Off Mode: Supported
* Other names and brands are the property of their respective owners.
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 7, 2007 3:02 PM
in response to: atehrani
|
|
|
Yes, this issue on Intel chips will be addressed in b07.
Thanks, Dmitri
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 19, 2007 9:52 AM
in response to: atehrani
|
|
|
Thanks, this is a known issue. It is addressed in the latest available build (b07).
Also, regarding the output - you don't necessarily need to start Netbeans to get debug printout, just use any of the jdk demos, for example (SwingSet2).
Thanks, Dmitri
java2d@JAVADESKTOP.ORG wrote: > I am getting artifacts on the Netbeans editor (as mentioned in a bug posted earlier in this thread). Unfortunately I don't know where the trace output goes when running Netbeans. > > java version "1.6.0_05-ea" > Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b06) > Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b06, mixed mode, sharing) > > Windows XP > > Details about my display adaptor > > Intel(R) Graphics Media Accelerator Driver for Mobile Report > > > Report Date: 11/05/2007 > Report Time[hr:mm:ss]: 18:34:57 > Driver Version: 6.14.10.4764 > Operating System: Windows XP* Professional, Service Pack 2 (5.1.2600) > Default Language: English > DirectX* Version: 9.0 > Physical Memory: 2038 MB > Minimum Graphics Memory: 8 MB > Maximum Graphics Memory: 128 MB > Graphics Memory in Use: 65 MB > Processor: x86 family 6 Model 13 Stepping 8 > Processor Speed: 1861 MHZ > Vendor ID: 8086 > Device ID: 2592 > Device Revision: 03 > > > * Accelerator Information * > > Accelerator in Use: Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family > Video BIOS: 1239 > Current Graphics Mode: 1400 by 1050 True Color (60 Hz) > > > > * Devices Connected to the Graphics Accelerator * > > > Active Monitors: 1 > Active Notebook Displays: 1 > > > * Monitor * > > Monitor Name: Plug and Play Monitor > Display Type: Analog > Gamma Value: 2.20 > DDC2 Protocol: Supported > Maximum Image Size: Horizontal: 14.0 inches > Vertical: 11.0 inches > Monitor Supported Modes: > 640 by 480 (60 Hz) > 640 by 480 (67 Hz) > 640 by 480 (72 Hz) > 640 by 480 (75 Hz) > 720 by 400 (70 Hz) > 800 by 600 (56 Hz) > 800 by 600 (60 Hz) > 800 by 600 (72 Hz) > 800 by 600 (75 Hz) > 832 by 624 (75 Hz) > 1024 by 768 (60 Hz) > 1024 by 768 (70 Hz) > 1024 by 768 (75 Hz) > 1152 by 864 (75 Hz) > 1152 by 870 (75 Hz) > 1280 by 1024 (60 Hz) > 1280 by 1024 (72 Hz) > 1280 by 1024 (75 Hz) > Display Power Management Support: > Standby Mode: Supported > Suspend Mode: Supported > Active Off Mode: Supported > > > * Notebook * > > Monitor Name: Wide viewing angle & High density FlexView Display 1400x1050 > Display Type: Digital > Gamma Value: 3.54 > DDC2 Protocol: Supported > Maximum Image Size: Horizontal: Not Available > Vertical: Not Available > Monitor Supported Modes: > 1400 by 1050 (50 Hz) > 1400 by 1050 (60 Hz) > Display Power Management Support: > Standby Mode: Not Supported > Suspend Mode: Not Supported > Active Off Mode: Supported > > * Other names and brands are the property of their respective owners. > [Message sent by forum member 'atehrani' (atehrani)] > > http://forums.java.net/jive/thread.jspa?messageID=243985 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 13, 2007 10:22 AM
in response to: Dmitri Trembove...
|
|
|
Hello,
I've been playing a few hours with the 6u5 and the D3D pipeline. (I'm quite sure it is enabled, as a full-screen drawing framerate drops by a factor of about 20 when disabled, with CPU usage jumping to about 70%)
Marvelous performance (thank you all for your work), however I have found something annoying :
(I did my tests on Windows Vista, with an nVidia GeForce 8600M GT, recent drivers (Aero enabled))
If I create an empty resizable JFrame (I tested with SystemLookAndFeel, SubstanceLookAndFeel and Metal), and start resizing it, I will most of the time see its content flickering (the client rectangle becoming black before being repainted).
Obviously, all reverted to normal when I ran the application with -Dsun.java2d.d3d=false.
Someone has an idea about what is happening ?
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 26, 2007 9:07 AM
in response to: artscoop
|
|
|
Just in case this hadn't been replied to: yes, we'd seen this behavior on certain video boards only on Vista with Aero enabled.
I'm pretty sure this is a Vista bug, but we'll try to work around it.
Thanks, Dmitri
java2d@JAVADESKTOP.ORG wrote: > Hello, > > I've been playing a few hours with the 6u5 and the D3D pipeline. > (I'm quite sure it is enabled, as a full-screen drawing framerate drops by a factor of about 20 when disabled, with CPU usage jumping to about 70%) > > Marvelous performance (thank you all for your work), however I have found something annoying : > > (I did my tests on Windows Vista, with an nVidia GeForce 8600M GT, recent drivers (Aero enabled)) > > > If I create an empty resizable JFrame (I tested with SystemLookAndFeel, SubstanceLookAndFeel and Metal), and start resizing it, I will most of the time see its content flickering (the client rectangle becoming black before being repainted). > > Obviously, all reverted to normal when I ran the application with -Dsun.java2d.d3d=false. > > Someone has an idea about what is happening ? > [Message sent by forum member 'artscoop' (artscoop)] > > http://forums.java.net/jive/thread.jspa?messageID=245249 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA-- another stupid question...
Posted:
Nov 26, 2007 10:35 AM
in response to: Dmitri Trembove...
|
|
|
I thought the first notice that was sent out about the D3D pipeline said that the OpenGl pipeline was turned on for D3D.
I must have misunderstood what was said. The D3D pipeline and the OpenGL pipelines are two different pipelines with two entirely different sets of problems mostly caused by poorly implemented video card drivers. Am I finally understanding this?
And the OpenGL pipeline has nothing to do with the hardware acceleration of Java2D which uses the D3D pipeline? Is that correct?
So it was said that the D3D pipeline will be disabled *BY DEFAULT* on some OS's. Will it be possible to *ENABLE* the D3D pipeline with -Dsun.java2d.d3d=true on the Win200* OS's that are going to have the D3D pipeline disabled by default from using the D3D pipeline?
In all the emails that have been flying around, people talk of "...the pipeline..." and I get confused about which pipeline is being talked about.
Dmitri Trembovetski wrote: > Just in case this hadn't been replied to: > yes, we'd seen this behavior on certain video boards > only on Vista with Aero enabled. > > I'm pretty sure this is a Vista bug, but we'll > try to work around it. > > Thanks, > Dmitri > > > java2d@JAVADESKTOP.ORG wrote: > >> Hello, >> >> I've been playing a few hours with the 6u5 and the D3D pipeline. >> (I'm quite sure it is enabled, as a full-screen drawing framerate >> drops by a factor of about 20 when disabled, with CPU usage jumping >> to about 70%) >> >> Marvelous performance (thank you all for your work), however I have >> found something annoying : >> >> (I did my tests on Windows Vista, with an nVidia GeForce 8600M GT, >> recent drivers (Aero enabled)) >> >> >> If I create an empty resizable JFrame (I tested with >> SystemLookAndFeel, SubstanceLookAndFeel and Metal), and start resizing >> it, I will most of the time see its content flickering (the client >> rectangle becoming black before being repainted). >> >> Obviously, all reverted to normal when I ran the application with >> -Dsun.java2d.d3d=false. >> >> Someone has an idea about what is happening ? >> [Message sent by forum member 'artscoop' (artscoop)] >> >> http://forums.java.net/jive/thread.jspa?messageID=245249 >> >> =========================================================================== >> >> To unsubscribe, send email to listserv@java.sun.com and include in the >> body >> of the message "signoff JAVA2D-INTEREST". For general help, send >> email to >> listserv@java.sun.com and include in the body of the message "help". > > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help". > >
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA-- another stupid question...
Posted:
Nov 26, 2007 10:40 AM
in response to: Ken Warner
|
|
|
Ken Warner wrote: > I thought the first notice that was sent out about the D3D pipeline said > that the OpenGl pipeline was turned on for D3D.
"the OpenGl pipeline was turned on for D3D" - this doesn't make any sense. Not sure how something like this can be concluded from what have been written.
> I must have misunderstood what was said. The D3D pipeline and > the OpenGL pipelines are two different pipelines with two > entirely different sets of problems mostly caused by poorly > implemented video card drivers. Am I finally understanding > this?
Yes.
> And the OpenGL pipeline has nothing to do with the hardware > acceleration of Java2D which uses the D3D pipeline? Is that correct?
Yes.
> So it was said that the D3D pipeline will be disabled *BY DEFAULT* > on some OS's. Will it be possible to *ENABLE* the D3D pipeline with > -Dsun.java2d.d3d=true on the Win200* OS's that are going to have > the D3D pipeline disabled by default from using the D3D pipeline?
The D3D pipeline is enabled by default on all platforms. That means that it will try to get initialized on all systems during the startup. However, as a part of the initialization process it will check for the driver and operating system requirements, as well as hardware capabilities. If any of these checks fail the pipeline will not be used.
Currently the check for OS will fail on server class operating systems, so the pipeline will not be used.
Unfortunately you will not be able to force it using -Dsun.java2d.d3d=true .
> In all the emails that have been flying around, people talk of > "...the pipeline..." and I get confused about which pipeline > is being talked about.
Depends on the context, of course, but at least in this thread it is most likely in reference to the Direct3D pipeline.
Thank you, Dmitri
> > > Dmitri Trembovetski wrote: >> Just in case this hadn't been replied to: >> yes, we'd seen this behavior on certain video boards >> only on Vista with Aero enabled. >> >> I'm pretty sure this is a Vista bug, but we'll >> try to work around it. >> >> Thanks, >> Dmitri >> >> >> java2d@JAVADESKTOP.ORG wrote: >> >>> Hello, >>> >>> I've been playing a few hours with the 6u5 and the D3D pipeline. >>> (I'm quite sure it is enabled, as a full-screen drawing framerate >>> drops by a factor of about 20 when disabled, with CPU usage jumping >>> to about 70%) >>> >>> Marvelous performance (thank you all for your work), however I have >>> found something annoying : >>> >>> (I did my tests on Windows Vista, with an nVidia GeForce 8600M GT, >>> recent drivers (Aero enabled)) >>> >>> >>> If I create an empty resizable JFrame (I tested with >>> SystemLookAndFeel, SubstanceLookAndFeel and Metal), and start >>> resizing it, I will most of the time see its content flickering (the >>> client rectangle becoming black before being repainted). >>> >>> Obviously, all reverted to normal when I ran the application with >>> -Dsun.java2d.d3d=false. >>> >>> Someone has an idea about what is happening ? >>> [Message sent by forum member 'artscoop' (artscoop)] >>> >>> http://forums.java.net/jive/thread.jspa?messageID=245249 >>> >>> =========================================================================== >>> >>> To unsubscribe, send email to listserv@java.sun.com and include in >>> the body >>> of the message "signoff JAVA2D-INTEREST". For general help, send >>> email to >>> listserv@java.sun.com and include in the body of the message "help". >> >> >> =========================================================================== >> >> To unsubscribe, send email to listserv@java.sun.com and include in the >> body >> of the message "signoff JAVA2D-INTEREST". For general help, send >> email to >> listserv@java.sun.com and include in the body of the message "help". >> >> > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA-
Posted:
Nov 26, 2007 2:56 PM
in response to: Dmitri Trembove...
|
|
|
> Unfortunately you will not be able to force it > using -Dsun.java2d.d3d=true . Couldn't this be changed at least for the operating-system checks? If someone specifies d3d he really wants D3D enabled, otherwise he/she would not specify it, or sun.java2d.d3d=true/false/force?
This is like taking away the power of descision away from the user which could make some users quite angry :-/
lg Clemens
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA-
Posted:
Nov 26, 2007 4:02 PM
in response to: linuxhippy
|
|
|
java2d@JAVADESKTOP.ORG wrote: >> Unfortunately you will not be able to force it >> using -Dsun.java2d.d3d=true . > Couldn't this be changed at least for the operating-system checks? > If someone specifies d3d he really wants D3D enabled, otherwise he/she would not specify it, or sun.java2d.d3d=true/false/force? > > This is like taking away the power of descision away from the user which could make some users quite angry :-/
There is a way to ignore the results of the hw checks and force the use of the pipeline, just not via the -D property but via special env. variable.
We'd like not to expose this unless really necessary because if people start just setting a property left and right (as they can or will be able to with the webstart or applet) - their users may pay for it, because on some systems the drivers can bluescreen the system.
Thank you, Dmitri
> > lg Clemens > [Message sent by forum member 'linuxhippy' (linuxhippy)] > > http://forums.java.net/jive/thread.jspa?messageID=247249 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 8:44 AM
in response to: Dmitri Trembove...
|
|
|
Most of my application works great with the changes but I did find that custom painting in charts is broken throughout the application.
Rendering artifacts occur in my custom charts and in JFreeChart charts as well. The artifacts go away when I disable the new pipeline.
Here is the trace output: CheckAdaptersInfo ------------------ Adapter Ordinal : 0 Adapter Handle : 0x10001 Description : NVIDIA Quadro NVS 110M GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll Vendor Id : 0x10de Device Id : 0x1d7 SubSys Id : 0x1c21028 Driver Version : 6.14.10.8313 GUID : D7B71E3E-4297-11CF-E153C82100C2CB35 ------------------ InitD3D: successfully created Direct3D9 object D3DGD_getDeviceCapsNative D3DPPLM::CheckDeviceCaps: adapter 0: Passed D3DContext::InitContext device 0 D3DContext::ConfigureContext device 0 D3DContext::ConfigureContext: successfully created device: 0 D3DContext::InitDevice: device 0 D3DContext::InitDefice: successfully initialized device 0 [V] | CAPS_DEVICE_OK [V] | CAPS_ALPHA_RT_PLAIN [V] | CAPS_ALPHA_RTT [V] | CAPS_OPAQUE_RTT [V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER [V] | CAPS_MULTITEXTURE [V] | CAPS_TEXNONPOW2 [V] | CAPS_TEXNONSQUARE
Here is source for a pie chart component that exhibits the problem:
import java.awt.BasicStroke; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.geom.Arc2D; import java.awt.geom.Ellipse2D; import java.util.ArrayList;
import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.ToolTipManager; import javax.swing.UIManager;
public class SimplePieChart extends JPanel { private ArrayList<Slice> slices; private Color lineColor; private Color noDataColor;
public SimplePieChart() { super(); lineColor = Color.black; noDataColor = Color.gray; slices = new ArrayList<Slice>(); setOpaque(false); setPreferredSize(new Dimension(100, 100)); ToolTipManager.sharedInstance().registerComponent(this); }
public void addSlice(String id, String tooltip, double value, Color color) { insertSlice(new Slice(id, tooltip, value, color)); updateAngles(); }
public void paint(Graphics g) { super.paint(g); Graphics2D g2 = (Graphics2D) g; Rectangle bounds = getBounds(); g2.setStroke(new BasicStroke(.5f)); g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); for(Slice s : slices) { g2.setColor(s.color); Arc2D.Double arc = new Arc2D.Double( 0, 0, bounds.width - 1, bounds.height - 1, s.startAngle, s.extentAngle, Arc2D.PIE); g2.fill(arc); } Ellipse2D circle = new Ellipse2D.Double(0, 0, bounds.width - 1, bounds.height - 1); if(slices.size() == 0) { g2.setColor(noDataColor); g2.fill(circle); } g2.setColor(lineColor); g2.draw(circle); }
private void insertSlice(Slice slice) { boolean inserted = false; for(int i = 0; i < slices.size(); i++) { Slice s = slices.get(i); if(slice.value > s.value) { slices.add(i, slice); inserted = true; break; } } if(!inserted) slices.add(slice); }
private void updateAngles() { double total = 0; for(Slice s : slices) { total += s.value; } double start = 0; for(Slice s : slices) { s.startAngle = start; s.extentAngle = 360 * s.value / total; start += s.extentAngle; } }
private class Slice { public String id; public String tooltip; public double value; public Color color; public double startAngle; public double extentAngle; public Slice(String id, String tooltip, double value, Color color) { this.id = id; this.tooltip = tooltip; this.value = value; this.color = color; } }
public static void main(String[] args) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); SimplePieChart chart = new SimplePieChart(); chart.addSlice("red", "red", 30, new Color(244, 130, 42)); chart.addSlice("yellow", "yellow", 20, new Color(243, 210, 90)); chart.addSlice("green", "green", 1, new Color(210, 13, 12)); chart.addSlice("blue", "blue", 1, new Color(143, 70, 149)); chart.repaint(); frame.add(chart, BorderLayout.CENTER); frame.setSize(new Dimension(400, 400)); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }
- Samuel Crank
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 9:31 AM
in response to: sjcrank
|
|
|
Thanks for your report.
What exactly is broken - what kind of artifacts you're seeing? Do you have to do something special in order for it to reproduce (like move the window around, or expose it)
Could you please send me a screenshot? (tdv at sun dot com)
I can't reproduce this on my Nvidia machine (albeit with a different board).
Thanks, Dmitri
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 10:21 AM
in response to: sjcrank
|
|
|
Also, could you try updating the driver? The latest driver is 6.14.11.6375 on my system.
Dmitri
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 10:32 AM
in response to: trembovetski
|
|
|
nvidia does not list a driver for my card Quadro NVS 110M and I am hesitant to install a driver that is not advertised by nvidia to be compatible with my card.
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 12:34 PM
in response to: trembovetski
|
|
|
After further investigation I found the necessary driver on the Dell website. After updating the graphics problems went away.
Thanks for the help.
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 1:17 PM
in response to: sjcrank
|
|
|
Thanks!
I have filed bug 6629891: D3D: Rendering artifacts with older driver [Nvidia Quadro NVS 110M] to track this issue (will appear on bugs.sun.com soon).
We'll disable the pipeline on drivers older than 6.14.11.5665 (earliest known to work at this point).
Thanks, Dmitri
|
|
|
|
|
|
|
|
Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 4:31 PM
in response to: trembovetski
|
|
|
I have an NVida GeForce2 GTS/GeForce2 Pro Driver Version 3.15.00.12.00 Running Windows 2000 SP4 and DirectDraw 9.0c -- real old stuff and yet the most current version of the driver and Java 1.6 is about 3 times faster than 1.5.
It's hard for me to run the beta version to test hardware acceleration.
Have their been any reports about this card failing? When will there be a 1.6 JRE with hardware acceleration so I can try my work -- it's an applet.
java2d@JAVADESKTOP.ORG wrote: > Thanks! > > I have filed bug > 6629891: D3D: Rendering artifacts with older driver [Nvidia Quadro NVS 110M] > to track this issue (will appear on bugs.sun.com soon). > > We'll disable the pipeline on drivers older than 6.14.11.5665 (earliest known > to work at this point). > > Thanks, > Dmitri > [Message sent by forum member 'trembovetski' (trembovetski)] > > http://forums.java.net/jive/thread.jspa?messageID=245499 > > =========================================================================== > To unsubscribe, send email to listserv@java.sun.com and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > listserv@java.sun.com and include in the body of the message "help". > >
=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".
|
|
|
|
|
|
|
|
Re: Please try the new Direct3D 9-based Java2D pipeline in 6uN EA
Posted:
Nov 14, 2007 10:24 AM
in response to: Dmitri Trembove...
|
|
|
Screenshots have been sent.
|
|
|
|
|