optimize common case of having no dirty rectangles
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1902 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: FrameRepaintManager.java,v 1.14 2002/11/05 05:49:31 mdb Exp $
|
// $Id: FrameRepaintManager.java,v 1.15 2002/11/05 18:52:11 ray Exp $
|
||||||
|
|
||||||
package com.threerings.media;
|
package com.threerings.media;
|
||||||
|
|
||||||
@@ -219,8 +219,13 @@ public class FrameRepaintManager extends RepaintManager
|
|||||||
*/
|
*/
|
||||||
public void paintComponents (Graphics g, FrameManager fmgr)
|
public void paintComponents (Graphics g, FrameManager fmgr)
|
||||||
{
|
{
|
||||||
// swap out our hashmap
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
// exit now if there are no dirty rectangles to paint
|
||||||
|
if (_dirty.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// otherwise, swap our hashmaps
|
||||||
HashMap tmap = _spare;
|
HashMap tmap = _spare;
|
||||||
_spare = _dirty;
|
_spare = _dirty;
|
||||||
_dirty = tmap;
|
_dirty = tmap;
|
||||||
|
|||||||
Reference in New Issue
Block a user