[JAVA2D] Bad default D3D performance

2008-07-16 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_1002DEV_9440SUBSYS_05021002REV_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] 

Re: [JAVA2D] Bad default D3D performance

2008-07-16 Thread java2d
Thanks for the report.

This problem is most likely caused by this bug:
  http://bugs.sun.com/view_bug.do?bug_id=6635462

The OUTLINE drag mode in internal frames uses XOR, which causes this bad 
performance you see. Just don't use OUTLINE drag mode in your application.

Thanks,
  Dmitri
[Message sent by forum member 'trembovetski' (trembovetski)]

http://forums.java.net/jive/thread.jspa?messageID=286939

===
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-16 Thread java2d
Thanks for the tip. I have added methods to check property changes to the size 
and text. 
I also read somewhere that I should not override the paintComponent method but 
that I should use the paint method instead. The clip is normally set in the 
paint method of JComponent.
If I do that it also works and gives the following method. 
/**
 */
public void paint(final Graphics g) {
if (isEnabled()) {
super.paint(g);
return;

}
if (redraw) {
final BufferedImage buf = new BufferedImage(getWidth(), 
getHeight(),
BufferedImage.TYPE_INT_RGB);
final Graphics2D g2 = (Graphics2D) buf.getGraphics();
super.paint(g2);
final float f = 0.18f;
final int heightWidth = 3;
final float[] myKernel = { 0, f, 0, f, f, f, 0, f, 0 };

final ConvolveOp op = new ConvolveOp(new 
Kernel(heightWidth, heightWidth, myKernel));
img = op.filter(buf, null);
g2.dispose();
redraw = false;
}
g.drawImage(img, 0, 0, null);
}

PS. How can I post nicely formatted code?
[Message sent by forum member 'uncletall' (uncletall)]

http://forums.java.net/jive/thread.jspa?messageID=286943

===
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 JButto

2008-07-16 Thread java2d
The tags you're looking for are [ code ] and  [ /code ] but remove the spaces 
in the tags! Put that around your code and the forum software will pretty print 
it for you.

Also, wherever you read which method to override for JComponent is wrong. You 
should be overriding paintComponent() in virtually all circumstances. The clip 
will be set automatically in the Graphics object passed to paintComponent.
[Message sent by forum member 'fred34' (fred34)]

http://forums.java.net/jive/thread.jspa?messageID=286991

===
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-16 Thread Dmitri Trembovetski

[EMAIL PROTECTED] wrote:
Thanks for the tip. I have added methods to check property changes to the size and text. 
I also read somewhere that I should not override the paintComponent method but that I should use the paint method instead. The clip is normally set in the paint method of JComponent.


  I'll leave that to Swing experts (you may wan to
  confirm this on the Swing forum).

If I do that it also works and gives the following method. 
/**

 */
public void paint(final Graphics g) {
if (isEnabled()) {
super.paint(g);
return;

}
if (redraw) {
final BufferedImage buf = new BufferedImage(getWidth(), 
getHeight(),
BufferedImage.TYPE_INT_RGB);
final Graphics2D g2 = (Graphics2D) buf.getGraphics();
super.paint(g2);
final float f = 0.18f;
final int heightWidth = 3;
final float[] myKernel = { 0, f, 0, f, f, f, 0, f, 0 };

final ConvolveOp op = new ConvolveOp(new 
Kernel(heightWidth, heightWidth, myKernel));
img = op.filter(buf, null);
g2.dispose();
redraw = false;
}
g.drawImage(img, 0, 0, null);
}


  Looks pretty good to me.
  I assume redraw is updated when the size or text changes, right?


PS. How can I post nicely formatted code?


  I believe you need to use [ code ] and [ / code ] (w/o spaces) tags.

  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.


[JAVA2D] Taking advantage of printer's native resolution

2008-07-16 Thread java2d
Since I have not received an answer to my previous question, I will try to 
simplify it even further.

For an arbitrary printer, how can I print a single line that is one printer 
dot wide by N dots long, ie, print the finest line the printer is capable of 
printing? 

For a 300dpi printer this line would be a line 1/300 wide. For a 2400dpi 
printer this would be a line 1/2400 wide, etc.

Thanks!
[Message sent by forum member 'robross' (robross)]

http://forums.java.net/jive/thread.jspa?messageID=287172

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


[JAVA2D] I see that FullScreen Exclusive Mode has changed....

2008-07-16 Thread java2d
Try one of my applets and go fullscreen:

http://pancyl.com/

Press F1 to enter -- ESC to exit.

When you enter, the border flashes blue and there is a little icon on the upper 
right that gives a floating announcement that this is a Java window.  This is 
much, much better than the banner at the bottom.  The blue flashing is a little 
extreme and the first time you see it, it's a little scary but what the heck...

On Windows I noticed that the task bar is still visible and if I hide the task 
bar, the fullscreen window does not cover the (now hidden) task bar area 
leaving the desktop background color showing.

What you've done for FullScreen exclusive mode is good.  Make it a little 
better by filling in the task bar area if the task bar is hidden.
[Message sent by forum member 'demonduck' (demonduck)]

http://forums.java.net/jive/thread.jspa?messageID=287208

===
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] I see that FullScreen Exclusive Mode has changed....

2008-07-16 Thread Dmitri Trembovetski

  Hello,

[EMAIL PROTECTED] wrote:

Try one of my applets and go fullscreen:

http://pancyl.com/

Press F1 to enter -- ESC to exit.

When you enter, the border flashes blue and there is a little icon on the upper 
right that gives a floating announcement that this is a Java window.  This is 
much, much better than the banner at the bottom.  The blue flashing is a little 
extreme and the first time you see it, it's a little scary but what the heck...



  It's weird that if flashes blue, it was supposed to be green,
  I believe =)

  Applets don't have access to Full screen exclusive mode
  (unless they are signed), so I assume that what you're seeing
  is emulated mode - basically the window is resized.



On Windows I noticed that the task bar is still visible and if I hide the task 
bar, the fullscreen window does not cover the (now hidden) task bar area 
leaving the desktop background color showing.


  This is probably the artifact of the emulated full screen
  mode. I'll take a look at it tomorrow and file a bug if
  needed.



What you've done for FullScreen exclusive mode is good.  Make it a little 
better by filling in the task bar area if the task bar is hidden.


  It's not really FSEM feature - any unsigned applet's window
  will now have this kind of warning window.

  Thanks,
Dmitri


[Message sent by forum member 'demonduck' (demonduck)]

http://forums.java.net/jive/thread.jspa?messageID=287208

===
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] Taking advantage of printer's native resolution

2008-07-16 Thread Phil Race
In the print() method look at the graphics transform and scale down 
accordingly.


Eg if the printer is 360 dpi, then the transform will report a scale of 
(5,5) so you need

to apply a user scale of 1/5, 1/5.

Then a 1 pixel user space line will be 1 device pixel.

FYI  printers that say they are 2400 dpi are not necessarily truely that 
fine so it may not

be that a line is 1/2400 but that's a matter for the printer vendor.

-phil.

[EMAIL PROTECTED] wrote:

Since I have not received an answer to my previous question, I will try to 
simplify it even further.

For an arbitrary printer, how can I print a single line that is one printer dot wide by N dots long, ie, print the finest line the printer is capable of printing? 


For a 300dpi printer this line would be a line 1/300 wide. For a 2400dpi printer 
this would be a line 1/2400 wide, etc.

Thanks!
[Message sent by forum member 'robross' (robross)]

http://forums.java.net/jive/thread.jspa?messageID=287172

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