Skip to main content

AWT painting issue w/ NVIDIA 7300 GS and getInsets()

3 replies [Last post]
jaydkay
Offline
Joined: 2008-04-25
Points: 0

I posted a bug to the BugDB, but I seem to be having an issue with legacy AWT painting code in 1.6.0u10. In particular, if the getInsets() method is overriden *AND* I run the following code on a machine with an NVDIA 7300GS graphics card, the output is different -- a rectangular box is painted in a different area of the screen than if the getInsets() method were not overridden. When I switched the machine to using an internal Gfx card, the problem went away. Upgrading to the latest NVIDIA drivers didn't seem to help much either.

</p>
<p>import java.awt.*;<br />
import java.awt.event.*;</p>
<p>// Test Class to show insets problem<br />
public class AWTTestInsets {</p>
<p>     public static void main(String[] args) {</p>
<p>         final Frame f = new Frame("AWT Test - Insets");<br />
         f.setSize(300,300);</p>
<p>         f.addWindowListener(new WindowAdapter() {<br />
             public void windowClosing(WindowEvent e) {<br />
                f.setVisible(false);<br />
                System.exit(0);<br />
            }<br />
         });</p>
<p>         f.setBackground(Color.gray);<br />
         Panel p = new Panel(){<br />
             //t,l,b,r<br />
             public final Insets INSETS = new Insets(40,40,40,40);                     </p>
<p>             // override the getInsets() method ...<br />
             public Insets getInsets() {<br />
                 return INSETS;<br />
             }       </p>
<p>             public void paint(Graphics g) {<br />
                 g.setColor(Color.blue);                                                 </p>
<p>                 // draw a 100x100 pixel blue rectangle starting at offset 100,100<br />
                 g.fillRect(100,100,100,100);</p>
<p>             }<br />
         };<br />
         f.add(p);<br />
         f.setVisible(true);</p>
<p>    }</p>
<p>}</p>
<p>

I've attached a screen shot showing the machine with the NVIDIA 7300 GS running two versions of the above code. The one on the right is the same code as above with the getInsets() method commenting out (not overriden). The painting code itself DOES NOT rely on the insets in any way in both examples, which is why this bug is so weird.

I've only been able to see this bug with 1.6.0u10 running on DELL GX620's that have NVIDIA 7300 GS video cards. Other machine configurations are not affected and unfortunately, I don't have a lot of other NVIDIA cards lying around to test out. Perhaps someone has a 7300GS or another NVIDIA card and can re-produce this issue.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rogyeu
Offline
Joined: 2006-07-30
Points: 0

Hi jaydkay,

I have opened a bug report for you for this issue. The bug ID is 6694230.

Please try to run your application with the following runtime argument and see if the issue is reproduce:
-Dsun.java2d.d3d=false

If not reproducible, please set the environment variable below to make sure Direct3D pipeline is enabled:
set J2D_TRACE_LEVEL=4
and send me the output.

Thanks,
Roger Y.

jaydkay
Offline
Joined: 2008-04-25
Points: 0

Hi, I set the [b]sun.java2d.d3d[/b] system property to false and it fixed the problem. This is a suitable workaround for me right now. I also ran this using SWING painting/components and I didn't see the problem either, looks like only AWT painting is affected Also tested on Nvidia 6600 and the bug was producible there as well. Here's my output with the verbose tracing flag on...

[pre]
[I] OS Version = OS_WINXP Pro
[I] CheckAdaptersInfo
[I] ------------------
[I] Adapter Ordinal : 0
[I] Adapter Handle : 0x10001
[I] Description : NVIDIA GeForce 6600
[I] GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll
[I] Vendor Id : 0x10de
[I] Device Id : 0x0141
[I] SubSys Id : 0x21931682
[I] Driver Version : 6.14.10.8185
[I] GUID : {D7B71E3E-4201-11CF-CB6A-990103C2CB35}
[I] D3DPPLM::CheckDeviceCaps: adapter 0: Passed
[I] ------------------
[I] D3DGD_getDeviceCapsNative
[I] D3DContext::InitContext device 0
[I] D3DContext::ConfigureContext device 0
[V] dwBehaviorFlags=D3DCREATE_FPU_PRESERVE|D3DCREATE_HARDWARE_VERTEXPROCESSING
[I] D3DContext::ConfigureContext: successfully created device: 0
[I] D3DContext::InitDevice: device 0
[I] D3DContext::InitDefice: successfully initialized device 0
[V] | CAPS_DEVICE_OK
[V] | CAPS_RT_PLAIN_ALPHA
[V] | CAPS_RT_TEXTURE_ALPHA
[V] | CAPS_RT_TEXTURE_OPAQUE
[V] | CAPS_LCD_SHADER | CAPS_BIOP_SHADER | CAPS_PS20
[V] | CAPS_PS30
[V] | CAPS_MULTITEXTURE
[V] | CAPS_TEXNONPOW2
[V] | CAPS_TEXNONSQUARE
[/pre]

(btw, this is the debug output on the 6600 (which had the same issues as the 7300GS)

Thanks,

Cliff J.

Message was edited by: jaydkay

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Thanks for the report. This is a bug (filed as 6694230). The fix is in the works,
hopefully will be available in b24.

Dmitri
Java2D Team