aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/icedteanp
diff options
context:
space:
mode:
authorDeepak Bhole <[email protected]>2010-11-04 16:44:27 -0700
committerDeepak Bhole <[email protected]>2010-11-04 16:44:27 -0700
commit66292226de4b8120307cf4a5fd283260963e0e6f (patch)
treebc485775367b481a18f820f4bb84000f30886aff /plugin/icedteanp
parentb4a175cdf642bb058b183dcf66f264aa85630354 (diff)
Double-buffer applet frame drawing.
Diffstat (limited to 'plugin/icedteanp')
-rw-r--r--plugin/icedteanp/java/sun/applet/PluginAppletViewer.java25
1 files changed, 25 insertions, 0 deletions
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);
+ }
}