-
Bug
-
Resolution: Fixed
-
P3
-
8, 9, 10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8260374 | openjdk8u | Jonathan Dowland | P3 | Closed | Won't Fix |
FULL PRODUCT VERSION :
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux osboxes 4.8.0-41-generic #44-Ubuntu SMP Fri Mar 3 15:27:17 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Current version of Compiz installed.
EXTRA RELEVANT SYSTEM CONFIGURATION :
VM running in VirtualBox.
A DESCRIPTION OF THE PROBLEM :
When painting translucent colors on a volatile image on Linux we get an unexpected result color value.
Eg.:
- first filling volatile image with solid black
- then filling with 50% white (0x80ffffff)
- we would expect medium gray ff808080
Expected color is what we see on Windows OS but not on Linux with Java 8.
There we get ff404040 (see test case).
We could verify with jdk1.8.0_05, jdk1.8.0_60, jdk1.8.0_91, jdk1.8.0_92, jdk1.8.0_121.
Bug does not seem to occur with Java 7, verified with jdk1.7.0_67.
REGRESSION. Last worked in version 7u76
ADDITIONAL REGRESSION INFORMATION:
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please run the test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
ff808080
ACTUAL -
ff404040
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package de.centigrade.cezanne.bugs;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage;
import java.awt.image.VolatileImage;
public class Bug0029487TestCase {
public static void main(String[] args) throws Exception {
System.out.println("Java " + System.getProperty("java.version"));
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsConfiguration translucentGC = null;
SCREENS: for (GraphicsDevice screen : env.getScreenDevices()) {
for (GraphicsConfiguration gc : screen.getConfigurations()) {
if (gc.isTranslucencyCapable()) {
translucentGC = gc;
break SCREENS;
}
}
}
if (translucentGC == null) {
throw new Exception("No suitable gc found.");
}
int width = 10;
int height = 10;
VolatileImage image = translucentGC.createCompatibleVolatileImage(width, height);
Graphics2D g = image.createGraphics();
g.setColor(Color.BLACK);
g.fillRect(0, 0, width, height);
g.setColor(new Color(0x80ffffff, true));
g.fillRect(0, 0, width, height);
g.dispose();
// You could also paint image here to verify color value printed below.
BufferedImage snapshot = image.getSnapshot();
int argb = snapshot.getRGB(width / 2, height / 2);
System.out.println(Integer.toHexString(argb));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None known for translucent volatile images.
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux osboxes 4.8.0-41-generic #44-Ubuntu SMP Fri Mar 3 15:27:17 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Current version of Compiz installed.
EXTRA RELEVANT SYSTEM CONFIGURATION :
VM running in VirtualBox.
A DESCRIPTION OF THE PROBLEM :
When painting translucent colors on a volatile image on Linux we get an unexpected result color value.
Eg.:
- first filling volatile image with solid black
- then filling with 50% white (0x80ffffff)
- we would expect medium gray ff808080
Expected color is what we see on Windows OS but not on Linux with Java 8.
There we get ff404040 (see test case).
We could verify with jdk1.8.0_05, jdk1.8.0_60, jdk1.8.0_91, jdk1.8.0_92, jdk1.8.0_121.
Bug does not seem to occur with Java 7, verified with jdk1.7.0_67.
REGRESSION. Last worked in version 7u76
ADDITIONAL REGRESSION INFORMATION:
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please run the test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
ff808080
ACTUAL -
ff404040
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package de.centigrade.cezanne.bugs;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage;
import java.awt.image.VolatileImage;
public class Bug0029487TestCase {
public static void main(String[] args) throws Exception {
System.out.println("Java " + System.getProperty("java.version"));
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsConfiguration translucentGC = null;
SCREENS: for (GraphicsDevice screen : env.getScreenDevices()) {
for (GraphicsConfiguration gc : screen.getConfigurations()) {
if (gc.isTranslucencyCapable()) {
translucentGC = gc;
break SCREENS;
}
}
}
if (translucentGC == null) {
throw new Exception("No suitable gc found.");
}
int width = 10;
int height = 10;
VolatileImage image = translucentGC.createCompatibleVolatileImage(width, height);
Graphics2D g = image.createGraphics();
g.setColor(Color.BLACK);
g.fillRect(0, 0, width, height);
g.setColor(new Color(0x80ffffff, true));
g.fillRect(0, 0, width, height);
g.dispose();
// You could also paint image here to verify color value printed below.
BufferedImage snapshot = image.getSnapshot();
int argb = snapshot.getRGB(width / 2, height / 2);
System.out.println(Integer.toHexString(argb));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None known for translucent volatile images.
- backported by
-
JDK-8260374 Wrong color drawn when painting translucent colors on volatile images using XRender.
- Closed
- relates to
-
JDK-8275843 Random crashes while the UI code is executed
- Resolved
-
JDK-8195131 Dead code removal for changes present in JDK-8176795
- Resolved
-
JDK-8023098 XRender : AlphaComposite test results are incorrect.
- Closed
-
JDK-8204931 Colors with alpha are painted incorrectly on Linux
- Resolved
- links to
(1 links to)