From 05d72fb406fedfd13789ebc138022e260cb627e7 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 21 Jan 2005 23:59:04 +0000 Subject: [PATCH] In the fix for the macintosh copy area bug, it's pointless to compute the rectangle of the area that would have been copied, as we know that the _entire_ visible area is now dirty due to the failed copy. Replace the list of dirty rectangles with one rectangle encompassing everything, it will cut down on the iterations in the paint() method and should improve performance on the JVM that exhibits the copyArea bug. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3307 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/VirtualMediaPanel.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/java/com/threerings/media/VirtualMediaPanel.java b/src/java/com/threerings/media/VirtualMediaPanel.java index 7ee9f6b4b..1fb9d7f05 100644 --- a/src/java/com/threerings/media/VirtualMediaPanel.java +++ b/src/java/com/threerings/media/VirtualMediaPanel.java @@ -390,16 +390,8 @@ public class VirtualMediaPanel extends MediaPanel height - Math.abs(_dy), -_dx, -_dy); } catch (Exception e) { // HACK when it throws an exception trying to do the - // copy area, just tag the are we were trying to copy - // to onto the end of the dirty rects array. - int length = dirty.length; - Rectangle[] ndirty = new Rectangle[length + 1]; - System.arraycopy(dirty, 0, ndirty, 0, length); - ndirty[length] =new Rectangle(_vbounds.x + cx-_dx, - _vbounds.y + cy-_dy, - width - Math.abs(_dx), - height - Math.abs(_dy)); - dirty = ndirty; + // copy area, just repaint everything + dirty = new Rectangle[] { new Rectangle(_vbounds) }; } } else { gfx.copyArea(cx, cy,