summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-12-03 16:01:10 +0000
committerMark Wielaard <mark@klomp.org>2006-12-03 16:01:10 +0000
commit8f6f041f901791c919ec5e349d1b690610b6f6bd (patch)
tree2f6bfb64d21e57592a8461905eaa9514557bc72e
parent83d81abd14aacda83efe9c7b11cddb48417f4c3f (diff)
downloadclasspath-8f6f041f901791c919ec5e349d1b690610b6f6bd.tar.gz
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (paintArea): Renamed
to currentPaintArea. (paintComponent): Work with local reference to currentPaintArea. (updateComponent): Likewise. (coalescePaintEvent): Set currentPaintArea.
-rw-r--r--ChangeLog8
-rw-r--r--gnu/java/awt/peer/gtk/GtkComponentPeer.java30
2 files changed, 29 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 259ac164b..194c7048a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-12-03 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (paintArea): Renamed
+ to currentPaintArea.
+ (paintComponent): Work with local reference to currentPaintArea.
+ (updateComponent): Likewise.
+ (coalescePaintEvent): Set currentPaintArea.
+
2006-12-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
* javax/management/MBeanServerBuilder.java: New file.
diff --git a/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index f6bf588e9..ca992b215 100644
--- a/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -91,9 +91,9 @@ public class GtkComponentPeer extends GtkGenericPeer
Insets insets;
/**
- * The current repaint area.
+ * The current repaint area. Use should be guarded by synchronizing on this.
*/
- protected Rectangle paintArea;
+ private Rectangle currentPaintArea;
/* this isEnabled differs from Component.isEnabled, in that it
knows if a parent is disabled. In that case Component.isEnabled
@@ -313,7 +313,14 @@ public class GtkComponentPeer extends GtkGenericPeer
// seems expensive. However, the graphics state does not carry
// over between calls to paint, and resetting the graphics object
// may even be more costly than simply creating a new one.
- synchronized (paintArea)
+ Rectangle paintArea;
+ synchronized (this)
+ {
+ paintArea = currentPaintArea;
+ currentPaintArea = null;
+ }
+
+ if (paintArea != null)
{
Graphics g = getGraphics();
try
@@ -324,7 +331,6 @@ public class GtkComponentPeer extends GtkGenericPeer
finally
{
g.dispose();
- paintArea = null;
}
}
}
@@ -339,7 +345,14 @@ public class GtkComponentPeer extends GtkGenericPeer
|| (awtComponent.getWidth() < 1 || awtComponent.getHeight() < 1))
return;
- synchronized (paintArea)
+ Rectangle paintArea;
+ synchronized (this)
+ {
+ paintArea = currentPaintArea;
+ currentPaintArea = null;
+ }
+
+ if (paintArea != null)
{
Graphics g = getGraphics();
try
@@ -350,7 +363,6 @@ public class GtkComponentPeer extends GtkGenericPeer
finally
{
g.dispose();
- paintArea = null;
}
}
}
@@ -776,10 +788,10 @@ public class GtkComponentPeer extends GtkGenericPeer
synchronized (this)
{
Rectangle newRect = e.getUpdateRect();
- if (paintArea == null)
- paintArea = newRect;
+ if (currentPaintArea == null)
+ currentPaintArea = newRect;
else
- Rectangle.union(paintArea, newRect, paintArea);
+ Rectangle.union(currentPaintArea, newRect, currentPaintArea);
}
}