Re: [JAVA2D] How to detect hardware acceleration?
Hardware info for the older machine: [code] [I] OS Version = OS_WINXP Pro [I] CheckAdaptersInfo [I] -- [I] Adapter Ordinal : 0 [I] Adapter Handle : 0x10001 [I] Description : NVIDIA GeForce2 MX/MX 400 (Microsoft Corporation) [I] GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll [I] Vendor Id: 0x10de [I] Device Id: 0x0110 [I] SubSys Id: 0x88171462 [I] Driver Version : 6.14.10.5673 [I] GUID : {D7B71E3E-4250-11CF-FB61-1DA813C2CB35} [E] D3DPPLM::CheckDeviceCaps: adapter 0: Failed (pixel shaders 2.0 required) [I] -- [E] D3DPPLM::CheckAdaptersInfo: no suitable adapters found [E] InitD3D: failed to init adapters [/code] On the modern Vista machine the test app works also fine if I disable d3d support (sun.java2d.d3d=false) even if this causes a higher CPU utilization. [Message sent by forum member 'wzberger' (wzberger)] http://forums.java.net/jive/thread.jspa?messageID=286677 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA2D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA2D] Null pointer when using paintComponent and html text in JButton
[EMAIL PROTECTED] wrote: I have found a solution or work around for my own question. The exception is thrown in Rectangle.intersect(Rectangle r) that was called with a null parameter as a result of BoxView.paint getting a null pointer back from g.getClipBounds(). As a workaround I have changed my paintComponents method as follows: /// public void paintComponent(Graphics g) { super.paintComponent(g); if (isEnabled()) { return; } BufferedImage buf = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); Graphics2D g2 = (Graphics2D) buf.getGraphics(); g2.setClip(g.getClip()); // Simply copy the clip super.paintComponent(g2); float[] my_kernel = { 0.10f, 0.10f, 0.10f, 0.10f, 0.20f, 0.10f, 0.10f,0.10f, 0.10f }; ConvolveOp op = new ConvolveOp(new Kernel(3, 3, my_kernel)); Image img = op.filter(buf, null); g.drawImage(img, 0, 0, null); g2.dispose(); } One question remains, is this a bug in the Java2D or my programming error? I'd say it may be a bug in javax.text code - they don't expect a null clip. Also, a suggestion on your code. I'm not sure if it's just for illustration, but I would suggest not to create a new image on each repaint as you do currently. You should only create a new image if the size of the component changed (or if you have some other attributes like text that can change). Thanks, Dmitri === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA2D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA2D] How to detect hardware acceleration?
That is indeed a rather old board. I think it may not be the board that's slow but the bus between the cpu and vram - since non-opaque window send a bunch of data on every repaint from system memory to vram, the bus speed is very important. The only suggestion I have is to provide the user with the ability to turn off the effects. So if it's really slow (perhaps you can detect it yourself, too - time the repaints), then turn them off. Thanks, Dmitri [EMAIL PROTECTED] wrote: Hardware info for the older machine: [code] [I] OS Version = OS_WINXP Pro [I] CheckAdaptersInfo [I] -- [I] Adapter Ordinal : 0 [I] Adapter Handle : 0x10001 [I] Description : NVIDIA GeForce2 MX/MX 400 (Microsoft Corporation) [I] GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll [I] Vendor Id: 0x10de [I] Device Id: 0x0110 [I] SubSys Id: 0x88171462 [I] Driver Version : 6.14.10.5673 [I] GUID : {D7B71E3E-4250-11CF-FB61-1DA813C2CB35} [E] D3DPPLM::CheckDeviceCaps: adapter 0: Failed (pixel shaders 2.0 required) [I] -- [E] D3DPPLM::CheckAdaptersInfo: no suitable adapters found [E] InitD3D: failed to init adapters [/code] On the modern Vista machine the test app works also fine if I disable d3d support (sun.java2d.d3d=false) even if this causes a higher CPU utilization. [Message sent by forum member 'wzberger' (wzberger)] http://forums.java.net/jive/thread.jspa?messageID=286677 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA2D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA2D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.