[JAVA2D] Bad default D3D performance

2008-07-15 Thread java2d
I think this is the right place to put it?

While playing with the JInternalFrame tutorial ( 
http://java.sun.com/docs/books/tutorial/uiswing/components/internalframe.html ) 
i noticed really really bad performance while dragging the frames. In the order 
of 1/2 updates per second. 

I searched around and found the document at 
http://java.sun.com/javase/6/webnotes/trouble/TSG-Desktop/html/gcghe.html and 
played with the settings:

Results:
Best performance was setting this which gave perfect rendering speed:
-Dsun.java2d.d3d=false 
OR setting
J2D_D3D_RASTERIZER=rgb

Worst results:
J2D_D3D_RASTERIZER=hal

Setting it to use OpenGL with -Dsun.java2d.opengl=True was slightly better than 
the D3D hal, but was still very slow, 7/8 updates per second


System Specs:
Operating System: Windows Vistaâ„¢ Home Premium (6.0, Build 6001) Service Pack 1 
(6001.vistasp1_gdr.080425-1930)
Motherboard: Asus P5B-Premium, bios: 0902

Video card specs(from DXDIAG) (i use a dual monitor config)
---
Display Devices
---
Card name: ATI Radeon HD 4800 Series
 Manufacturer: ATI Technologies Inc.
Chip type: ATI Radeon Graphics Processor (0x9440)
 DAC type: Internal DAC(400MHz)
   Device Key: Enum\PCI\VEN_1002&DEV_9440&SUBSYS_05021002&REV_00
   Display Memory: 1786 MB
 Dedicated Memory: 507 MB
Shared Memory: 1279 MB
 Current Mode: 1280 x 1024 (32 bit) (60Hz)
  Monitor: BenQ FP91G+ (Digital)
  Driver Name: 
atidxx32.dll,atidxx64,atiumdag.dll,atiumdva.dat,atiumd64,atiumd6a,atitmm64
   Driver Version: 7.15.0010.0128 (English)
  DDI Version: 10.1
Driver Attributes: Final Retail
 Driver Date/Size: 6/22/2008 01:52:12, 1626624 bytes
  WHQL Logo'd: No
  WHQL Date Stamp: None
Device Identifier: {D7B71EE2-D700-11CF-E471-0825A1C2CA35}
Vendor ID: 0x1002
Device ID: 0x9440
SubSys ID: 0x05021002
  Revision ID: 0x
  Revision ID: 0x
  Video Accel: ModeMPEG2_A ModeMPEG2_C 
 Deinterlace Caps: {6E8329FF-B642-418B-BCF0-BCB6591E255F}: 
Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,1) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_PixelAdaptive 
   {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: 
Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_BOBVerticalStretch 
   {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: 
Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
   {6E8329FF-B642-418B-BCF0-BCB6591E255F}: 
Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,1) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_PixelAdaptive 
   {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: 
Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_BOBVerticalStretch 
   {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: 
Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
   {3C5323C1-6FB7-44F5-9081-056BF2EE449D}: 
Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,2) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_PixelAdaptive 
   {552C0DAD-CCBC-420B-83C8-74943CF9F1A6}: 
Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,2) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_PixelAdaptive 
   {6E8329FF-B642-418B-BCF0-BCB6591E255F}: 
Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,1) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_PixelAdaptive 
   {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: 
Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
DeinterlaceTech_BOBVerticalStretch 
   {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: 
Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) 
Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY 
 DDraw Status: Enabled
   D3D Status: Enabled
   AGP Status: Enabled


Output from J2D_TRACE_LEVEL=4 

[I] OS Version = OS_VISTA or newer
[I] CheckAdaptersInfo
[I] --
[I] Adapter Ordinal  : 0
[I] Adapter Handle   : 0x10001
[I] Description  : ATI Radeon HD 4800 Series
[I] GDI Name, Driver : \\.\DISPLAY2, atiumdag.dll
[I] Vendor Id: 0x1002
[I] Device Id: 0x9440
[I] SubSys Id: 0x5021002
[I] Driver Version   : 7.14.10.598
[I] GUID : {D7B71EE2-D700-11CF-E471-0825A1C2CA35}
[I] D3DPPLM::CheckDeviceCaps: adapter 0: Passed
[I] --
[I] Adapter Ordinal  : 1
[I] Ad

Re: [JAVA2D] How to detect hardware acceleration?

2008-07-15 Thread Dmitri Trembovetski

  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".


Re: [JAVA2D] Null pointer when using paintComponent and html text in JButton

2008-07-15 Thread Dmitri Trembovetski

[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?

2008-07-15 Thread java2d
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".