[OpenJDK 2D-Dev] 6603887: Where are transparent areas filled with bgColor?
Clemens Eisserer
linuxhippy at gmail.com
Fri Sep 28 10:42:02 UTC 2007
Hi,
> It may - if the transparent pixel is 0th entry in the colormap.
>
> I think we'll have to resort to another boolean which tells
> whether bgPixel is valid - like you suggested.
Yes, I also think this would be a better fix, and it would make the
source more readable in my opinion.
I copied my first attemp to fix the problem below.
lg Clemens
PS: Thanks for open-sourcing java!
--- /home/ce/mozilla_java_prob/jdk7_original/j2se/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
2007-09-12 20:11:42.000000000 +0200
+++ /home/ce/mozilla_java_prob/jdk7_modified/j2se/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
2007-09-28 12:25:19.000000000 +0200
@@ -256,6 +256,7 @@
xsdo->isPixmap = JNI_FALSE;
xsdo->bitmask = 0;
xsdo->bgPixel = 0;
+ xsdo->isBgInitialized = JNI_FALSE;
#ifdef MITSHM
xsdo->shmPMData.shmSegInfo = NULL;
xsdo->shmPMData.xRequestSent = JNI_FALSE;
@@ -997,7 +998,7 @@
}
/* the background pixel is not valid anymore */
if (xpriv->lockFlags & SD_LOCK_WRITE) {
- xsdo->bgPixel = 0;
+ xsdo->isBgInitialized = JNI_FALSE;
}
xpriv->lockType = X11SD_LOCK_UNLOCKED;
AWT_UNLOCK();
@@ -1485,7 +1486,7 @@
/* Check if current color of the transparent pixels is different
from the specified one */
- if (xsdo->bgPixel != pixel + 1) {
+ if (xsdo->bgPixel != pixel || xsdo->isBgInitialized == JNI_FALSE) {
GC srcGC;
GC bmGC;
@@ -1525,7 +1526,8 @@
XFreeGC(awt_display, bmGC);
XFreeGC(awt_display, srcGC);
- xsdo->bgPixel = pixel + 1;
+ xsdo->bgPixel = pixel;
+ xsdo->isBgInitialized = JNI_TRUE;
}
return xsdo->drawable;
--- /home/ce/mozilla_java_prob/jdk7_original/j2se/src/solaris/native/sun/java2d/x11/X11SurfaceData.h
2007-09-12 20:11:42.000000000 +0200
+++ /home/ce/mozilla_java_prob/jdk7_modified/j2se/src/solaris/native/sun/java2d/x11/X11SurfaceData.h
2007-09-28 12:22:45.000000000 +0200
@@ -107,6 +107,7 @@
void *dgaDev;
Pixmap bitmask;
jint bgPixel; /* bg pixel for the pixmap */
+ jboolean isBgInitialized;
jint pmWidth; /* width, height of the */
jint pmHeight; /* pixmap */
#ifdef MITSHM
More information about the 2d-dev
mailing list