[cp-patches] FYI: Component fixlet

2006-01-27 Thread Roman Kennke
Hi there,

I removed some 'optimization' in coalescePaintEvents, that tried to not
coalesce paint events, depending on the area of the spanned old and new
damaged rectangle. I played a little with the settings and different
approaches to optimizing this and the outcome was that the best use
experience is achieved when there is no optimization at all, which means
coalescing all paint events on the eventqueue for the same component.

BTW: The GTK peers don't seem to send PaintEvents at all, and instead
call Component.update() and Component.paint() directly, which is clearly
a bug.

2006-01-27  Roman Kennke  [EMAIL PROTECTED]

* java/awt/Component.java
(coalescePaintEvent): Don't try to optimize coalescing. This
hurts
more than it helps.


Cheers, Roman
Index: java/awt/Component.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
retrieving revision 1.92
diff -u -r1.92 Component.java
--- java/awt/Component.java	13 Jan 2006 21:18:13 -	1.92
+++ java/awt/Component.java	27 Jan 2006 09:31:38 -
@@ -4925,16 +4925,6 @@
 Rectangle r1 = queuedEvent.getUpdateRect();
 Rectangle r2 = newEvent.getUpdateRect();
 Rectangle union = r1.union(r2);
-
-int r1a = r1.width * r1.height;
-int r2a = r2.width * r2.height;
-int ua  = union.width * union.height;
-
-if (ua  (r1a+r2a)*2)
-  return null;
-/* The 2 factor should maybe be reconsidered. Perhaps 3/2
-   would be better? */
-
 newEvent.setUpdateRect(union);
 return newEvent;
   }


[cp-patches] FYI: Component fixlet

2005-10-12 Thread Roman Kennke
This fixes a small repaint problem in java.awt.Component. The rectangle
calculation in reshape() was wrong, it calculated rectangle relative to
the parent's parent, which should only be relative to the parent.

2005-10-12  Roman Kennke  [EMAIL PROTECTED]

* java/awt/Component.java
(reshape): Fixed calculation of newBounds and oldBounds to create
rectangles relative to the parent, and not to the parent's
parent.
Solves a painting problem in an app here.


/Roman
Index: java/awt/Component.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
retrieving revision 1.79
diff -u -r1.79 Component.java
--- java/awt/Component.java	4 Oct 2005 14:05:56 -	1.79
+++ java/awt/Component.java	12 Oct 2005 15:23:03 -
@@ -1402,17 +1402,14 @@
   peer.setBounds (x, y, width, height);
 
 // Erase old bounds and repaint new bounds for lightweights.
-if (isLightweight()  isShowing ())
+if (isLightweight()  isShowing())
   {
 if (parent != null)
   {
 Rectangle parentBounds = parent.getBounds();
-Rectangle oldBounds = new Rectangle(parent.getX() + oldx,
-parent.getY() + oldy,
-oldwidth, oldheight);
-Rectangle newBounds = new Rectangle(parent.getX() + x,
-parent.getY() + y,
-width, height);
+Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth,
+oldheight);
+Rectangle newBounds = new Rectangle(x, y, width, height);
 Rectangle destroyed = oldBounds.union(newBounds);
 if (!destroyed.isEmpty())
   parent.repaint(0, destroyed.x, destroyed.y, destroyed.width,
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches