GUI slowdowns

Investigating further game slowndowns I have come across mutiple repainting of PlayArea.
To see that, consider placing this code at the beginning of forge.view.arcane.PlayArea.wrap(CardStackRow, List<CardStackRow>, int)
I also ran profiler to play a number of turns in a match - there were some 146k calls to wrap(...), that summed up took 5 seconds.
There should not be that many repaints. Who knows what causes them?
To see that, consider placing this code at the beginning of forge.view.arcane.PlayArea.wrap(CardStackRow, List<CardStackRow>, int)
- Code: Select all
private int cntRepaints = 0;
private int wrap(final CardStackRow sourceRow, final List<CardStackRow> rows, final int insertIndex) {
// The cards are sure to fit (with vertical scrolling) at the minimum
// card width.
final boolean allowHeightOverflow = this.cardWidth == this.getCardWidthMin();
System.err.format("[%d] @ %d - Repaint playarea%n", new Date().getTime(), cntRepaints++);
I also ran profiler to play a number of turns in a match - there were some 146k calls to wrap(...), that summed up took 5 seconds.
There should not be that many repaints. Who knows what causes them?