-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
11
-
x86_64
-
linux_ubuntu
A DESCRIPTION OF THE PROBLEM :
It seems that on Linux colors with an alpha transparency are painted incorrectly:
https://imgur.com/N1XuWCp
It may be related to this existing issue,
but I decided to report another bug just in case:
https://bugs.openjdk.java.net/browse/JDK-8204931
Painting off-screen is not affected (e.g. drawing to BufferedImage)
REGRESSION : Last worked in version 10.0.1
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Colors like in previous versions
ACTUAL -
Glitched colors
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame {
Test() {
JPanel p = new JPanel() {
@Override
protected void paintComponent(Graphics graphics) {
Graphics2D g = (Graphics2D)graphics.create();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.RED);
g.fillRect(200, 200, 200, 200);
g.setComposite(AlphaComposite.SrcOver.derive(0.5f));
g.setColor(new Color(133, 156, 178));
g.fillRect(100, 100, 200, 200);
g.setColor(Color.BLACK);
g.fillRect(300, 300, 200, 200);
g.setColor(Color.GREEN);
g.fillRect(300, 100, 200, 200);
g.dispose();
}
};
add(p);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(800, 600);
setVisible(true);
}
public static void main(String... args) {
SwingUtilities.invokeLater(Test::new);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Works OK with -Dsun.java2d.xrender=false option
FREQUENCY : always
It seems that on Linux colors with an alpha transparency are painted incorrectly:
https://imgur.com/N1XuWCp
It may be related to this existing issue,
but I decided to report another bug just in case:
https://bugs.openjdk.java.net/browse/JDK-8204931
Painting off-screen is not affected (e.g. drawing to BufferedImage)
REGRESSION : Last worked in version 10.0.1
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Colors like in previous versions
ACTUAL -
Glitched colors
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame {
Test() {
JPanel p = new JPanel() {
@Override
protected void paintComponent(Graphics graphics) {
Graphics2D g = (Graphics2D)graphics.create();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.RED);
g.fillRect(200, 200, 200, 200);
g.setComposite(AlphaComposite.SrcOver.derive(0.5f));
g.setColor(new Color(133, 156, 178));
g.fillRect(100, 100, 200, 200);
g.setColor(Color.BLACK);
g.fillRect(300, 300, 200, 200);
g.setColor(Color.GREEN);
g.fillRect(300, 100, 200, 200);
g.dispose();
}
};
add(p);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(800, 600);
setVisible(true);
}
public static void main(String... args) {
SwingUtilities.invokeLater(Test::new);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Works OK with -Dsun.java2d.xrender=false option
FREQUENCY : always
- duplicates
-
JDK-8204931 Colors with alpha are painted incorrectly on Linux
- Resolved
- relates to
-
JDK-8204931 Colors with alpha are painted incorrectly on Linux
- Resolved