[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: java.awt.image color model fixes

Kaffe CVS cvs-commits at kaffe.org
Sat Oct 30 03:38:48 PDT 2004


PatchSet 5385 
Date: 2004/10/30 10:34:56
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: java.awt.image color model fixes

2004-10-30  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/awt/image/ColorConvertOp.java:
        New file taken from GNU Classpath.

        * libraries/javalib/Makefile.am,
        libraries/javalib/Makefile.in,
        libraries/javalib/all.files:
        Regenerated.

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

        2004-10-29  Jerry Quinn  <jlquinn at optonline.net>

        * java/awt/image/ColorConvertOp.java: New class.
        * java/awt/image/ColorModel.java (cloneColorModel): New method.

Members: 
	ChangeLog:1.2937->1.2938 
	libraries/javalib/Makefile.am:1.256->1.257 
	libraries/javalib/Makefile.in:1.336->1.337 
	libraries/javalib/all.files:1.44->1.45 
	libraries/javalib/java/awt/image/ColorModel.java:1.12->1.13 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2937 kaffe/ChangeLog:1.2938
--- kaffe/ChangeLog:1.2937	Sat Oct 30 00:02:26 2004
+++ kaffe/ChangeLog	Sat Oct 30 10:34:56 2004
@@ -1,3 +1,21 @@
+2004-10-30  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/javalib/java/awt/image/ColorConvertOp.java:
+	New file taken from GNU Classpath.
+
+	* libraries/javalib/Makefile.am,
+	libraries/javalib/Makefile.in,
+	libraries/javalib/all.files:
+	Regenerated.
+
+	* libraries/javalib/java/awt/image/ColorModel.java:
+	Resynced with GNU Classpath.
+
+	2004-10-29  Jerry Quinn  <jlquinn at optonline.net>
+
+        * java/awt/image/ColorConvertOp.java: New class.
+        * java/awt/image/ColorModel.java (cloneColorModel): New method.
+
 2004-10-29  Dalibor Topic  <robilad at kaffe.org>
 
 	* libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java,
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.256 kaffe/libraries/javalib/Makefile.am:1.257
--- kaffe/libraries/javalib/Makefile.am:1.256	Fri Oct 29 00:00:35 2004
+++ kaffe/libraries/javalib/Makefile.am	Sat Oct 30 10:34:58 2004
@@ -1758,6 +1758,7 @@
 	java/awt/image/BufferedImageFilter.java \
 	java/awt/image/BufferedImageOp.java \
 	java/awt/image/ByteLookupTable.java \
+	java/awt/image/ColorConvertOp.java \
 	java/awt/image/ColorModel.java \
 	java/awt/image/ComponentColorModel.java \
 	java/awt/image/ComponentSampleModel.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.336 kaffe/libraries/javalib/Makefile.in:1.337
--- kaffe/libraries/javalib/Makefile.in:1.336	Fri Oct 29 00:00:36 2004
+++ kaffe/libraries/javalib/Makefile.in	Sat Oct 30 10:34:58 2004
@@ -2219,6 +2219,7 @@
 	java/awt/image/BufferedImageFilter.java \
 	java/awt/image/BufferedImageOp.java \
 	java/awt/image/ByteLookupTable.java \
+	java/awt/image/ColorConvertOp.java \
 	java/awt/image/ColorModel.java \
 	java/awt/image/ComponentColorModel.java \
 	java/awt/image/ComponentSampleModel.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.44 kaffe/libraries/javalib/all.files:1.45
--- kaffe/libraries/javalib/all.files:1.44	Fri Oct 29 00:00:37 2004
+++ kaffe/libraries/javalib/all.files	Sat Oct 30 10:34:59 2004
@@ -1312,6 +1312,7 @@
 java/awt/image/BufferedImageFilter.java
 java/awt/image/BufferedImageOp.java
 java/awt/image/ByteLookupTable.java
+java/awt/image/ColorConvertOp.java
 java/awt/image/ColorModel.java
 java/awt/image/ComponentColorModel.java
 java/awt/image/ComponentSampleModel.java
Index: kaffe/libraries/javalib/java/awt/image/ColorModel.java
diff -u kaffe/libraries/javalib/java/awt/image/ColorModel.java:1.12 kaffe/libraries/javalib/java/awt/image/ColorModel.java:1.13
--- kaffe/libraries/javalib/java/awt/image/ColorModel.java:1.12	Wed Sep 29 04:23:56 2004
+++ kaffe/libraries/javalib/java/awt/image/ColorModel.java	Sat Oct 30 10:34:59 2004
@@ -43,6 +43,7 @@
 import java.awt.Point;
 import java.awt.Transparency;
 import java.awt.color.ColorSpace;
+import java.lang.reflect.Constructor;
 import java.util.Arrays;
 
 /**
@@ -158,6 +159,32 @@
     this.transferType = transferType;
   }
 
+  // This is a hook for ColorConvertOp to create a colormodel with
+  // a new colorspace
+  ColorModel cloneColorModel(ColorSpace cspace)
+  {
+    Class cls = this.getClass();
+    ColorModel cm;
+    try {
+      // This constructor will exist.
+      Constructor ctor =
+        cls.getConstructor(new Class[]{int.class, int[].class,
+				       ColorSpace.class, boolean.class,
+				       boolean.class, int.class, int.class});
+      cm = (ColorModel)ctor.
+        newInstance(new Object[]{new Integer(pixel_bits),
+				 bits, cspace, Boolean.valueOf(hasAlpha),
+				 Boolean.valueOf(isAlphaPremultiplied),
+				 new Integer(transparency),
+				 new Integer(transferType)});
+    }
+    catch (Exception e)
+    {
+      throw new IllegalArgumentException();
+    }
+    return cm;
+  }
+  
   public void finalize()
   {
     // Do nothing here.




More information about the kaffe mailing list