Skip to main content

[JAVA2D] XOR mode with OpenGL pipeline [was: Resizing a JFrame with OpenGL pipeline]

2 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Emmanuel Pietriga

Emmanuel Pietriga wrote:

> Hi Emmanuel,
>
> I believe this is a known issue; see:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5026186
>
> There are a few bugs in Nvidia's and ATI's drivers that affect our OGL
> pipeline on Windows that should be resolved over time, as we submit
> testcases to those driver teams.

Ok, thank you.

Now, I've found another problem related to the OpenGL pipeline.

Switching to XOR mode (using Graphics.setXORMode(Color c)) when I want
to paint things in a JPanel does not work, i.e. the painting
instructions executed after a call to setXORMode() do not have any
effect on screen.

I've attached a simple test case. If you launch it without opengl
enabled, you will see what could be a crosshair cursor at the red
rectangle's top left corner (just two lines painted in XOR mode). Now,
if you launch it with -Dsun.java2d.opengl=true, the red rectangle does
appear, but the two lines don't.

Again, please tell me if that's already a known issue (I could not find
anything in the bug DB about this). If not, I'll file a report.

Thanks,
Emmanuel

--
Emmanuel Pietriga
INRIA Futurs - Projet In Situ tel : +33 1 69 15 34 66
Bat 490, Université Paris-Sud fax : +33 1 69 15 65 86
91405 ORSAY Cedex http://www.lri.fr/~pietriga

===========================================================================
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".
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.geom.*;

public class GLxor extends JFrame {

public GLxor(){
Container cpane=this.getContentPane();
final JPanel tp=new TestPanel();
cpane.add(tp);
WindowListener w0=new WindowAdapter(){
public void windowClosing(WindowEvent e){System.exit(0);}
};
this.addWindowListener(w0);
this.setSize(300,300);
this.setVisible(true);
}

public static void main(String[] args){
GLxor t=new GLxor();
}

}

class TestPanel extends JPanel {

public void paint(Graphics g){
super.paint(g);
g.setColor(Color.red);
g.fillRect(100,100,100,100);
g.setXORMode(Color.white);
g.setColor(Color.black);
g.drawLine(90,100,110,100);
g.drawLine(100,90,100,110);
}

}

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

Chris Campbell

Hi Emmanuel,

The issue you describe below is:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5106309

Thanks,
Chris

On Oct 21, 2004, at 3:12 AM, Emmanuel Pietriga wrote:
> Emmanuel Pietriga wrote:
>
>> Hi Emmanuel,
>>
>> I believe this is a known issue; see:
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5026186
>>
>> There are a few bugs in Nvidia's and ATI's drivers that affect our OGL
>> pipeline on Windows that should be resolved over time, as we submit
>> testcases to those driver teams.
>
> Ok, thank you.
>
> Now, I've found another problem related to the OpenGL pipeline.
>
> Switching to XOR mode (using Graphics.setXORMode(Color c)) when I want
> to paint things in a JPanel does not work, i.e. the painting
> instructions executed after a call to setXORMode() do not have any
> effect on screen.
>
> I've attached a simple test case. If you launch it without opengl
> enabled, you will see what could be a crosshair cursor at the red
> rectangle's top left corner (just two lines painted in XOR mode). Now,
> if you launch it with -Dsun.java2d.opengl=true, the red rectangle does
> appear, but the two lines don't.
>
> Again, please tell me if that's already a known issue (I could not find
> anything in the bug DB about this). If not, I'll file a report.
>
> Thanks,
> Emmanuel
>
> --
> Emmanuel Pietriga
> INRIA Futurs - Projet In Situ tel : +33 1 69 15 34 66
> Bat 490, Université Paris-Sud fax : +33 1 69 15 65 86
> 91405 ORSAY Cedex http://www.lri.fr/~pietriga
>
>
> =======================================================================
> ====
> 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".
> import java.awt.*;
> import java.awt.event.*;
> import javax.swing.*;
> import java.awt.geom.*;
>
> public class GLxor extends JFrame {
>
> public GLxor(){
> Container cpane=this.getContentPane();
> final JPanel tp=new TestPanel();
> cpane.add(tp);
> WindowListener w0=new WindowAdapter(){
> public void windowClosing(WindowEvent
> e){System.exit(0);}
> };
> this.addWindowListener(w0);
> this.setSize(300,300);
> this.setVisible(true);
> }
>
> public static void main(String[] args){
> GLxor t=new GLxor();
> }
>
> }
>
> class TestPanel extends JPanel {
>
> public void paint(Graphics g){
> super.paint(g);
> g.setColor(Color.red);
> g.fillRect(100,100,100,100);
> g.setXORMode(Color.white);
> g.setColor(Color.black);
> g.drawLine(90,100,110,100);
> g.drawLine(100,90,100,110);
> }
>
> }
>
> =======================================================================
> ====
> 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".