From 46b6defc06c0a2c2d75b2aace4953c4116226c81 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 27 Apr 2002 22:39:45 +0000 Subject: [PATCH] Removed some debug logging; tried the buffer strategy approach which won't work because we're not painting everything on every frame, but left the commented out alternative rendering code in there in case we want to fiddle with it at a later date (or provide support for buffer strategies for applications that do want to paint everything). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1306 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/media/FrameManager.java | 44 +++++-------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/src/java/com/threerings/media/FrameManager.java b/src/java/com/threerings/media/FrameManager.java index 04d3a1a3a..25bd977cf 100644 --- a/src/java/com/threerings/media/FrameManager.java +++ b/src/java/com/threerings/media/FrameManager.java @@ -1,5 +1,5 @@ // -// $Id: FrameManager.java,v 1.4 2002/04/27 18:59:27 mdb Exp $ +// $Id: FrameManager.java,v 1.5 2002/04/27 22:39:45 mdb Exp $ package com.threerings.media; @@ -246,11 +246,11 @@ public class FrameManager */ protected void paintParticipants (long tickStamp) { - // create our buffer strategy if we don't already have one - if (_bufstrat == null) { - _frame.createBufferStrategy(2); - _bufstrat = _frame.getBufferStrategy(); - } +// // create our buffer strategy if we don't already have one +// if (_bufstrat == null) { +// _frame.createBufferStrategy(2); +// _bufstrat = _frame.getBufferStrategy(); +// } // create our off-screen buffer if necessary GraphicsConfiguration gc = _frame.getGraphicsConfiguration(); @@ -271,10 +271,10 @@ public class FrameManager Rectangle bounds = new Rectangle(); Graphics g = null, fg = null; - Insets fi = _frame.getInsets(); try { g = _backimg.getGraphics(); fg = _frame.getGraphics(); +// g = _bufstrat.getDrawGraphics(); // if the image wasn't A-OK, we need to rerender the // whole business rather than just the dirty parts @@ -314,18 +314,11 @@ public class FrameManager try { // render this participant -// Log.info("Rendering [comp=" + pcomp.getClass().getName() + -// ", bounds=" + StringUtil.toString(bounds) + "]."); - g.setClip(bounds); g.translate(bounds.x, bounds.y); pcomp.paint(g); g.translate(-bounds.x, -bounds.y); -// // copy the off-screen buffer on-screen -// fg.setClip(bounds); -// fg.drawImage(_backimg, 0, 0, null); - } catch (Throwable t) { String ptos = StringUtil.safeToString(part); Log.warning("Frame participant choked during paint " + @@ -334,9 +327,8 @@ public class FrameManager } } - // Log.info("insets: " + fi + ", fb: " + _frame.getBounds()); - // _frame.paint(g); fg.drawImage(_backimg, 0, 0, null); +// _bufstrat.show(); } finally { if (g != null) { @@ -348,22 +340,6 @@ public class FrameManager } } while (_backimg.contentsLost()); - -// Graphics g = null; -// try { -// g = _bufstrat.getDrawGraphics(); -// _frame.paint(g); -// _bufstrat.show(); - -// } catch (Throwable t) { -// Log.warning("Frame rendering choked."); -// Log.logStackTrace(t); - -// } finally { -// if (g != null) { -// g.dispose(); -// } -// } } // documentation inherited @@ -473,8 +449,8 @@ public class FrameManager /** Our custom repaint manager. */ protected FrameRepaintManager _remgr; - /** The buffer strategy used to do our rendering. */ - protected BufferStrategy _bufstrat; +// /** The buffer strategy used to do our rendering. */ +// protected BufferStrategy _bufstrat; /** The image used to render off-screen. */ protected VolatileImage _backimg;