[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: fixes for IndexColorModel

Kaffe CVS cvs-commits at kaffe.org
Fri Dec 3 01:20:34 PST 2004


PatchSet 5516 
Date: 2004/12/03 09:15:59
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: fixes for IndexColorModel

2004-12-02  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/awt/image/IndexColorModel.java:
        Resynced with GNU Classpath.

        2004-11-25  Sven de Marothy  <sven at physto.se>

        * java/awt/image/IndexColorModel.java
        (IndexColorModel): Add FIXME with respect to alpha handling.
        (getAlpha): Default to returning opaque pixels.

Members: 
	ChangeLog:1.3062->1.3063 
	libraries/javalib/java/awt/image/IndexColorModel.java:1.6->1.7 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3062 kaffe/ChangeLog:1.3063
--- kaffe/ChangeLog:1.3062	Fri Dec  3 01:56:19 2004
+++ kaffe/ChangeLog	Fri Dec  3 09:15:59 2004
@@ -1,5 +1,16 @@
 2004-12-02  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/awt/image/IndexColorModel.java:
+        Resynced with GNU Classpath.
+
+	2004-11-25  Sven de Marothy  <sven at physto.se>
+
+        * java/awt/image/IndexColorModel.java
+        (IndexColorModel): Add FIXME with respect to alpha handling.
+        (getAlpha): Default to returning opaque pixels.
+
+2004-12-02  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/awt/Button.java,
 	libraries/javalib/java/awt/Checkbox.java,
 	libraries/javalib/java/awt/Choice.java,
Index: kaffe/libraries/javalib/java/awt/image/IndexColorModel.java
diff -u kaffe/libraries/javalib/java/awt/image/IndexColorModel.java:1.6 kaffe/libraries/javalib/java/awt/image/IndexColorModel.java:1.7
--- kaffe/libraries/javalib/java/awt/image/IndexColorModel.java:1.6	Sun Nov  7 21:10:18 2004
+++ kaffe/libraries/javalib/java/awt/image/IndexColorModel.java	Fri Dec  3 09:16:02 2004
@@ -125,7 +125,9 @@
   public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
                          byte[] blues, byte[] alphas)
   {
-    super (bits);
+    // FIXME: This super() constructor should not be used since it can give
+    // the wrong value for hasAlpha() which is final and cannot be overloaded
+    super(bits); 
     map_size = size;
     opaque = (alphas == null);
 
@@ -416,10 +418,10 @@
    */
   public final int getAlpha (int pixel)
   {
-    if (pixel < map_size)
-	    return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
-    
-    return 0;
+    if (opaque || pixel >= map_size)
+      return 255;
+
+    return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
   }
 
   /**




More information about the kaffe mailing list