diff options
author | Deepak Bhole <[email protected]> | 2010-11-04 16:44:27 -0700 |
---|---|---|
committer | Deepak Bhole <[email protected]> | 2010-11-04 16:44:27 -0700 |
commit | 66292226de4b8120307cf4a5fd283260963e0e6f (patch) | |
tree | bc485775367b481a18f820f4bb84000f30886aff /plugin/icedteanp | |
parent | b4a175cdf642bb058b183dcf66f264aa85630354 (diff) |
Double-buffer applet frame drawing.
Diffstat (limited to 'plugin/icedteanp')
-rw-r--r-- | plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 25 |
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); + } } |