aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--plugin/icedteanp/java/sun/applet/PluginAppletViewer.java25
3 files changed, 31 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 500e6f8..e5397a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-04 Deepak Bhole <[email protected]>
+
+ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (update):
+ Override method and implement double-buffering.
+
2010-10-28 Andrew John Hughes <[email protected]>
* Makefile.am:
diff --git a/NEWS b/NEWS
index 4057e37..2b403e2 100644
--- a/NEWS
+++ b/NEWS
@@ -12,3 +12,4 @@ New in release 1.0 (2010-XX-XX):
* Initial release of IcedTea-Web
* PR542: Plugin fails with NPE on http://www.openprocessing.org/visuals/iframe.php?visualID=2615
+* Applets are now double-buffered to eliminate flicker in ones that do heavy drawing
diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
index a43a3f2..c5e0886 100644
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
@@ -359,6 +359,9 @@ import com.sun.jndi.toolkit.url.UrlUtil;
private static Long requestIdentityCounter = 0L;
+ private Image bufFrameImg;
+ private Graphics bufFrameImgGraphics;
+
/**
* Null constructor to allow instantiation via newInstance()
*/
@@ -2163,4 +2166,26 @@ import com.sun.jndi.toolkit.url.UrlUtil;
}
}
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * This method calls paint directly, rather than via super.update() since
+ * the parent class's update() just does a couple of checks (both of
+ * which are accounted for) and then calls paint anyway.
+ */
+ public void update(Graphics g) {
+
+ // If the image or the graphics don't exist, create new ones
+ if (bufFrameImg == null || bufFrameImgGraphics == null) {
+ bufFrameImg = createImage(getWidth(), getHeight());
+ bufFrameImgGraphics = bufFrameImg.getGraphics ();
+ }
+
+ // Paint off-screen
+ paint(bufFrameImgGraphics);
+
+ // Draw the painted image
+ g.drawImage(bufFrameImg, 0, 0, this);
+ }
}