-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
the attached patch (against the current CVS) does two things:
1. add the Graphics.getClipBounds(Rectangle) method for getting the clip
bounds without creating a new object (beware: only compiled and tested
with X AWT because I can't get the Qt one to compile right now :( )
2. comment out two System.err printouts in java.awt.Image because my
code repeatedly called getWidth() on a double buffer Image and all the
printouts got quite annoying (and somewhat time-consuming).
Cheers,
- - Benja
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFA4zzbUvR5J6wSKPMRAkPqAJ9RHAUunRDonAaQNDKGB27XGCLLbgCgmUMg
0L9tPMXa/QVh2/zFxHYdjHs=
=AmeX
-----END PGP SIGNATURE-----
Index: libraries/javalib/java/awt/Graphics.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/Graphics.java,v
retrieving revision 1.7
diff -u -r1.7 Graphics.java
--- libraries/javalib/java/awt/Graphics.java 10 Feb 1999 21:34:31 -0000 1.7
+++ libraries/javalib/java/awt/Graphics.java 30 Jun 2004 22:21:50 -0000
@@ -171,7 +171,12 @@
abstract public Shape getClip ();
-abstract public Rectangle getClipBounds();
+public Rectangle getClipBounds() {
+ // Another return object which is modified by Swing, causing more garbage <sigh>
+ return (getClipBounds(new Rectangle()));
+}
+
+abstract public Rectangle getClipBounds(Rectangle rect);
int getClipHeight () {
// this is only here to be resolved in concrete subclasses
Index: libraries/javalib/java/awt/Image.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/Image.java,v
retrieving revision 1.17
diff -u -r1.17 Image.java
--- libraries/javalib/java/awt/Image.java 9 Jun 2004 17:40:16 -0000 1.17
+++ libraries/javalib/java/awt/Image.java 30 Jun 2004 22:21:51 -0000
@@ -268,7 +268,7 @@
}
public synchronized int getWidth ( ImageObserver observer ) {
- System.err.println("getWidth()="+width + " producer="+producer);
+ //System.err.println("getWidth()="+width + " producer="+producer);
if ( (flags & ImageObserver.WIDTH) != 0 ) {
return (width);
}
@@ -354,7 +354,7 @@
this.flags |= flags;
- System.err.println("producer="+producer + " flags="+this.flags);
+ //System.err.println("producer="+producer + " flags="+this.flags);
if (observers == null) {
return;
Index: libraries/javalib/java/awt/NativeGraphics.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/NativeGraphics.java,v
retrieving revision 1.11
diff -u -r1.11 NativeGraphics.java
--- libraries/javalib/java/awt/NativeGraphics.java 22 Mar 2004 11:24:34 -0000 1.11
+++ libraries/javalib/java/awt/NativeGraphics.java 30 Jun 2004 22:21:52 -0000
@@ -389,9 +389,13 @@
return (getClipRect());
}
-public Rectangle getClipBounds() {
- // Another return object which is modified by Swing, causing more garbage <sigh>
- return (new Rectangle( xClip, yClip, wClip, hClip));
+public Rectangle getClipBounds(Rectangle rect) {
+ rect.x = xClip;
+ rect.y = yClip;
+ rect.width = wClip;
+ rect.height = hClip;
+
+ return rect;
}
int getClipHeight () {
Index: libraries/javalib/java/awt/PSGraphics.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/PSGraphics.java,v
retrieving revision 1.4
diff -u -r1.4 PSGraphics.java
--- libraries/javalib/java/awt/PSGraphics.java 10 Feb 1999 21:34:34 -0000 1.4
+++ libraries/javalib/java/awt/PSGraphics.java 30 Jun 2004 22:21:53 -0000
@@ -276,7 +276,11 @@
}
public Rectangle getClipBounds() {
- return null;
+ return null;
+}
+
+public Rectangle getClipBounds(Rectangle rect) {
+ return rect;
}
public Color getColor() {
_______________________________________________
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe